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 #7670: Cache the origin tile to prevent recurring calls to the road pathfinder when a vehicle is blocked by another #7822

Closed

Conversation

@SamuXarick
Copy link
Contributor

@SamuXarick SamuXarick commented Nov 3, 2019

This is a tentative fix for #7670 , but not fully tested. I thought of caching the origin of where the pathfind starts its search. It seems to solve the issue, but I'm not sure this is the right approach.

Problem is best explained here: #7670 (comment)

savegame for testing, requires only 2 vehicles and a giant road network to trigger the issue : https://github.com/OpenTTD/OpenTTD/files/3801034/2.vehicles.only.zip

2019-11-03

@SamuXarick SamuXarick force-pushed the SamuXarick:blocked-road-vehicle-yapf-fix branch from fc4d6b1 to dee9710 Dec 31, 2019
src/roadveh.h Show resolved Hide resolved
@SamuXarick SamuXarick force-pushed the SamuXarick:blocked-road-vehicle-yapf-fix branch from dee9710 to d9c7987 Feb 9, 2020
@SamuXarick SamuXarick force-pushed the SamuXarick:blocked-road-vehicle-yapf-fix branch from d9c7987 to bb267f8 Mar 30, 2020
@SamuXarick SamuXarick force-pushed the SamuXarick:blocked-road-vehicle-yapf-fix branch from bb267f8 to ca05e3c May 12, 2020
@SamuXarick SamuXarick force-pushed the SamuXarick:blocked-road-vehicle-yapf-fix branch from ca05e3c to 3948e28 Jul 12, 2020
@SamuXarick SamuXarick force-pushed the SamuXarick:blocked-road-vehicle-yapf-fix branch 2 times, most recently from 8de304c to 3fe07ea Dec 18, 2020
@SamuXarick SamuXarick requested a review from nielsmh Dec 23, 2020
…ad pathfinder when a vehicle is blocked by another
@SamuXarick SamuXarick force-pushed the SamuXarick:blocked-road-vehicle-yapf-fix branch from 3fe07ea to 2be4c78 Jan 8, 2021
@SamuXarick
Copy link
Contributor Author

@SamuXarick SamuXarick commented Jan 9, 2021

Just retested this as of current master (and on a new CPU).

Without fix: pathfinder is called every tick
Henfingburg Transport, 1952-03-14

With fix: pathfinder is called once
Henfingburg Transport, 1952-03-14#1

@glx22
Copy link
Contributor

@glx22 glx22 commented Jan 13, 2021

I think master...glx22:fix_7670 has the same effect without requiring savegame bump.

@glx22
Copy link
Contributor

@glx22 glx22 commented Jan 14, 2021

Superseded by #8568

@glx22 glx22 closed this Jan 14, 2021
@SamuXarick SamuXarick deleted the SamuXarick:blocked-road-vehicle-yapf-fix branch Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.