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
Change: simplified water region evaluation, removed savegame data #11750
Change: simplified water region evaluation, removed savegame data #11750
Conversation
This does not handle the case of water-based objects built on water. (You can use a GRF like AuzObjects Water to test this). |
023c635
to
a94fa97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no way of judging this code, but if you say it works, I will approve it. It just does need a bit of cleanup :)
This will definitely need to handle the saveload chunk being removed (unless that happens automagically.) |
a94fa97
to
4c5ee29
Compare
4c5ee29
to
75b925a
Compare
One last thing, sorry about that: I think we should bump the savegame version. Otherwise you can create a savegame which you cannot load, with a very "corrupted savegame" error in the older version. Better to have it say it is not compatible, I think. |
75b925a
to
4a796d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up to @PeterN to merge this, if he is also okay with these changes.
Tnx for addressing these issues btw, it is appreciated!
Motivation / Problem
This is closely related to the recently merged region-based ship pathfinder #10543
There was some discussion with @JGRennison and @SamuXarick on discord, there were worries about desyncs. In 10543 I've tried to prevent desyncs by saving the "is the region initialized "state of all regions in the savegame. The idea was to synchronize the "initialized-ness" in a bug-compatible way, meaning that if it wasn't initialized on the server then it wouldn't be initialized on the joining client either. But this is what can happen:
The current solution of syncing the up-to-date-state of the regions simply doesn't solve this.
Link to discord: https://discord.com/channels/142724111502802944/1008473233844097104/1194656849237127308
Description
So I'm taking a slightly more simple and brute force approach: invalidate a water region on any change. This includes changes to tiles that might not be entirely relevant to the water regions. This by itself shouldn't really have big impact on performance, region invalidation is just a matter of setting a boolean.
Limitations
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.