How can I chose the depth of a quadtree?

Posted by Evpok on Game Development See other posts from Game Development or by Evpok
Published on 2014-06-10T22:24:15Z Indexed on 2014/06/11 9:44 UTC
Read the original article Hit count: 309

In a 2d world, using a quadtree to prune pairs in collision detection, how can I chose the depth of said quadtree?

The world I am dealing with is mostly made of moving objects¹, so the cost of dispatching the objects between the quadtree cells matter. So what I am interested in is the balance between the gain from less collision checking and the loss from more dispatching.


1. To be completely explicit, autonomous self-replicating cells competing for food sources, in an attempt to show my pupils predator-prey dynamics and genetic evolution at work

© Game Development or respective owner

Related posts about collision-detection

Related posts about quadtree