Some questions :3

12/06/2013 00:04 12tails#1
Heya \o/ ;3 :D

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 :D
Thanks in advance ^^
12/06/2013 00:31 pro4never#2
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.
12/07/2013 00:55 12tails#3
Going to check yor release p4n... thanks :D