Sunday, July 26, 2015

CMaking Recast and Killing Copies

The next step was to set copies to kill themselves after a certain point in time; this required me to setup a deltaTime (which will be used for velocity changes as well in the future) by using GetTickCount64() and setting the current time as a previous time to calculate the change between frames.

However, the big question was, how will the AI work? A* was a possibility, but a grid is a bit firm for full 3D movement and can get tricky with non-square terrain. Luckily, a Mikko Mononen included an open source navigation mesh library, Recast. Navigation meshes are a bit more complex, but allow me to setup a mesh of 2D polygons that specify where the AI is supposed to go. Combine that with targeting the player, and we may have a good enough AI on our hands.

Getting the library is half the battle, however; the code is there but needs to be properly compiled before usage in Visual Studio. CMake is a good way to compile libraries, but I was very used to having CListMake files already made for me, as if many people have had this problem. I even used a couple that somebody made for an earlier version, and ended up confused on what was wrong. Turns out I needed to have a little more complex understanding of where to specify my source and include files, and even had to make a few from scratch. Luckily, everything ended up alright, and I have a set of libraries I can use for some work with navigation meshes.

No comments:

Post a Comment