Skip to content

Conversation

@Mauller
Copy link

@Mauller Mauller commented Sep 28, 2025

Part 3 in this munkee series of magic.

This PR cleans up various functions within the pathfinding, the goal to improve readability where possible and to improve performance where possible.

I have broken each function down into it's own commit to aid review.

This PR covers the functions

  • Pathfinder::checkDestination
  • Pathfinder::snapClosestGoalPosition
  • Pathfinder::examineCellsCallback
  • Pathfinder::checkForMovement
  • Pathfinder::moveAllies

A few of the refactors cover code simplification by inverting the logic and returning early or by simplifying functionality.


Todo

  • Replicate in generals
  • Test performance improvements, if any.

@Mauller Mauller self-assigned this Sep 28, 2025
@Mauller Mauller added Minor Severity: Minor < Major < Critical < Blocker Gen Relates to Generals ZH Relates to Zero Hour Refactor Edits the code with insignificant behavior changes, is never user facing labels Sep 28, 2025
@Mauller
Copy link
Author

Mauller commented Sep 30, 2025

going to add one more function to this that i noticed, only some small changes to it

@Mauller Mauller force-pushed the refactor-pathfinding-simplify-code-3 branch from b331e23 to 10189db Compare September 30, 2025 20:41
@Mauller
Copy link
Author

Mauller commented Sep 30, 2025

just a rebase

@Mauller
Copy link
Author

Mauller commented Sep 30, 2025

Added extra commit

@Mauller Mauller force-pushed the refactor-pathfinding-simplify-code-3 branch from 26be73e to 4d6fd78 Compare October 1, 2025 16:42
@Mauller
Copy link
Author

Mauller commented Oct 1, 2025

Updated based on feedback.

@xezon xezon requested a review from Skyaero42 October 1, 2025 17:54
Copy link

@Skyaero42 Skyaero42 left a comment

Choose a reason for hiding this comment

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

Ok

Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

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

I think this needs another good look.

@Mauller Mauller force-pushed the refactor-pathfinding-simplify-code-3 branch 2 times, most recently from 1963ae8 to 84ce7dd Compare October 7, 2025 10:57
@Mauller
Copy link
Author

Mauller commented Oct 7, 2025

updated based on feedback

Copy link

@xezon xezon left a comment

Choose a reason for hiding this comment

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

No risk, no fun.

@xezon
Copy link

xezon commented Oct 8, 2025

This needs to be replicated in Generals.

@Mauller Mauller force-pushed the refactor-pathfinding-simplify-code-3 branch from 84ce7dd to fa7bc60 Compare October 10, 2025 10:25
@Mauller
Copy link
Author

Mauller commented Oct 10, 2025

Copied across to generals with minor differences, some dips in performance seem to be reduced at points when i play back GR1 but nothing major. Like only hitting 19FPS min instead of 14FPS with all pathfinder refactors in place.

@xezon xezon changed the title refactor(pathfinding): simplify functions to improve readability - Part 3 refactor(pathfinder): Simplify functions to improve readability - Part 3 Oct 11, 2025
@xezon xezon merged commit 6c9a975 into TheSuperHackers:main Oct 11, 2025
20 checks passed
xezon pushed a commit that referenced this pull request Oct 11, 2025
xezon pushed a commit that referenced this pull request Oct 11, 2025
xezon pushed a commit that referenced this pull request Oct 11, 2025
xezon pushed a commit that referenced this pull request Oct 11, 2025
@xezon xezon deleted the refactor-pathfinding-simplify-code-3 branch October 11, 2025 11:18
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 Refactor Edits the code with insignificant behavior changes, is never user facing ZH Relates to Zero Hour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants