For context, I am making a game that will involve a maze where NPC characters will have to (simultaneously) navigate the maze. The maze however will be dynamic and changing during runtime. I was therefore wondering what is generally the best option for making changes to a navmesh at runtime.

I see in the docs for the NavigationRegion3D that it is possible to just rebake the navmesh at runtime but I've also seen quite a few warnings about it being computationally intensive (which makes sense), and also that it is quite easy to get wrong if your objects are not perfectly situated leading to bugs and characters getting stuck etc.

I was just wondering, is there a sort of best practice for this? In particular, for games like an RTS where a lot of pathfinding is involved, and players are building new structures throughout the game, how would people try and solve this if they were using a NavigationRegion3D (or would people just write their own pathfinding algorithms?) I've had quite a lot of success in 2D just cutting holes out the navigation polygon using the geometry node and from what I gather something similar is possible in 3d, although it looks a bit more complicated.

I did see you can use a bit of a trick by using multiple smaller nav regions to improve baking speed but not sure how much of an impact that has.

I am 50/50 as to whether I should stick to 2D where I actually have a pretty good working system or go 3D as long term I am more interested in working in 3D.

Keen for any feedback 🙂

If it's going to be that dynamic of an environment then perhaps the right question to ask is if navmesh is even the right answer at all?

    If your game is a RTS game, where there is often not multiple layers of navigable terrain overlapping each other (for example: a cliff and a tunnel that goes into the cliff), then you might be able to totally get away with using a 2D navigation system and then just map the results to 3D. That is what I might try if you have a working 2D solution and don't need to worry about the 3rd dimension from a movement perspective.

    I did see you can use a bit of a trick by using multiple smaller nav regions to improve baking speed but not sure how much of an impact that has.

    This is what I'd try next, if you need navigation fully in 3D - as then you can benefit from the built-in navigation and hopefully find a size that fits the sweet spot between being big enough to be useful, but small enough to not tank performance.

    Hotcrossbun To use something like A* ?

    Yes, for an example A. Though more specifically you will likely want a multi-agent pathfinding. A is commonly adapted for this.