diff --git a/docs/_posts/2024-08-03-3811.md b/docs/_posts/2024-08-03-3811.md index 548fe9891a..4f6c1b1bbd 100644 --- a/docs/_posts/2024-08-03-3811.md +++ b/docs/_posts/2024-08-03-3811.md @@ -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: diff --git a/lua/sim/NavGenerator.lua b/lua/sim/NavGenerator.lua index fb9133ec7a..75c0d598e7 100644 --- a/lua/sim/NavGenerator.lua +++ b/lua/sim/NavGenerator.lua @@ -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 diff --git a/lua/ui/lobby/changelogData.lua b/lua/ui/lobby/changelogData.lua index a11ee87931..fa34f281ce 100644 --- a/lua/ui/lobby/changelogData.lua +++ b/lua/ui/lobby/changelogData.lua @@ -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:",