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

Open
wants to merge 1 commit into
base: master
from

Conversation

@SamuXarick
Copy link
Contributor

SamuXarick commented Nov 3, 2019

This is a tentative fix, 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.

2019-11-03

@SamuXarick SamuXarick force-pushed the SamuXarick:blocked-road-vehicle-yapf-fix branch from fc4d6b1 to dee9710 Dec 31, 2019
Trackdir origin_td = INVALID_TRACKDIR;
TileIndex origin_tile = INVALID_TILE;
Comment on lines +86 to +87

This comment has been minimized.

Copy link
@nielsmh

nielsmh Feb 9, 2020

Contributor

The RoadVehPathCache structure is saved in the savegame, and these two new members need to be stored as well.
You need to add them to the saveload data and add a SL-version bump.

This comment has been minimized.

Copy link
@SamuXarick

SamuXarick Mar 4, 2020

Author Contributor

I did as you told me, but I don't think that in this particular situation, saving is required.

This comment has been minimized.

Copy link
@SamuXarick

SamuXarick Mar 4, 2020

Author Contributor

From IRC:
but yeah, i'm more convinced there is a chance for a desync, just not sure how to properly set this up
let me think. Server has the origin tile cached the moment a client joins. Client doesn't have it cached, but 1 tick later it will, and be in sync with server
what would happen if...
in that tick
i remove the road
how am i gonna remove a road in the exact tick
pause command
remove road, make client join, unpause
now I should be getting a desync, let's see
confirmed!
vehicle went different ways

You're right. Desync confirmed. Save is required indeed.
https://i.imgur.com/gUmDN4J.png

@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
…ad pathfinder when a vehicle is blocked by another
@SamuXarick SamuXarick force-pushed the SamuXarick:blocked-road-vehicle-yapf-fix branch from ca05e3c to 3948e28 Jul 12, 2020
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

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