network games completely broken due to desyncs

Bug #905835 reported by Nasenbaer
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
Critical
Unassigned

Bug Description

currently network games are completely broken due to desyncs directly after the game start.
This is true as soon as two different computers are used (for me always reproduceable - only exception are parallel running games on one computer)

Based on the exception above and the fact, that I already played "Together we're strong" with a friend of mine via internet"(introduced in rev. 6106) although even rev. 6100 had the desync when I tested it on two computers today (next test at rev. 6000 run fine without desync) -it is likely this desync is based upon a current change or even bug in a library we use.

Tags: desync network
Revision history for this message
Nasenbaer (nasenbaer) wrote :

fix committed in rev. 6163 - the problem was the use of boost::unordered_map (rev. 6044)

Changed in widelands:
status: Confirmed → Fix Committed
SirVer (sirver)
Changed in widelands:
status: Fix Committed → Incomplete
Revision history for this message
SirVer (sirver) wrote :

The introduction of unordered map was done by me because it gives a tremendous speed boost in big games - I also tested this with games playing with kristin over the network and we had no issues (same boost versions and OSes, but 32 vs 64 bit systems). I do not doubt that the problem was introduced by this, but I would like to search for the deeper reason.

The only problem where unordered<->ordered should make a difference is when iterating and relying on the order of objects. The only place iterating is done currently is when saving. I assume the problem is that when a network game is launched, both boxes immediately save and reload the game and the map objects can then be out of order - this seems to matter.

I introduced a fix that follows this logic and does the following: it uses unordered_map but saves the map objects following their IDs which guarantees the order. This fix has been introduced in r6169; please check if the desyncs still happen. If more problems occur we can still revert to using std::map but I am reluctant to give up the constant access time in big games and am willing to investigate this problem further. Please reopen if my fix is not valid.

Changed in widelands:
status: Incomplete → Fix Committed
Revision history for this message
SirVer (sirver) wrote :

Released in build17-rc1.

Changed in widelands:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.