New navigation mesh

posted in trill41 for project ABx
Published November 03, 2020
Advertisement

As mentioned earlier, ABx uses a navigation mesh to find routes from one point to another. There was the suggestion to include static scene objects, such a buildings, into the navigation mesh, so the route finding algorithm (in case of ABx this is Detour) automatically navigates around those obstacles. This solves many problems with adjusting the route on the fly when the character is going to collide with an object.

How does it work?

In ABx the terrain has a height map, which is a simple black/white image where brighter colors are higher altitudes.

Simple height map

A custom program takes this image and constructs a 3D mesh from it.

Height map 3D mesh

Then the same program adds all static objects (actually just their bounding volumes, at the moment only bounding boxes and spheres) to this mesh.

Height map with static objects

After all meshes are collected and merged into one big mesh, it generates the navigation mesh, just like the RecastDemo does. In the game an actor can only step on blue fields, and only these fields are considered when finding a route.

All this is done fully automatic, taking the Urho3D source scene, reading the height map and static objects and feeding the navigation mesh generation program with it. The above mesh is flipped because it uses right hand coordinates, while Urho3D uses left hand.

Urho3D source scene (left hand coordinates)

There is a short video demonstrating it: https://devtube.dev-wiki.de/videos/watch/d7bb6cd6-86ef-4652-98ed-89f68b61a25b.

Previous Entry Autonomous movements
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Advertisement