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

Revert 7ca1793: Using Trackdir keyed node is not required, Exitdir keyed node still have the correct trackdir #9576

Merged
merged 1 commit into from Sep 26, 2021

Conversation

@glx22
Copy link
Contributor

@glx22 glx22 commented Sep 26, 2021

Motivation / Problem

Trackdir keyed nodes are forced when 45° and 90° penalties for ships differ (and they differ when using default values).
That implies a lot more nodes are opened when pathfinding, which implies more closed node, and when enough nodes are closed (default 10K), pathfinding just stops and ship says "can't reach destination".
But using trackdir keyed nodes for different curve penalties is not required at all, because even for exitdir keyed nodes the correct trackdir is still available (and already used to determine next tile).

Description

Revert the commit introducing the forced switch to trackdir keyed nodes.
Hugely decreases the number of nodes opened to find a path, which increases the chance to actually find one where using trackdirs would bail out before finding it.

Limitations

Found paths may be a little different, but in most cases they are the same.
Using trackdir keyed nodes:
trackdir
Using exitdir keyed nodes:
exitdir

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')
Copy link
Member

@TrueBrain TrueBrain left a comment

If any problems come from this, lets document better what this was solving, so we know for next time we have this "ship PF sucks" debate :D

Loading

@glx22 glx22 merged commit 11dece2 into OpenTTD:master Sep 26, 2021
16 checks passed
Loading
@glx22 glx22 deleted the shippf branch Sep 26, 2021
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this issue Oct 3, 2021
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this issue Oct 3, 2021
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this issue Oct 3, 2021
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this issue Oct 3, 2021
TrueBrain added a commit to TrueBrain/OpenTTD that referenced this issue Oct 3, 2021
TrueBrain added a commit that referenced this issue Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants