Moving multi level


I’m trying to use the moving example with a multi level mesh.

With my current setup, it works well with a small moving vehicle which has a single floor. It tracks correctly position and rotation.

I’ve tried a more complicated scenario and have scanned a mesh which results in multiple levels. (pro version). Immagine a ship with multiple levels and stairs. Now I’m trying to have this on a moving parent, using the exact same configuration, and the agents do not move. They just follow the vehicule and don’t respond when I set the target and call UpdatePath() method.

I may not have understood the lifecycle. Is it ok to set the target followed by UpdatePath? Is it maybe a race condition where it keeps recalculating the path? I placed a bunch of break points everywhere and can’t see anything wrong, as there’s no error and everything seems to check out. What information should I look for and/or share here?

This image shows that the path was resolved correctly by both agents on this ship. And yet, they just stand still and are not progressing towards the target.

I’ve traced the code and have discovered a potential bug in the code. Below is a list of code paths and what happens. Seems that the LevelGridNodes are not supported by RichPath.

ITerates on nodes.
Actual node type is LevelGridNode.

Checks for the Node type. Assert is for TriangleMeshNode. 

Passes the node tp NodeLink2.GetNodeLink.

References is empty. REturns null.

Loop ended. No nodes created.

The RichAI agent is written specifically for navmesh based graphs, it will not work on layered grid graphs unfortunately.
Currently there is no example script for moving a layered grid graph, however the same principle as is used for the local space rich AI can be applied when using a layered grid graph (the documentation for that class as well as the code comments explains how it is done).

I ended up subclassing a simpler controller and got it working.


1 Like

Nice that you got it working!