Skip to content

[GEN][ZH] Re-initialize pathfinding information cells into a known state in Pathfinder::reset() #1037

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Mauller
Copy link

@Mauller Mauller commented Jun 9, 2025

Just a simple tweak, very minimal on the surface, but it's just to keep the initial state of the pathfinding information cells consistent between games.

@Mauller Mauller self-assigned this Jun 9, 2025
@Mauller Mauller added Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour labels Jun 9, 2025
@@ -3460,6 +3468,9 @@ void Pathfinder::reset( void )
m_wallHeight = 0.0f;
}
m_zoneManager.reset();

// TheSuperHackers @fix Mauller 09/06/2025 Re-initialize pathfinding cell info objects so they are in a known clean state
PathfindCellInfo::initializeCellInfos();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what exactly this achieves?

I see in debugger the main effect it has is putting the cell links into linear order again. But what is the effective consequence if the links were shuffled after one map run? Would there be a performance degradation?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i meant to put this up as a draft as i came across any other stuff.

This bit alone was to just put things into a known good state in case any pathfinding info cells were left dangling.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a counter to PathfindCellInfo::getACellInfo, PathfindCellInfo::releaseACellInfo and saw that its usage returned to 0 on map reset. I suggest to add this in debug builds and assert on that condition.

@Mauller Mauller marked this pull request as draft June 10, 2025 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gen Relates to Generals Minor Severity: Minor < Major < Critical < Blocker ZH Relates to Zero Hour
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants