bugBattle for Wesnoth - Bugs: bug #21903, Scenario transitions in networked...

Show feedback again

bug #21903: Scenario transitions in networked MP don't work unless host transitions first

Submitted by:  Chris Beck <involution>
Submitted on:  Thu Apr 10 06:41:49 2014  
Category: BugSeverity: 5 - Blocker
Priority: 5 - NormalItem Group:  None of the others
Status: FixedPrivacy: Public
Assigned to: Andrius Silinskas <thunderstruck>Open/Closed: Closed
Release: 1.11.9-1.13.0Operating System: Linux Mint 16

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


(Jump to the original submission Jump to the original submission)

Wed Oct 8 17:41:27 2014, comment #10:

for the log:
1.12 commit is: https://github.com/wesnoth/wesnoth/commit/986002b44880093e848e7c10a8a08581d53e3796
master commit is: https://github.com/wesnoth/wesnoth/commit/35f781d428aed486752d65d01624d9a236a363d5

Daniel <gfgtdf>
Project Member
Wed Apr 23 03:01:40 2014, comment #9:

Let's be sure to test how observers are handled as well. Ideal behavior would be that observers also progress. I can help test that, hit me up on IRC (as happygrue) and we can make sure this works.

George <wintermute>
Project Member
Tue Apr 22 23:25:13 2014, comment #8:

As someone who has played a lot of MP campaigns as both host and player, that seems a reasonable way to handle it IMO. We just need to make players aware of this now, though really they will also figure it out.

George <wintermute>
Project Member
Mon Apr 21 17:32:43 2014, comment #7:

ok i implemented what i said below in the following way:
Hosts can always end linger mode, non host can never end linger mode. Instead, the linger mode is ended on non hosts when it's ended on hosts.

Daniel <gfgtdf>
Project Member
Sun Apr 20 22:16:09 2014, comment #6:

ok i think the orignal plan to make this work was to disable the end_turn button when starting linger mode, and reable it when receivong notifynextscenario, in playturn.cpp with:

gui::button* btn_end = resources::screen->find_action_button("button-endturn");
if(btn_end) {

however this doesn't work because the state of the endturn button get reassigned by the hotkeys code to the value of
can_execute_command(end turn hotkey, null)
so i tihnk in order to fix this problem we have to ensure
can_execute_command(hotkey::HOTKEY_ENDTURN) returns the correct value.
Note the it shoudl always return true for the host when in linger mode.

Daniel <gfgtdf>
Project Member
Sat Apr 19 16:45:11 2014, comment #5:

Also related: the button should probably be greyed out and unclickable for observers as well, until the host gives the next level.

Chris Beck <involution>
Project Member
Sat Apr 19 04:51:53 2014, comment #4:

I think the problem is actually just a UI problem and not with any of the engine -- the end scenario button in linger mode should not be clickable when it is greyed out!

Chris Beck <involution>
Project Member
Fri Apr 11 07:06:30 2014, comment #3:

Hmm so this is pretty strange. I seemed to get this exact bug in 1.10 also just now while playing World Conquest. -- two players tried to proceed to next scenario before host and instead received the current level and went OOS. I'm quite surprised if it's never been reported, and I couldn't reproduce it with the looping test scenario in 1.11.5, but maybe that is just a bad test case. Will try to do another proper test in 1.10 soon...

Anyways it would be great to fix it, but if it isn't actually a new bug and it is too hard to fix then it's not clear if we should consider it a blocker.

Chris Beck <involution>
Project Member
Thu Apr 10 18:05:56 2014, comment #2:

I have tested this now in 1.11.5: There's no mp campaign mechanism there, but I used the looping test scenario in a networked setting. Then there is still a bug here but the character is different:

If P2 ends the scenario before the host, they transition to the next level, but they believe they should play before the host and cause OOS this way.

Chris Beck <involution>
Project Member
Thu Apr 10 15:38:48 2014, comment #1:

Sorry, I didn't include all the details I intended to in the OP.

1.) DO NOT use debug mode, that will result in a different problem. (https://gna.org/bugs/?21902).
2.) Instead cheat by using the following patch to Kalenz's definition in data/campaigns/Legend_of_Wesmere/utils/characters.cfg:

#define KALENZ

(Patch included for convenience, use git apply to use it.)

You may consistently win on turn 2 by moving Kalenz directly to the enemy leader.

3.) Launch 3 local clients on a local server. To create the bug, end linger mode using P2 before ending it for the host.

(file #20504)

Chris Beck <involution>
Project Member
Thu Apr 10 06:41:49 2014, original submission:

When a scenario ends and goes to linger mode before transitioning to the next scenario, players may linger as long as they like until they end turn and move to the next scenario. It turns out that there is a sort of race condition here -- if the host transitions first it is fine, but otherwise it isn't.

Tested with LoW and also a simple 2p MP scenario that loops on itself for testing. Appears to affect every build since at least 1.11.9.

If the client (non-host) ends turn before the host, they will be dropped from the game and kicked to the lobby, while the host will be left to reassign them. Reassigning them also doesn't work, wesnoth reports controller type errors after the host transitions. ("Side 4 doesn't have a controller! To proceed with the game...")

If an observer ends turn before the host, they will be moved to the mp wait dialog. If the host ends turn, they will transition correctly and the observer will as well. The host may even reassign controllers in this time and give obs control, and the obs will launch the scenario correctly. Only the non-host clients seem to have a problem here.

Chris Beck <involution>
Project Member


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

Attach File(s):

Attached Files


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by mattsc (Updated the item)
  • -unavailable- added by shadowmaster (Updated the item)
  • -unavailable- added by wintermute (Posted a comment)
  • -unavailable- added by gfgtdf (Posted a comment)
  • -unavailable- added by thunderstruck (Updated the item)
  • -unavailable- added by involution (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.


    Error: not logged in



    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon Oct 13 20:06:45 2014mattscStatusReady For Test=>Fixed
    Wed Apr 23 01:00:11 2014shadowmasterStatusWorks For Me=>Ready For Test
    Mon Apr 21 17:32:43 2014gfgtdfStatusNone=>Works For Me
    Thu Apr 10 18:38:48 2014thunderstruckAssigned toNone=>thunderstruck
    Thu Apr 10 15:38:48 2014involutionAttached File-=>Added overpower_kalenz.patch, #20504
    Thu Apr 10 06:46:03 2014involutionSummaryScenario transitions in MP don\'t work unless host transitions first=>Scenario transitions in networked MP don't work unless host transitions first
    Thu Apr 10 06:42:21 2014involutionSeverity3 - Normal=>5 - Blocker
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup