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 zone sync #194

Merged
merged 3 commits into from
Aug 18, 2020
Merged

Conversation

kaenganxt
Copy link
Member

Even if the fix is simple, the issue was quite complicated :)

Issue:

For zones, we expected that the zone ids are always is sync. The id is selected using a randomizer with the segment id as a seed. Since the segment id is synchronized, the zone ids should be, too. The randomizer selects an item from the "free zone ids" list. The problem is now that the "free zone ids" list is not sync, even if the selected index of this list is. This is caused due to the list being initialized differently when the game is loaded from a savegame than it is during the game.

The issue happens for example when one player builds a street while no one is connected yet. A newly joining player (or a player that typed /sync) now gets the current game state as a savegame and thus initializes the "free zone ids" list differently. When a new street is built, the selected zone ids differ on both games and the zones are no longer in sync.

The fix:

Just sync the actual selected zone ids.

Notes:

- Negotiate game time for pause and speed changes
- Don't allow state changes while waiting until all clients have the same state
@DominicMaas DominicMaas merged commit 70f9a42 into CitiesSkylinesMultiplayer:master Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zoning not synced correctly
2 participants