bugBattle for Wesnoth - Bugs: bug #20895, Using the default random map...

Show feedback again

bug #20895: Using the default random map generator in sp causes assertation failure

Submitted by:  SigurdFireDragon <sigurdfdragon>
Submitted on:  Thu Jun 13 17:30:09 2013  
Category: BugSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Campaign
Status: FixedPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Release: trunk (1.11.4+dev)Operating System: Win 7 x64

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)

Sun May 25 09:25:17 2014, comment #18:

That is, commit 8617a02a88a38d8fe01ee0a3672d75fc5fe72924 merged PR #121, thereby fixing most of bug #20895, with the remainder being bug #22068.

Alexander van Gessel <ai0867>
Project Member
Sat May 24 23:29:20 2014, comment #17:

This can be marked fixed.
8617a02a88a38d8fe01ee0a3672d75fc5fe72924 fixed the assertion error, while the 'scenario is invalid because it has no id' error aspect has been given it's own report in #22068.

SigurdFireDragon <sigurdfdragon>
Sat May 10 18:02:59 2014, comment #16:

A more through check with testing & reverting starting at: 84b8dbafd26fdd1000a8f677d65973cd836999b3

Reveals that commit: c63e52ca143a78272cfd213934f3ccb0e1493c57 "Changed the way carryover info is stored in gamestate" (0212/08/01)
introduced a corruption of multiplayer start of scenario with default mapgen that loaded, but could not advance to the next scenario. Prior to this, multiplayer start of scenario saves with default map generator, loaded through the multiplayer load dialog, worked properly.

Futhermore, commit: 8f6a3a5490245c46268f8f821292da33879c2002 "Changed the structure of savegames to only contain the data necessary." (2012/08/15)
changed the above corruption into the current "This scenario is invalid because it has no id." error when trying to load a multiplayer start of scenario with default mapgen save in the multiplayer load dialog.

Summary of test procedure I used:
Did a switch/checkout to:
Then reverted the following:
1. 9d0ca55d9b46c77ef4a7a962641461313d0f943d
2. 8f6a3a5490245c46268f8f821292da33879c2002
3. c63e52ca143a78272cfd213934f3ccb0e1493c57
At each revert, created a new start of scenario save and attempted to load it.

I can provide the branch of testing on github if needed, along with a test case add-on set if the current attached file #18082 is insufficient.

Please disregard comment #14, as I had made some errors in my testing there.

SigurdFireDragon <sigurdfdragon>
Fri May 9 20:00:39 2014, comment #15:

For clarification, the referred to start of scenario saves are all ones that are using the default map generator.

SigurdFireDragon <sigurdfdragon>
Fri May 9 19:54:59 2014, comment #14:

Something that might be relevant to the "scenario has no id" error:

when I switched to 91139b26c76817c089b4ee9ab1ce10c74c074af5 (2012-08-25)
it produced the "has no id" from a multiplayer start of scenario save as expected.

From this point, when I reverted 9d0ca55d9b46c77ef4a7a962641461313d0f943d (2012-08-20) and then also reverted 8f6a3a5490245c46268f8f821292da33879c2002 (2012-08-15) the error became an assertion failure.

SigurdFireDragon <sigurdfdragon>
Fri May 9 18:09:26 2014, comment #13:

Some things in std_err when using --log-debug=all
that might be relevant to the remaining error of "The scenario is invalid because it has no id" when loading a start of scenario save in multiplayer.

SigurdFireDragon <sigurdfdragon>
Tue Apr 15 01:44:12 2014, comment #12:

No special reason to think it can be fixed soon.
No plans to do it myself. My C++ knowledge is dreadfully insufficient to handle this situation.

SigurdFireDragon <sigurdfdragon>
Mon Apr 14 02:28:37 2014, comment #11:

It's an interesting (and undocumented :( ) commit you have found there. But my knowledge about that part of the code is quiet low, and most likely i cannot do anything else than the other thing before 1.12. Maybe i'll try to refcator gamestatus.hpp&co which could have an influence on this bug. but i don't think i'll do that in 1.12.

> When the "invalid because of no id" is solved, can a simplified backport for 1.12 be made?

do you have a specail reason to think we can fix this issue soon ? Or do you even plan to do it yourself ? If there is a commit that would fix this issue that doesn cause other problme ther is no reason why it shouldn't be backported.

the commit i mentioned earlier will most liekey go into 1.12.

Daniel <gfgtdf>
Project Member
Sat Apr 12 23:51:08 2014, comment #10:

8617a02a88a38d8fe01ee0a3672d75fc5fe72924 fixed the assertation failure that occurred with loading MP random map start of scenario saves through the Main Screen -> Load Game menu; loading a start of scenario save from the in game top of screen menu bar -> menu -> load game during a game; and starting a SP Campaign that uses random maps. Thus, it seems to cover all occurrences of the assertion failure.

It did not fix loading a random map start of save through the Main Screen -> Multiplayer -> Load Game button, that still produces the: "The scenario is invalid because it has no id." error.

On a related note, can someone more knowledgeable than me take a look at c17d84b12f4b45555fa5ec2b3f51c4fe5a1d67e3 and see if anything there caused the issue? My reasoning is that the backtrace goes through playcampaign.cpp and this seems to be a significant change during the time frame in question that may have affected it.

When the "invalid because of no id" is solved, can a simplified backport for 1.12 be made?

SigurdFireDragon <sigurdfdragon>
Wed Apr 2 23:14:30 2014, comment #9:

the bug might be fixed after 8617a02a88a38d8fe01ee0a3672d75fc5fe72924, since that code removes the file src\random.cpp.
(i noticed this bug after committing this, so the commit was unrelated to this bug)

Daniel <gfgtdf>
Project Member
Tue Mar 4 02:41:08 2014, comment #8:

I've tried solve this by doing an alternate git timeline, but I'm not really familiar enough with git at this point to resolve all the conflicts that appeared. I've done all I can with this at this point. If anyone has any questions about any of my comments or research here, feel free to email me or pm me on the forums about it.

SigurdFireDragon <sigurdfdragon>
Sun Feb 2 03:22:17 2014, comment #7:

More info: If you load a multiplayer start of scenario save that uses a random map with a road, what happens depends on how you load it.

Launch game -> Load button -> mp scenario start = crash (Same assertation failure line #74 as below)
Launch game -> Multiplayer button -> Local Game -> Load Game -> mp scenario start = message: "The scenario is invalid because it has no id."

SigurdFireDragon <sigurdfdragon>
Fri Jan 3 00:21:11 2014, comment #6:

Wrong bug.

Alexander van Gessel <ai0867>
Project Member
Fri Jan 3 00:19:24 2014, comment #5:

Fixed in 3a2c24d2d087.

For the bug to trigger, the attacker (the eye stalk) has to have exactly one usable attack (its gaze), and the defender (the royal guard) has to have no defense at that range. There are other requirements though, as simply pitting an ulf against a DA isn't enoough.

Alexander van Gessel <ai0867>
Project Member
Fri Jan 3 00:04:28 2014, comment #4:

Running the map generator code in a strictly multiplayer setup does not cause problems.

SigurdFireDragon <sigurdfdragon>
Thu Jan 2 21:41:58 2014, comment #3:

Some more info:

Final lines in 1.11.7+dev stderr using --log-debug=all
where it raises the assertion failure

Comparable lines in 1.10.7+dev stderr using --log-debug=all
where it works

Running the SP campaign in --debug Multiplayer does not cause the error.

Starting the SP campaign in single player with the MULTIPLAYER define does not prevent the assertation failure.

SigurdFireDragon <sigurdfdragon>
Sun Dec 1 05:45:26 2013, comment #2:

This has something to do with road placement in the default map generator, as removing all [road_cost] tags from [generator] will prevent the assertion failure from occurring.

As an example, Mystery Campaign uses removing [road_cost] tags as a workaround for 1.11)

SigurdFireDragon <sigurdfdragon>
Fri Jul 19 00:17:11 2013, comment #1:

Some more info on the bug:

I've narrowed the bug's introduction to between: 1a27a8cb08e846722005f618bdb8a14c843eee7e on 2012-02-22
84b8dbafd26fdd1000a8f677d65973cd836999b3 on 2012-08-24.
Due to the map format changes, I can't narrow it down futher, perhaps there's some fancy git branching/merging that could be done to allow the old format during the time period, but I don't know how to do that at the moment.

I ran a debug build using CodeBlocks 10.05 & gdb 7.3 here's the call stack:

Here's the relevant Codeblocks console dialog:

SigurdFireDragon <sigurdfdragon>
Thu Jun 13 17:30:09 2013, original submission:

Whenever the default random map generator is used in a single player campaign, the following happens:

Assertion failed!
\src\random.cpp Line 74
Expresion: random_generator!=NULL

stderr relevant contents:

Attached is a test case add-on causing the error in sp

Here's a link to a possible relevant previous bug.

SigurdFireDragon <sigurdfdragon>


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

Attach File(s):

Attached Files
file #18082:  Test_Bed.zip added by sigurdfdragon (2kB - application/x-zip-compressed)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by shadowmaster (Updated the item)
  • -unavailable- added by gfgtdf (Posted a comment)
  • -unavailable- added by ai0867 (Posted a comment)
  • -unavailable- added by sigurdfdragon (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed May 28 22:40:17 2014shadowmasterOpen/ClosedOpen=>Closed
    Sun May 25 09:25:17 2014ai0867StatusNone=>Fixed
    Fri Jan 3 00:21:11 2014ai0867StatusFixed=>None
      Assigned toai0867=>None
    Fri Jan 3 00:19:24 2014ai0867StatusNone=>Fixed
      Assigned toNone=>ai0867
    Thu Jun 13 17:30:09 2013sigurdfdragonAttached File-=>Added Test_Bed.zip, #18082
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup