Merged
Conversation
Changes wind speed calculation to be equal on all clients. This patch replaces `object.GetHashCode()` with a deterministic hash based on `map.Tile` when in multiplayer. In version 1.5, `this.map.Tile` was used instead of `this.map.GetHashCode()`. In version 1.6, `map.Tile` is no longer an `int`, but a `PlanetTile` object. However, it can still be implicitly converted to an `int`. Using `GetHashCode()`in 1.6 introduces wind speed randomness across game loads. This patch ensures consistency between all clients in multiplayer, but it removes the randomness.
Member
|
This is a bug that could be reported to Ludeon, feels like a mistake on their part. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Label: 1.6, Desync
Tested only on dev.
Issue:
Reported by two people on discord:
In RimWorld 1.6 desyncs occur whenever electrical devices - like ACs connected directly to wind turbines - lose power or regain power. The power state change seems to consistently trigger desyncs during multiplayer.
Fix:
Changes wind speed calculation to be equal on all clients.
This patch replaces
object.GetHashCode()with a deterministic hash based onmap.Tilewhen in multiplayer.In version 1.5,
this.map.Tilewas used instead ofthis.map.GetHashCode().In version 1.6,
map.Tileis no longer anint, but aPlanetTileobject. However, it can still be implicitly converted to anint.Using
GetHashCode()in 1.6 introduces wind speed randomness across game loads. This patch ensures consistency between all clients in multiplayer, but it removes the randomness.Tested
Method in 1.6
Method in 1.5