After more musing...
Why do Nodes have 2D bounding boxes? A node has a collection of faces, and I would expect it to have a bounding volume.
SeekNode takes an (x,y) coordinate and finds a node which intersects. At no point do I see Z being taken into account. Yet in zones with multiple levels (dungeons mainly) there would not necessarily be a unique Node for a given (x,y).
This doesn't seem a difficult problem to solve, since the same process that determines the bounding box could determine the volume. Every place where SeekNode is called has a Z value available (except recursive calls to SeekNode itself).
Which brings up another question: Why are Nodes stored in a quadtree instead of an octree?
Since my thoughts deviate significantly from what the existing code does, it would appear that I am missing something important. I hope that someone who knows this area of the code will set me straight. My motivation is to keep mobs from plowing through walls, ignoring their paths since they wrongly believe they have LOS to their destination. As this has bothered me for a bit, I figured I would take a bit of time over the holidays and see if I could get to the bottom of things.
|