[gameprogrammer] Re: storing lists of units

yep it would work for 3d too but they are called "octtrees" and are
subdivided into 8 regions instead of 4 and you are working w/ rectangular
cubes.

yes indeed you are right about that A and B are close.

you need to account for that in your algorithm, to test siblings and cousins
as needed.

however quad trees are still beneficial in that you can rule out an entire
node at a time so you dont have to test each object in that node.

also if you rule out a node, all it's children, grandchildren etc are also
ruled out so you can cull a lot of possibilities out very early in the
process.

Also note if you make the smallest level of your tree too big, you wont gain
as much benefit, and if you make them too small, you can also take a smaller
preformance hit so you kinda have to tune it to see what works best for your
game

----- Original Message ----- 
From: "Roger D. Vargas" <roger@xxxxxxxxxxx>
To: "Game programmer list" <gameprogrammer@xxxxxxxxxxxxx>
Sent: Tuesday, September 28, 2004 11:34 AM
Subject: [gameprogrammer] Re: storing lists of units


> El mar, 28-09-2004 a las 13:22, Alan Wolfe escribió:
> > a good way for you might be quad trees (if you are making a 2d game).
> >
> Well, sems Ill have to implement some test apps in my free times.
> Supposing that the third coordinate is irrelevant (I mean, without
> considering heigth), quadtrees can be used for 3d games too?
> The algorithm you explain covers this case:
>            1                  2
> --------------------------------------
> |          |                  |
> |                  |                  |
> |                  |                  |
> |                  |                  |
> |                  |                  |
> |                 A| B                |
> --------------------------------------
>
> Supposing 1 and 2 are subdivided in 4 subareas, unit A is in child node
> 4 (lower right) of 1 and B is in child node 3 (lower left) of 2. If i
> traverse the tree, A and B are on different parent nodes but in reality
> they are close.
>
> -- 
> Roger Durañona Vargas
> Linux user #180787
> A cada momento nos rodea lo desconocido. Es alli
> donde uno tiene que buscar el conocimiento.
> Paul Muad'Dib Atreides. Children of Dune
>
>
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>



---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: