Tags

,

Somebody found a few bugs in Spamocalypse, which turned out to be an issue with my pathfinding code. I had accidentally overwritten the navmesh when I generated one for a new level, which was caused by the meshes not being loaded beforehand. I’ve added a fix for this, which is to create a static constructor to the BuildMeshEditor class in my repository. That will call the GameManger.LoadNavMeshes method.

The way static constructors work in C# is that they are always called first, and apply to all instances of the class. The constructor for the BuildMeshEditor class is called as soon as you select the cube that defines its boundaries, so the meshes are loaded in the background. If you then build a mesh for a particular level, it will be added to the list of meshes, or update/overwrite the specific one for that level. This is what it should have been doing.

In the meantime, I finally have an objective system. That’s coming in a second post.

Advertisements