Register for your free account! | Forgot your password?

You last visited: Today at 18:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Some questions :3

Discussion on Some questions :3 within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
Some questions :3

Heya \o/ ;3

Long time no see you all haha
So, let's just say, i'm back...

I was a little bored then i decided to code CO again, and hmm, Well... Two days ago i started a 5095 source... for now it has just the basics but to continue i would like a little of help with the screen system...

Basically there is a main thread for the players...

OnTimer() method will call user ontimer... and user will call screen check..

for now, i'm doing basically this to remove the entities from screen:

i know you're going to ask: But if you're removing entities from screen when they're out of range, what's the problem?

I'd just like an opinion about the way to remove entities from screen... i guess, call it every time when player move somewhere may take a lot of memory for nothing... so basically i did this way for now only...

other questions will come soon
Thanks in advance ^^
12tails is offline  
Old 12/06/2013, 00:31   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Quote:
Originally Posted by 12tails View Post
I'd just like an opinion about the way to remove entities from screen... i guess, call it every time when player move somewhere may take a lot of memory for nothing... so basically i did this way for now only...

The best way to do anything is 'as needed'.

The only time that objects on your screen will change is

A: When you move
B: When they move


All Entities (objects that need to know about their surroundings) should be keeping track of all locatable objects on their screen. These locatable objects are updated whenever the entity, or the objects are added/removed/moved and are ONLY despawned manually during the remove process (out of range the client handles on its own)


So something like

ILocatableObject (stores UID + Location information)

Entity: ILocatableObject

List<uid> NearbyObjects
OnMove()


You dont need to track the entire objects as they are all uniquely numbered. Knowing the UIDs of objects on your screen lets you easily track what objects are new on your screen to send spawn packets.


Inside your OnMove code you would perform object relation checks by querying all UIDs from the map at your new location, comparing to UIDs near your old location and then adding/removing from eachother's collection as needed.


Redux is a half decent example of this although it got a bit messy throughout the more recent additions.
pro4never is offline  
Old 12/07/2013, 00:55   #3
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
Going to check yor release p4n... thanks
12tails is offline  
Reply




All times are GMT +1. The time now is 18:39.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.