Saturday, August 1, 2015

Always Get Your Bounding Conditions Correct!

Today was another trial in adapting simple straight path measurement code for the pathfinder class. So far, managed a proper framework that would detail the correct path and a straight line for that path (with a max up to three steps) and follow to the point of that path. Unfortunately, there was a problem in loading the vertices correctly which led to no contours being developed, stemming from no spans in the heightfield and god knows what else. Turns out the points being loaded when creating the heightfield were constantly being compared to a set of bounds that firmly did not exist; the ymin and ymax were reversed. Luckily enough, a heavy set of debugging skills led to solve that matter and get a little more in depth understanding of this nauseatingly complex open source library.

Next up is figuring out why the dtNavMesh is not initializing properly; that seems to be the more pertinent problem, now that the Recast mesh is created properly. Ah! It seems that dtNavQuery needs its own allocation before initialization.

Now that that's all set, Detour seems to be working surprisingly well! Perhaps even better than consistently locking onto the player's position. Now the AI will be locking on to the player's movement and taking obstacles into account.

No comments:

Post a Comment