Which would provide better performance?
by Matt W · in Torque Game Engine · 06/19/2002 (3:26 pm) · 1 replies
Not sure if many of you remember my radar resource I posted about two months ago, but I have begun working with it again to integrate it into my own project.
It currently (among other things) scans through all players on client-side and then determines of they are close enough to you to render on the compass. Needless to say, it's wasting some effort when looking at players who are out of range.
I originally had it examine all things present within a container, and it'd only be checking what was found in there. My worry about that was that with my understanding of containers: every check would have to be made server-side then sent to the player's screen.
Can someone offer some insight into this?
It currently (among other things) scans through all players on client-side and then determines of they are close enough to you to render on the compass. Needless to say, it's wasting some effort when looking at players who are out of range.
I originally had it examine all things present within a container, and it'd only be checking what was found in there. My worry about that was that with my understanding of containers: every check would have to be made server-side then sent to the player's screen.
Can someone offer some insight into this?
Torque Owner Jarrod Roberson
My personal opinion is to develop something that works, then make is stable and then make it fast.
If you do find that it is a performance issue, bucketing the players and having those player objects automatically move themselves from one bucket to another as they move around the map would allow you to just test the buckets adjacent to the players bucket to see if they contained anything and if they did draw the players in the adjacent buckets where ever they need be.
This can be done in 3D very easily also, where the bucket would represent a volume instead of a plane.
There are many differnt implementations that will work for this type of bucketing/pooling of objects.
This is a fair amount of work and introduces an over head in itself, so unless the list is huge and takes an inordinate amount of time to iterate thru, it might not be worth the effort.
Look at some of the path finding algorithms they work similar and solve a similar problem of reducing the scope of a search.