I ask before, but it seems like my post got lost near the top.
It seems a few people are really against using QTs, but for larger worlds I don't see how they can be worse than using a grid. So again I ask this question to learn ..
Quadtrees are not efficient in today's CPUs. Use a grid instead.
It's both incredibly easy to develop, and much, much faster.
It's both incredibly easy to develop, and much, much faster.
@Riven, as per my previous quesion .. I would have said it depends entirely on your scene and the implementation of the quad-tree whether grids are faster. I say this because I imagine that the way you store the grid would be exactly the same way you'd store a qt (in that both are essentially just AABB - but, unless I am missing something, you can then cull huge areas of your game world with a qt which you cannot do with a grid). So it would seem to me like the only difference between a grid and a at is you are removing the tree structure?
That, and you have to do bounds checking (on AABBs) for every level, up to 4 times. All in all, there are lots of conditional jumps and lots of scattered memory access. In modern CPUs you get a rather large penalty for such code.
Needless to say, using a grid is just simpler to code, which, in this case, is probably most important.
Needless to say, using a grid is just simpler to code, which, in this case, is probably most important.
@Riven Here you mention AABBs as if they are only applicable to QTs, but you would need to do this on a grid too surely? Also, can you tell me which CPU penalties you are referring to ?
Thanks,
-John


