Navmesh/Recast graph + custom graph

We would like to write a custom graph which uses splines to define some special paths for our world that are excluded from normal graph generation. Our spline endpoints are positioned on a triangle that’s included in navmesh/recast graphs and these are the “link” points.

To visualize this, imagine a river that winds its way around a level which has bridges that cross the river. Or an underground metro system. There are points where the boat docks or trains stop and NPCs can board to another location. Boats and trains have schedules so the cost of taking a train or boat changes and is evaluated when try to find the best path.

We’d like to be able to plot a course from one point in the world to another that can walk, then ride, then walk to reach the final destination.

What is the best way to connect these two systems together? Is there a way when searching for a path that it takes into account all known graphs and their constraints?

Or should/could I fake it and simply add additional nodes to the built-in graph after it’s done generating to connect my spline’s nodes to existing graph nodes in the generated graph? Or? Do I need to override the search or other methods?

Thanks,
Brett

I’m thinking this is a good fit for point graphs? You can define the different “stages” of transport with different graphs perhaps?

Maybe have links between the different modes of transport- like going to hypothetical WalkingNode23 has an Off-Mesh link to MetroNode16- you could even configure the off-mesh link to just “wait until a certain time”.

And for the “wait times” between transportation methods, you’d want to probably set the “cost” of the off-mesh link during runtime- every second the “cost” of traversing that off-mesh link would become cheaper.

I’m thinking that’s the play here, but let me know if that doesn’t work!

Thanks for the note and tips. Took a look and I think this is similar to what we have in mind. I think we will use this to guide our own custom graph using splines.

1 Like