bugBattle for Wesnoth - Bugs: bug #20217, MP campaign: new observers get OOS...

 
 
Show feedback again

bug #20217: MP campaign: new observers get OOS on second scenario

Submitted by:  FAAB <faabumc>
Submitted on:  Thu 04 Oct 2012 12:06:33 AM UTC  
 
Category: BugSeverity: 3 - Normal
Priority: 5 - NormalItem Group:  None of the others
Status: FixedPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Release: 1.10Operating System: GNU/linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 18 Oct 2012 07:32:21 PM UTC, SVN revision 55551:

Apply patch #3537 by faabumc, which fixes second-scenario observer OOS (bug #20217)

(Browse SVN revision 55551)

Alexander van Gessel <ai0867>
Project Member
Mon 08 Oct 2012 03:47:41 AM UTC, comment #2:
FAAB <faabumc>
Project Member
Mon 08 Oct 2012 03:44:21 AM UTC, comment #1:

Random events are driven by random seeds.
The following table is giving the seed for different connection at different stage of the game (using --log-debug=random):
+============+============+============+============+
| Stage | Host | Scenario 1 | Scenario 2 |
| | | observer | observer |
+============+============+============+============+
| Generate | 10 digit | - | - |
| map | integer | | |
| | 1712165034 | | |
+------------+------------+------------+------------+
| Scenario 1 | 1 digit | digit | - |
| start | integer | integer | |
| | 1 | 1 | |
+------------+------------+------------+------------+
| Scenario 2 | 9 digit | 9 digit | 1 digit |
| start | integer | integer | integer |
| | 282104759 | 282104759 | 2 |
+------------+------------+------------+------------+
| Scenario 2 | 1 digit | 1 digit | 1 digit |
| save/reload| integer | integer | integer |
| start | 2 | 2 | 2 |
+============+============+============+============+
We see the seed is sometimes a single digit integer and sometimes a 9-10 digit integer. The table also shows that the length of the seed is different between the host and an observer joining at scenario 2 as soon as scenario 2 starts.
It finally shows that the save/reload of scenario 2 is changing the seed and make it the same for host and observer.

The random seed is defined as an integer in the wesnoth engine while it is stored into WML using a string. This means that a conversion from string to integer is needed. This is done in two circumstances:
| - reading save game from WML
| - parsing server data structured in WML

This is done in two different places using two different conversion rules:
- save (savegame.cpp):
| load_config_["random_seed"].to_int(42)
- server (multiplayer_ui.cpp):
| const std::string seed = level["random_seed"];
| state.rng().seed_random(lexical_cast<int>(seed), calls);

The second casting is turning any string-format integer into a single digit integer ('4.444444E09' to 4).

FAAB <faabumc>
Project Member
Thu 04 Oct 2012 12:06:33 AM UTC, original submission:

When an observer connects to a MP campaign that is in its second scenario, he gets OOS for each of the random events of the replay (random unit creation, random map embellishments).
None of the host, players and observers that are in the game during the transition from scenario 1 to scenario 2 is having any OOS.

Currently the only solution to this problem is to have the players to save the game at this point and to reload it.

FAAB <faabumc>
Project Member

 

(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ai0867 (Updated the item)
  • -unavailable- added by faabumc (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 09 Dec 2012 09:39:12 AM UTCivanovicOpen/ClosedOpen=>Closed
    Thu 18 Oct 2012 07:33:57 PM UTCai0867StatusNone=>Fixed
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup