Dynamic Navigation Mesh
I'm currently working on a third-person shooter where the player has the posibility to build objects inside the world to defend himself against enemy waves. I was wondering if it is possible to use a dynamic navigation mesh that updates everytime the player spawns an object. Maybe by using some kind of technique where you add the object to the navigation mesh as a point of intrest for the AI. I thought I could use an array of all the objects that where placed and when the AI get's near one of them he will attack them, but performance wise I don't think this will be completly optimized. Also when I spawn an object and the path is blocked by a spawned object the AI's navigation is broken because th AI still thinks he can pass.
Kind Regards Dyronix
asked May 06 '15 at 09:17 AM in C++ Programming
It's perfectly doable, and it's actually a really well tested use case since that's what Fortnite essentially does in terms of navigation. You need to make sure you have navmesh configured for runtime generation (do that via Project Settings -> Navigation Mesh -> Runtime Generation) and it should work out of the box.
A word of advice: whenever possible mark the items build-able by player as navigation obstacles (there's an option for that in Static Mesh editor, in Navigation section of the properties). The upside of using obstacles is that it's a lot faster to rebuild navmesh tiles. The downside is that obstacles annotate navmesh, but do not create new walkable areas, so creating an AI-walkable staircase with obstacles is not possible.
For more tips regarding tweaking navmesh generation see this twitch stream I did some time ago: https://www.youtube.com/watch?v=7LaazCv4rB0
answered May 06 '15 at 02:52 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here