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

Very special NewGRF causes network desyncs #5772

Closed
DorpsGek opened this issue Oct 2, 2013 · 5 comments
Closed

Very special NewGRF causes network desyncs #5772

DorpsGek opened this issue Oct 2, 2013 · 5 comments
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Oct 2, 2013

The_Dude opened the ticket and wrote:

I made a newgrf recently and run a it on a dedicated server, after a while clients started to desync.
Since I was able to reproduce this on current stable both server and client and since newgrf should not cause desyncs I am reporting is as bug.
Savegame of the replication incuded. Desyncs occure when bus deliveres passengers to gold mine.

Briefly about newgrf's features that I suspect from desyncs (not enclosed, but is on content service):
parametres - 1st dummy parameter, 2nd starting year of the game (or just a year) - makes some thing dependant on game year
changes some vehicle features

alters gold mine
- behaves like secondary industry producing gold only when passengers(miners) are delivered
- can accept only limited amount of passengers, after that via callbacks both industry and its tiles stop accepting passengers, this limited amount increases with time

alters gold cargo
- payment is altered via callback and changes with time

Attachments

Reported version: 1.3.2
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/5772
@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 3, 2013

frosch wrote:

Vehicles cache a lot of values. They are only updated on certain triggers, to speed things up.
This means NewGRF must not make vehicle statistics depend on current date. You can use date of last service or purchase date for an replacement, but current date is no option for vehicles.

The industry/cargo stuff likely does not matter. Vehicles are the crucical thing.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5772#comment12650

@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 3, 2013

The_Dude wrote:

Vehicle features are not game year dependant in this newgrf, only the gold mine gold acceptance and gold payment. I am certain that it has to be the latter.
Vehicles stay the same all the time, and only things like speed/power are altered. Also I used no callbacks for vehicles.

As maximum, I can try narrowing the problem by diving the newgrf into subparts.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5772#comment12651

@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 3, 2013

The_Dude wrote:

By that I mean the reason for closing is invalid.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5772#comment12652

@DorpsGek
Copy link
Member Author

DorpsGek commented Oct 3, 2013

The_Dude wrote:

I stripped the newgrf so only the part that causes desync stayed.

Results: not caused by vehicles, not caused by the game year dependance (both cut off)

The part that does it is probably the industry window text callback in tandem with the industry tiles callback to chance tiles acceptance. The crucial part may be the persistent storage.

Briefly:
Text callback is checked -> checks how much cargo was delivered to gold mine, stores it in persisten storage -> shows text accordingly
Industry tiles callback is checked -> it checks for the amount in storage -> enables/disables acceptance depending on stored value

Somewhere here happens the desync. Maybe it is newgrf bug. After all tests I can't be sure I had not done anything bad. Also because similar behaviour works e.g. in ECS.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/5772#comment12653

@DorpsGek
Copy link
Member Author

DorpsGek commented Nov 8, 2013

Rubidium closed the ticket.

Reason for closing: Fixed

In r25956


This comment was imported from FlySpray: https://bugs.openttd.org/task/5772

@DorpsGek DorpsGek closed this as completed Nov 8, 2013
@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) component: NewGRF This issue is related to NewGRFs bug labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant