Skip to content

Instantly share code, notes, and snippets.

@regner
Created November 22, 2022 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save regner/86ab83167034fe021d9dfd79889320de to your computer and use it in GitHub Desktop.
Save regner/86ab83167034fe021d9dfd79889320de to your computer and use it in GitHub Desktop.
<!--
##########################################################
# Generate NavMesh
##########################################################
To avoid cluttering the Horde UI with lots of individual maps, we bundle all the nodes into
GeneratedNavMeshNodes, and then append that to BuildProjectNodes as well as use that for the
labels.
As of 2022-11-14 and UE 5.0.3, the WorldPartitionBuilder commandlet doesn't support -Submit on the
WorldPartitionNavigationDataBuilder builder. The only builder that supports -Submit is
WorldPartitionHLODsBuilder. Our choice was to either edit the WorldPartitionBuilder automation
command C# code, or the WorldPartitionBuilder commandlet c++ code. Neither of which were super
enticing because they are engine code. To get around it we are simply calling the p4.exe. Hopefully
Epic adds support for the -Submit argument on the commandlet for all builders and this can be removed.
We also need to cleanup the node name as we cannot use / in the node name, and the map name contains
multiple slashes. There is also the possability that multiple maps have the same name, just different
paths, so we have to use the full path for the name.
-->
<Property Name="GeneratedNavMeshNodes" Value="" />
<ForEach Name="MapName" Values="$(NavMeshMapNames)" Separator="+">
<Property Name="CleanMapName" Value="" />
<ForEach Name="Part" Values="$(MapName)" Separator="/">
<Property Name="CleanMapName" Value="$(CleanMapName)-$(Part)" />
</ForEach>
<Property Name="NavMeshGenerationNodeName" Value="Generate Nav Mesh $(CleanMapName)" />
<Property Name="NavMeshSubmitNodeName" Value="Submit Nav Mesh $(CleanMapName)" />
<Agent Name="$(NavMeshGenerationNodeName)" Type="$(TestAgentType)">
<Node Name="$(NavMeshGenerationNodeName)" Requires="$(EditorNodeName)">
<Property Name="NavMeshCommonBuilderArgs" Value="-Builder=WorldPartitionNavigationDataBuilder $(MapName) -AllowCommandletRendering $(SCC_P4)" />
<Commandlet Name="WorldPartitionBuilder" Project="$(UProject)" Arguments="$(NavMeshCommonBuilderArgs)" />
</Node>
<Node Name="$(NavMeshSubmitNodeName)" Requires="$(NavMeshGenerationNodeName)">
<Property Name="NavMeshP4Args" Value="-c $(uebp_CLIENT)" />
<Property Name="NavMeshP4Args" Value="$(NavMeshP4Args) submit" />
<Property Name="NavMeshP4Args" Value="$(NavMeshP4Args) -d &quot;Generated navigation mesh for $(MapName)&quot;" />
<Spawn Exe="p4.exe" Arguments="$(NavMeshP4Args)" />
</Node>
</Agent>
<Property Name="GeneratedNavMeshNodes" Value="$(GeneratedNavMeshNodes);$(NavMeshGenerationNodeName)" />
<Property Name="GeneratedNavMeshNodes" Value="$(GeneratedNavMeshNodes);$(NavMeshSubmitNodeName)" If="$(IsBuildMachine)" />
</ForEach>
<Property Name="BuildProjectNodes" Value="$(BuildProjectNodes);$(GeneratedNavMeshNodes)" />
<Label Category="Other" Name="Generate NavMesh" Requires="$(GeneratedNavMeshNodes)" Exclude="$(EditorNodeName)" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment