I’m running into an issue with using dynamic navmesh on a dedicated server. It does not seem to update at all. The navmesh updates correctly in both standalone and listen server, it is only on dedicated server where it does not work. More details below but my question is what are the things that could cause the dynamic mesh to not update in only that environment? Also I don’t understand how I can debug things like navigation mesh on the dedicated server since it doesn’t exist on the clients.
The game has a building system where you can place floors, walls and stairs to make buildings. These need to both block navigation (walls + stairs) and allow the character to navigate on top of them (floors + stairs). The characters in the game are ‘RTS-style’ where they are AI controlled with objectives set by the player controller. When it is working correctly (stand alone + listen) they will navigate around walls and stairs, and are able to climb stairs and walk on the placed floors. Only on dedicated server they do not account for the buildings and navigate as if the pieces do not exist.
Just an extra note, it also does work on dedicated server when run through the editor. Only on a ‘true’ dedicated server (packaged, deployed server and connected from packaged client) does it not work
This is an old post, however it is the first result when googling this issue and I haven’t seen the issue mentioned elsewhere or in docs, so I thought I’d mention the fix.
After experiencing this issue for multiple years and working around it, we found a fix by adding the following to the server target.cs:
//This is necessary to allow dedicated servers to update nav
//Dedicated servers don't support async nav updating
GlobalDefinitions.Add("RECAST_ASYNC_REBUILDING=0");
GlobalDefinitions.Add("ALLOW_TIME_SLICE_NAV_REGEN=1");
The first line disables async rebuilding, which is where the navigation sys gets stuck initially as it doesn’t seem to kick off any of the async tasks, and the second line enables time sliced regen (Regen is used instead of rebuild here for some reason), which updates tiles incrementally. it’s worth noting that “gNavmeshSynchronousTileGeneration”, which you would think would also fix this issue, does not work. Hope this helps someone else!
Not certain if this issue occurs on all dedicated servers with non-static nav, or if there is some other prerequisite. It would be nice if the servers didn’t fail silently in this respect, or if there was some easy way to re-enable multi threading on dedicated servers if one so desired.
edit:
worth noting, we are in 4.27, I have not checked if this issue still occurs in 5.X.
the easiest way to check if this issue is occurring/fixed is via the gameplay debugger in a packaged development build (GD data is replicated from server to client)