Skip to content

Commit

Permalink
Fix the navigational mesh not culling labels (#6390)
Browse files Browse the repository at this point in the history
  • Loading branch information
Garanas authored Aug 4, 2024
1 parent 06a3d0b commit a85ff16
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/_posts/2024-08-03-3811.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ AI - Fixed a bug with recording a platoon's plan and certain other platoon relat

- (#6292) Create base state machine files for AI engineer utility machine, update state machine for tml.

- (#6390) Fix a bug in the navigational mesh that could significantly slow down the simulation

When we generate a navigational mesh the map is split into areas of terrain that units can walk over. This is done for each of the four layers (land, water, hover and amphibious). Heightmaps can be noisy, and therefore there can be thousands of tiny (the size of a wall) areas scattered across the map. These areas are to be culled, reducing the number of areas to take into account by a significant factor. Think in terms of going from 6000+ areas to (usually) less then 10. The culling did not work however.

Some computations of the AI take into account the number of areas. These computations would blow up with thousands of areas, significantly slowing down the simulation.

## Contributors

With thanks to the following people who contributed through coding:
Expand Down
2 changes: 1 addition & 1 deletion lua/sim/NavGenerator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ local function GenerateCullLabels()
node = stack[count]
count = count - 1
for k = 1, TableGetn(node) do
local neighbor = node[k]
local neighbor = NavLeaves[node[k]]
if neighbor.Label > 0 then
neighbor.Label = -1
count = count + 1
Expand Down
10 changes: 10 additions & 0 deletions lua/ui/lobby/changelogData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ gamePatches = {
"",
"- (#6292) Create base state machine files for AI engineer utility machine, update state machine for tml.",
"",
"- (#6390) Fix a bug in the navigational mesh that could significantly slow down the simulation",
"",
"When we generate a navigational mesh the map is split into areas of terrain that units can walk over. This is done for each of ",
"the four layers (land, water, hover and amphibious). Heightmaps can be noisy, and therefore there can be thousands of tiny (the ",
"size of a wall) areas scattered across the map. These areas are to be culled, reducing the number of areas to take into account ",
"by a significant factor. Think in terms of going from 6000+ areas to (usually) less then 10. The culling did not work however.",
"",
"Some computations of the AI take into account the number of areas. These computations would blow up with thousands of areas, ",
"significantly slowing down the simulation.",
"",
"## Contributors",
"",
"With thanks to the following people who contributed through coding:",
Expand Down

0 comments on commit a85ff16

Please sign in to comment.