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

Multiplayer is desynchronized immediately from the start #43

Open
juj opened this issue Jun 17, 2022 · 5 comments
Open

Multiplayer is desynchronized immediately from the start #43

juj opened this issue Jun 17, 2022 · 5 comments

Comments

@juj
Copy link
Contributor

juj commented Jun 17, 2022

Multiplayer modes don't seem to work: starting a two player Harkonnen vs Atreides game:

image

results in an immediately desynchronized game starting state. The game host (player 1 / clb) sees seems themselves as Harkonnen:

image

However the remote player sees themselves as Atreides, but on their screen, they are located in the identical location as player 1, and from their point of view, all the units belong to Atreides and not to Harkonnen:

image

Both players can issue order to these units as if they were their own. The previous orders are forgotten, so the players can essentially fight over commanding the units.

@juj
Copy link
Contributor Author

juj commented Jun 17, 2022

Repeating a game start multiple times with predetermined houses Harkonnen vs Atreides, I do always get both houses starting at bottom right at the same spawn position with desync units.

If instead I choose Random starting houses, I do get a starting configuration where the two players do hold their own houses:

game host is randomized to be Fremen:

image

whereas remote peer sees themselves as being Ordos:

image

However looking at the enemy camp on both computers, the players are again desynchronized: game host misthinks that the enemy is instead Harkonnen:

image

and the remote player misinterprets that the game host would be Atreides instead of Fremen:

image

so the house identities seem to be independently randomized by the host and the peer, or something along to that effect.

@juj
Copy link
Contributor Author

juj commented Jun 17, 2022

Attempting to play the game in this desynchronized colors state quickly causes the game to desynchronize even more: in the scenario the host player got two reinforcements units:

image

However peeking at the same base at the remote peer, they have now desynchronized and do not observe those two reinforcement units to exist at all:

image

Attempting to do a combat between the two houses results in very desynchronized situation, where the movement of some units does replicate, but combat and destroying other units does not.

@juj
Copy link
Contributor Author

juj commented Jun 17, 2022

Was wondering whether this might be a recent regression from all the changes that went in (especially #31), so tried an earlier commit tag latest-x64:

Revision: 561a9507e5ba6a95ebd48c40702c027d097d0d6f
Author: Henric Jungheim <software@henric.org>
Date: 04/06/2022 14.34.46
Message:
Set the right MSVC options for each build type.

----
Modified: cmake/setup/msvc-setup.cmake

which predates that change. Though the issue does persist there as well.

Tried also an earlier tag v0.96.4-0.1.4, but that did unfortunately not build well on Windows (complained something about soxr.lib not found), so was unable to go farther in time to test for regressions.

@juj
Copy link
Contributor Author

juj commented Jun 17, 2022

The issue does NOT reproduce on the Sourceforge latest installation zip (dunelegacy-0.97.0alpha-windows10-x64.zip) from https://sourceforge.net/projects/dunelegacy/ , but there 1v1 map North & South does start up correctly synchronized.

@henricj
Copy link
Owner

henricj commented Jun 17, 2022

This could easily have broken years ago.

My first guess would be that the random number generator state isn't being shared properly.

Take a look at the log messages that look like so:

INFO    :   Created seed for "Default": 389b011c011d6e0a-5418f99f21c35bfd-5e9cebac3ea45860-d1953205b320382f-6d6fa30d0bdb2668-d483374a129442f5-ee6832ae365d711c-170a533cc5be6cb8
INFO    :   Setting RandomFactory seed to 389b011c011d6e0a-5418f99f21c35bfd-5e9cebac3ea45860-d1953205b320382f-6d6fa30d0bdb2668-d483374a129442f5-ee6832ae365d711c-170a533cc5be6cb8
INFO    :   Created state for "ADLPlayer": 76affffc89bf7f97-6889f7cc77b84ae5-72a183e3ed94bf22-83c8b20f70c3533b-6f9d4ae8ddaf05ac (from 389b011c011d6e0a-5418f99f21c35bfd-5e9cebac3ea45860-d1953205b320382f-6d6fa30d0bdb2668-d483374a129442f5-ee6832ae365d711c-170a533cc5be6cb8)

Most should match between participants in the same game ("UI" should not, since that random number generator is local).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants