#2119 closed defect (fixed)
[PATCH] out of sync error when building civic center with shift-key
Reported by: | Tom Brewe | Owned by: | sanderd17 |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 15 |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
Hi,
I noticed some strange behavior. I have been playing some multiplayer games in a LAN. All players have the same version. Previously A13, now it happens with Alpha 14.
At some point in the game, we will get an out of sync error. We can continue playing. But some unit movements and actions won't be seen by the other anymore and vice versa: e.g. ship movements might still be identical, but the other side does not see the units that were unloaded from the ship.Besides unit movements also build actions will become increasingly out of sync. But surprisingly the last time, ship movements didnt get that much out of sync.
The last two times I noticed this happening when I (accidentally) pressed Shift-key while clicking the mouse button to place a new civic center. In exactly this moment (in both games I observed it), the error-message of being out of snyc appeared. So i guess it was not a coincidence.
I attach all the logs, that might be of interest.
Systems: OS X 10.7.5, arch/gentoo (dunno which kernel).
Attachments (5)
Change History (16)
by , 11 years ago
Attachment: | commands.txt.zip added |
---|
by , 11 years ago
Attachment: | oos_dump.txt.zip added |
---|
by , 11 years ago
Attachment: | system_info.txt added |
---|
by , 11 years ago
Attachment: | mainlog.html added |
---|
comment:1 by , 11 years ago
Description: | modified (diff) |
---|
follow-up: 3 comment:2 by , 11 years ago
comment:3 by , 11 years ago
You are right, the Civic Center did not come through/was not build for me when shift clicking. (might be worth a separate bug report). I can't report on the other player though, as he probably didn't see the area where it was build, and I build one without clicking shift directly afterwards, which was of course succesful.
I'll try to reproduce the bug again, and see if the civic center will be build and seen in the other players view.
Replying to sanderd17:
There are bugs concerning the shift-click with civil centres, that's for sure. When it's used in single player, the building doesn't come through (it's blocked because of the distance check for some reason). Does it come through for the other player maybe?
comment:4 by , 11 years ago
Keywords: | sync, multiplayer, network → sync multiplayer network |
---|
Hi, we will need the oos_dump.txt
for both players to compare them.
Once the game goes OOS, the behavior is unpredictable, because players will still be sending orders, but the game states they're based on will differ. So the orders from one player may be invalid and ignored or only partially valid in the other player's game. For that reason, even though the game continues, it's best not to keep playing after an OOS error.
comment:5 by , 11 years ago
Replying to nylki:
The last two times I noticed this happening when I (accidentally) pressed Shift-key while clicking the mouse button to place a new civic center. In exactly this moment (in both games I observed it), the error-message of being out of snyc appeared. So i guess it was not a coincidence.
This is reproducible for me, it also causes the serialization test mode to fail in single player.
comment:6 by , 11 years ago
The problem is Engine.GetEntitiesWithInterface
includes local entities, which BuildRestrictions
doesn't expect. The building preview entity is local and shouldn't affect the synchronized simulation state, but in this case it does, causing the placement to fail locally, and the OOS error.
I think we could safely modify GetEntitiesWithInterface
to only return non-local entities (there's a TODO about it), it's only used in BuildRestrictions
. In the unlikely event that scripts ever want a list of local entities with a given interface we could add GetLocalEntitiesWithInterface
.
by , 11 years ago
Attachment: | no_local_entities.diff added |
---|
follow-up: 9 comment:7 by , 11 years ago
Keywords: | patch review added; sync multiplayer network removed |
---|---|
Summary: | out of sync error when building civic center with shift-key → [PATCH] out of sync error when building civic center with shift-key |
Thanks for the hints historicbruno. I fixed the function you mentioned, and it seems to solve the issue.
comment:9 by , 11 years ago
Milestone: | Backlog → Alpha 15 |
---|
Replying to sanderd17:
Thanks for the hints historicbruno. I fixed the function you mentioned, and it seems to solve the issue.
I think you should use the ENTITY_IS_LOCAL
macro to be consistent with the rest of the engine.
comment:11 by , 11 years ago
Keywords: | review removed |
---|
There are bugs concerning the shift-click with civil centres, that's for sure. When it's used in single player, the building doesn't come through (it's blocked because of the distance check for some reason).
Does it come through for the other player maybe?