Quote:
Originally Posted by DarkMessiah
if you get more people than [max allowed per cell] stacked in one spot, does the server crash trying to split it?
|
On the same Cordinate?
No, for starters the players do not move through the QuadTree in the same manner as npcs, as a result they dont atually directly effect the trees layout, not yet anyway. Im not sure im going to bother having Players or Monsters split the tree when they navigate through it.
However if i were to do that then i would have it so that if it cant find a more suitable location then they will remain within the same section. Also i could add a maximum number of layers for the tree, so that it bottoms out at say 5 layers, so in the case that your describing it would branch out to its maximum lowest layer and all entitys would reside there. Not exactly efficient however i dont really intend to go down this route.
Quadtrees are designed primarily to hold static objects which do not move, because of the way the entitys are designed, once they are in the quadtree, they move around, however they are contained in their original entry point (obviously a flaw), when their cordinates change, they move within the overall quadtree, but they are still contained in their entry point. This doesnt cause any problems, so i may just modify the quadtree to have an object store in it where dynamic entitys are stored, and then they will just move around the tree like normal.
So to sum up, no it doesnt crash the server because of the way the entitys interact with the tree. However this quadtree is by no means finshed, if i were ever to release a .dll with this functionality i would definately implement the neccassery checks to ensure this could never happen.
Ultimately i need to finsh the tree.