Hi Abdizriel, thanks for your generous feedback.
-
In the FPS Tower Defense Toolkit, the tower construction & combat mode are mutually exclusive modes. So the AI does not need to update it’s path on the move because it has already been determined in the tower construction phase itself. I was checking if the path exists by first placing a holographic tower to block the path & then verify if there could be an alternate path from the spawn point to the core. However, in the Tower Defense Starter Kit, you can set up towers both prior to the wave as well as during the actual wave. As a result, spawning a holo tower to block the path is not an option since it will block the enemy AI as well. Which leaves us with two options: disable tower spawn during the wave, or use a custom pathing algorithm like A*. I can look into the first option in the next update, maybe add it as an optional feature. I will try it out in the coming weeks & let you know. As for the second option, it is something that I want to try, but it’s more of a long term goal for the toolkit.
-
To enable dynamic AI pathing, first you would have to set the ‘RunTimeGeneration’ parameter of recast nav mesh to ‘Dynamic Modifiers only’ as shown in the screenshot.
After that, set the Navigation type parameter in the Wave Manager to ‘Dynamic’. With both of these options turned on, the AI dynamically alter their path once you have placed a tower in their path. However since the default box extent of the nav modifier volume component in the Towers are set to a low value, the AI units can pass in between towers. If you do not want them to pass through, you can increase the box extent of the nav modifier volume in the x & y direction as shown below:
As you can see, I have increased the box extent in the x & y directions from 75 to 180 [almost close to half the default grid size]. The nav modifier volume basically prevents the enemy units from passing through it. So with a high enough value, now the AI units will have to go across the outer perimeter.