PDA

View Full Version : C Linked data structures



heamaster
March 14th, 2009, 03:58 PM
Hi!
I am coding a game in C and I would like to hear your opinion about this:
I will have a large game world with many (hundreds) objects in it with their position saved in variables X and Y.
I am wondering the best way to save these objects to quickly find specific objects by their position (it shall be possible to get all objects within a certain distance from an object).

Thanks! ;)

stevescripts
March 14th, 2009, 04:21 PM
hmm ... my first impression here would be to use some sort of tree implementation.

Good luck!

Gordon Bennett
March 14th, 2009, 04:37 PM
Hi!
I am coding a game in C and I would like to hear your opinion about this:
I will have a large game world with many (hundreds) objects in it with their position saved in variables X and Y.
I am wondering the best way to save these objects to quickly find specific objects by their position (it shall be possible to get all objects within a certain distance from an object).

Thanks! ;)

Quadtrees (http://en.wikipedia.org/wiki/Quadtree)