The upcoming 1.2 Update introduces numerous new AI features, leading to several significant changes affecting the NavMesh and road network for map creators. Additionally, there's an update to the server configuration parameter, disableNavmeshStreaming, which improves memory usage when turned off or the reactivity and performance of AI systems when turned on.
NavMesh
Changes were made to tile sizes and the parameters of the NavMesh for both Soldier and BTRlike projects. To avoid any potential compatibility issues, it’s recommended to rebuild both projects. Failure to do so will result not only in compatibility issues but also in AI's failure to use cover points.
Certain entities can be destroyed in the game and are passable by heavier vehicles such as trucks and BTRs. This is also represented on NavMesh by marking polygons around destructible entities. For this purpose, we utilize the ChimeraNavmeshWorld within the NavmeshWorldComponent (which is attached to the AIWorld) instead of the default NavmeshWorld. Each vehicle comes with predefined flags on its AIPathfindingComponent for navigation and driving. However, these flags can be modified using the BT nodes AITaskSetPathfindingFilters and AITaskResetPathfindingFilters to alter the vehicle's pathfinding behavior.
(NavMesh marked around destructible stone posts)
(Setup of NavMesh flags on AIPathfindingComponent)
(AITaskSetPathfindingFilters node)
To address the issue of higher memory consumption by NavMesh projects, particularly the Soldier project, a system was introduced to stream NavMesh on demand in the game's early access. This enhancement ensures that the game runs smoothly on all platforms, though it does result in slower AI response times when searching for paths and an overhead of loading and unloading NavMesh tiles.
With the release of build 1.0.0, a new server configuration option was made available https://community.bistudio.com/wiki/Arma_Reforger:Server_Config#disableNavmeshStreaming. This option allows for the disabling of NavMesh streaming, opting instead to load all NavMesh data into memory at the world's start. The latest update modifies this parameter to accept an array of strings, enabling specific projects to be exempt from streaming or allowing for the restoration of the original behavior by leaving the array empty.
For those hosting a dedicated server, it is recommended to disable streaming altogether if the additional memory usage is not a concern. This can lead to performance improvements. For a game map the size of GM_Eden, the memory footprint for NavMesh projects is approximately 2.5 GB at the world's start. However, the actual size of the navmesh will vary based on the size and complexity of your game world.
We've enhanced the process of generating cover points during the NavMesh build process. Now, cover points are connected to the specific NavMesh polygons where they are located. This improvement ensures that, when assessing potential cover points, we can accurately determine the actual path length to a cover point rather than making an estimate based on a straight-line distance. This improvement is expected to aid AI soldiers in making more informed decisions regarding cover point selection in complex areas.
However, it's important to note that this update has altered the binary format of the NavMesh. This change highlights another reason why the NavMesh needs to be rebuilt. If not updated, AI soldiers will not be able to utilize the new cover points effectively.
(Screenshot of run time AI cover query visualization with polygon traversal in CheatMenu → AI → Show Cover Query)
Road network
The most significant contribution from the AI team has been AI driving, with the road network playing a crucial role. The road network gathers all the roads from the map, based on the filter applied to the AIWorld, and constructs a graph that enables quicker and more focused pathfinding for vehicles navigating the map. Several steps need to be taken into consideration to ensure the pathfinding is as efficient and reliable as possible.
It's important to ensure that roads on the map are correctly designated with their respective types. The default setting for road type is Runway, which likely hasn't been updated. The SCR_AIWorld.ent prefab is configured to recognize Road Main, Road Minor, and Road Trail types. Adhering to these recommended settings facilitates optimal AI system use.
(Used road types in roadnetwork)
Exciting news - driving over bridges is now possible (at last)! To enable this feature, you must add a RoadNetworkBridgeComponent to any bridge linking two roads. Within this component, you can specify the bridge's points. These bridges will then be integrated into the road network during game startup, ensuring a seamless driving experience.
(Bridge link setup)
(Bridge link inserted into roadnetwork)
While RoadNetworkBridgeComponent can be added to any entity to denote a drivable path around obstacles and the like, it's highly encouraged to opt for Invisible Roads whenever feasible. Invisible Roads come in handy in places that resemble or function as roads but aren't designated as a RoadEntity. Examples include an asphalted village square or roads made from concrete slabs. The creation of such roads is almost the same as that of any other road.
Start by creating a spline.
Next, create a RoadGeneratorEntity to generate the actual road.
Finally, on the newly created RoadEntity, make sure to turn off the Visible flag to render it invisible.
(Disabled visible flag)
Gates represent a notable and frequent obstacle type that AI units can navigate through, provided they are correctly configured. To enable this functionality, attaching a NavmeshCustomLinkComponent to each gate intended for AI passage is essential. Within this component, you must configure the NavMesh project employed by the AI driving system (which defaults to BTRlike), specify the start/end points, and indicate that the link represents a Door. Like the RoadNetworkBridgeComponent, it integrates into the road network during world startup, but only if it forms a connection. With proper setup, AI units can autonomously open, pass through, and close gates as they proceed toward their objectives.
(Setup of door link)
(Door link inserted into road network)
(Filtered inserted door link)