Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the navigational mesh not culling labels #6390

Merged
merged 3 commits into from
Aug 4, 2024

Conversation

Garanas
Copy link
Member

@Garanas Garanas commented Aug 4, 2024

Description of the proposed changes

Related to #5574 and #5579

In order to serialize the navigational mesh there can be no direct references to other leaves. This would turn it into a gigantic graph, which would cause the game to crash upon saving.

To fix this all references to a leaf are a number. This behaves similar to a pointer, where the number represents the index in a large list of leaves. When we loop over all the neighbors we therefore retrieve a number. And before we do any computations and/or table operations we should convert that number to the actual instance.

Which we did not do.

There's two underlying issues that should have prevented this, but it did not:

Testing done on the proposed changes

Start a game on a generated map (seed: neroxis_map_generator_1.12.3_7zoovyk44bxky_aqeaefam) and observe that the number of labels is reduced drastically (from 6226 to 2).

Behavior on the release branch (each isolated color is a separate area)
image

Behavior in this pull request
image

@Garanas Garanas added type: bug area: AI related to AI functions area: nav-mesh related to navigational mesh labels Aug 4, 2024
@relent0r
Copy link
Contributor

relent0r commented Aug 4, 2024

I did a test against a few problem maps. This completely removes the stutter and actually improved (took longer to drop from +10 than previously) sim speed when AI are involved that use the navmesh.

@Garanas Garanas merged commit a85ff16 into develop Aug 4, 2024
3 checks passed
@Garanas Garanas deleted the Fix/culling-of-navigational-mesh branch August 4, 2024 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: AI related to AI functions area: nav-mesh related to navigational mesh type: bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants