Original Post
I'm currently attempting to implement a quadtree using this article here on GDNet. I intend to use it to store units in my 2D RTS game, written in C#. However, I do have a few questions: 1) Is it necessary to store my tree in an array? Or can I use a standard tree layout where each node contains 4 child nodes? 2) From what I can tell, the QT splits up the map in zones(obviously, since it's the purpose of it), but how do I handle if the current camera is in 2 leafs on the tree? Traverse both leafs and draw the units in the leafs that are in the actual bounds of the camera? 3) Currently, I use a Point to determine the bounds of each zone. First point is the top left, and the second one is bottom right. I want to store units by position, so this means, each cell is 16x16. How do I go on with this when creating the QT? Give total size of the zone, and a minimum size of w/h and then keep iterating until I reach 16x16? Toolmaker