[Question] AI Navigation in a Procedurally Generated Environment?
Hey guys!
Curious to hear your thoughts on the best way to handle AI navigation in a procedurally-generated game environment when the environment doesn't know how large/small or what direction it will be built in.
Should we be looking to create one Nav Mesh volume large enough to encompass everything? A separate Nav Mesh for separate tiles? Can the Nav Mesh be edited dynamically to match the level bounds? Any pointers here would be awesome! Thanks!
Posted Jun 3, 2016, 2:51 AM UTC
66
You'll need to turn on rebuilding the navmesh at runtime: Project Settings > Engine > Navigation Mesh > Run time > Rebuild at runtime
The nav mesh volume can be edited.
I would suggest going with 1 volume.
Thank you! Excellent insight.
I would assume we should also be looking to edit the bounds of other important volumes like Lightmass Importance and others through the level blueprint or C++?
With dynamic navmesh rebuilds, if you're using procedural meshes they won't trigger rebuilds, so that's something to be aware of, and there's an answerhub explaining you also need to trigger an update manually when changing the navmeshboundsvolume:
Answerhub on navmeshbounds updates
Example:
The lightmass importance volume won't do anything if your level is procedural - you'll need to turn on all the dynamic lighting switches and turn static lighting off. The performance penalty for this is extremely high. There's a good set of options for making things not look awful here
Interesting. Even with prefab room tiles and a base three-point dim lighting setup using toned down directional lights? Entire game takes place indoors in a dungeon. The prefab tiles all have torch BPs in them that contain a point light.
As far as I know, you can't use static lighting with dynamically placed meshes. There's tons of people asking the same question because they're all making ARPGs and I'm yet to see any particularly positive answers. Either the levels are static and you get static lighting, or you do dynamic levels and have to use dynamic lighting. Even small changes like knocking down a wall in Fortnight required the DFAO technique linked in that thread.