Right foot, left foot (I)

It’s been a while since I’ve introduced a NEW feature in Crimild. I mean, this is not a refactor or an improvement over something already there, but a completely new thing. Exciting, right?

So, without further ado…

NAV MESHES!!

Navigation meshes are the other big feature to be included in Crimild’s next release (soon). Simply put, a NavMesh is a data structure used for navigation (duh) and pathfinding on complex spaces. It defines a set of polygons (i.e. triangles), describing areas that are traversable by agents in a simulation, simplifying things like collision detection with walls and other static objets. Basically, it defines what “the floor” means for our game.

The current implementation is pretty basic, but I implemented a tool for loading nav meshes from geometry described in OBJ files. That way, you can create a whole level and its nav mesh in a 3D editor like Blender (and I don’t have to write a level editor at this stage). Once loaded, triangles are linked together automatically based on edge sharing. It’s simple, but it’s more than enough for my secret project ;).

There’s a demo already available in the examples projects with a simple scene and a walking character. Check it out:

This slideshow requires JavaScript.

The next step is to add support for “bridges” in the geometry (as in characters walking below other parts of the level) and pathfinding tools (like A* or other techniques).

See you next time!