Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualfreeworld

Posted 21 February 2013 - 04:13 PM

I think you would be better served with a loose quadtree, which allows for a bigger range of motion because each quadtree node has motion on it.


As for your tree being "20-30+ nodes deep", you must either have an amazingly big world or a extremely tiny subdivision space.

At 1 meter per cell, a 20 deep quadtree will cover an area of just over one million meters by one million meters. Roughly the entire land mass of New York City at a one-meter-per-cell ratio.

A 30 deep quadtree will cover over the entire state of California, or the entire state of Texas, at one millimeter per cell accuracy.


For our complete 10km square world we have a depth 10 loose quadtree at 1 cell per meter.

 

It came out right in my head.... I meant it could be checking that many nodes each time, (5 - 7 nodes deep multiplied by the 4 nodes each might possibly check). I'm using the quad tree for several objects in my game, all but one are very static so I don't have to worry about those.

 

One container stores all the aI-creatures though, and I use a system similar to diablo where only awake creatures are ever updated, and any creatures outside a certain range from the player are automatically considered a sleep. So in theory I will only ever move creatures in close range to the player. But these objects can move from one side of the world to the other instantly but that shouldn't happen often.

 

The other big question I forgot to ask, is an easy way to find all the nodes that border a node?


#1freeworld

Posted 21 February 2013 - 04:12 PM

I think you would be better served with a loose quadtree, which allows for a bigger range of motion because each quadtree node has motion on it.


As for your tree being "20-30+ nodes deep", you must either have an amazingly big world or a extremely tiny subdivision space.

At 1 meter per cell, a 20 deep quadtree will cover an area of just over one million meters by one million meters. Roughly the entire land mass of New York City at a one-meter-per-cell ratio.

A 30 deep quadtree will cover over the entire state of California, or the entire state of Texas, at one millimeter per cell accuracy.


For our complete 10km square world we have a depth 10 loose quadtree at 1 cell per meter.

 

It came out right in my head.... I meant it could be checking that many nodes each time, (5 - 7 nodes deep multiplied by the 4 nodes each might possibly check). I'm using the quad tree for several objects in my game, all but one are very static so I don't have to worry about it.

 

One container stores all the aI-creatures though, and I use a system similar to diablo where only awake creatures are ever updated, and any creatures outside a certain range from the player are automatically considered a sleep. So in theory I will only ever move creatures in close range to the player. But these objects can move from one side of the world to the other instantly but that shouldn't happen often.

 

The other big question I forgot to ask, is an easy way to find all the nodes that border a node?


PARTNERS