MantisBT - VCMI
View Issue Details
0001180VCMIGUI - PreGamepublic2013-01-21 07:562014-05-30 17:41
Warmonger 
Ivan 
highmajorsometimes
closedfixed 
PCWindows 7SP1
 
0.910.91 
0001180: Scenario options are always random if mod faction is used
It seems that now internal map options are not respected. Starting map with predefined towns and/or heroes leads to crash. Not sure yet if these are tigtly related, but the bug is bug.

Please take a look.
No tags attached.
png Starting options.png (243,205) 2013-01-21 07:56
https://bugs.vcmi.eu/file_download.php?file_id=1172&type=bug
png

? Jebus 4P AI test 2.h3m (80,910) 2013-01-21 07:56
https://bugs.vcmi.eu/file_download.php?file_id=1173&type=bug
txt VCMI_Server_log.txt (327,553) 2013-01-21 19:46
https://bugs.vcmi.eu/file_download.php?file_id=1174&type=bug
? 144SuperSlam30092012.h3m (82,825) 2013-01-22 21:15
https://bugs.vcmi.eu/file_download.php?file_id=1178&type=bug
Issue History
2013-01-21 07:56WarmongerNew Issue
2013-01-21 07:56WarmongerStatusnew => assigned
2013-01-21 07:56WarmongerAssigned To => beegee
2013-01-21 07:56WarmongerFile Added: Starting options.png
2013-01-21 07:56WarmongerFile Added: Jebus 4P AI test 2.h3m
2013-01-21 08:34WarmongerSummaryScenario options are awlays random, map crashes at game start => Scenario options are always random, map crashes at game start
2013-01-21 09:08beegeeNote Added: 0003292
2013-01-21 19:31beegeeNote Added: 0003294
2013-01-21 19:34WarmongerNote Added: 0003295
2013-01-21 19:38beegeeNote Added: 0003296
2013-01-21 19:46beegeeFile Added: VCMI_Server_log.txt
2013-01-21 19:51beegeeNote Added: 0003297
2013-01-21 19:52beegeeNote Edited: 0003297bug_revision_view_page.php?bugnote_id=3297#r2093
2013-01-21 20:00beegeeNote Added: 0003298
2013-01-22 10:18WarmongerNote Added: 0003306
2013-01-22 11:00beegeeNote Added: 0003307
2013-01-22 11:09beegeeNote Edited: 0003307bug_revision_view_page.php?bugnote_id=3307#r2099
2013-01-22 12:08TowNote Added: 0003309
2013-01-22 14:22WarmongerNote Added: 0003310
2013-01-22 14:47WarmongerNote Edited: 0003310bug_revision_view_page.php?bugnote_id=3310#r2101
2013-01-22 16:11TowNote Added: 0003311
2013-01-22 21:15WarmongerNote Added: 0003314
2013-01-22 21:15WarmongerFile Added: 144SuperSlam30092012.h3m
2013-01-23 20:30WarmongerSeverityblock => major
2013-01-23 20:30WarmongerCategoryMechanics - Adventure Map => GUI - PreGame
2013-01-23 20:30WarmongerSummaryScenario options are always random, map crashes at game start => Scenario options are always random if mod faction is used
2013-01-23 20:47IvanNote Added: 0003317
2013-01-23 21:24IvanNote Added: 0003318
2013-01-23 21:24IvanAssigned Tobeegee => Ivan
2013-01-23 22:11IvanNote Added: 0003319
2013-01-23 22:11IvanStatusassigned => resolved
2013-01-23 22:11IvanFixed in Version => 0.91
2013-01-23 22:11IvanResolutionopen => fixed
2014-05-30 17:41beegeeStatusresolved => closed

Notes
(0003292)
beegee   
2013-01-21 09:08   
Will look into this today evening. I didn't noticed this yesterday, map loading worked properly with map options. So we will see... Many crashes in VCMI the last days:(
(0003294)
beegee   
2013-01-21 19:31   
Sorry but I can't confirm this bug. Starting a map with predefined towns/heroes works fine. Starting options are recognized and take effect. Nevertheless sth. seems to be wrong. I got 2 random crashes while testing when loading a map.
(0003295)
Warmonger   
2013-01-21 19:34   
Did you try the map attached?
(0003296)
beegee   
2013-01-21 19:38   
No, will try:)
(0003297)
beegee   
2013-01-21 19:51   
(edited on: 2013-01-21 19:52)
Starting options are set(not as in your image), but I can't start the map. I've attached the server log file. The GameHandler is fully initialized in the server. Server reports about how many players connection XY handles. The new turn message has been applied....

(0003298)
beegee   
2013-01-21 20:00   
Sometimes I receive a crash when the client is initializing AI players. Line 388 at Client.cpp: playerint[color]->init(cb.get());

In init method call to d-tor of SetGlobalState leads to the crash (VCAI.cpp, line 40)
~SetGlobalState()
{
ai.release(); // crash!
cb.release();
}
(0003306)
Warmonger   
2013-01-22 10:18   
After latest updates I managed to launch the map. However, map options still look random as in the picture.
(0003307)
beegee   
2013-01-22 11:00   
(edited on: 2013-01-22 11:09)
Perhaps the map header is loaded false, so it's not a visual / GUI bug. Try to set a breakpoint in lib/Mapping/CMapService.cpp in the method CMapLoaderH3M::readPlayerInfo() somewhere at the end. Then select the map which is responsible for the random town/hero selection. Now look into the class member field mapHeader->players[i].allowedFactions. Are there no faction, only one faction or several factions listed? (should be one faction)
PS: Map headers are loaded before the map selection screen gets opened. Perhaps its better to debug in PreGame around CSelectionScreen::changeSelection.

(0003309)
Tow   
2013-01-22 12:08   
The settings issue is not reproducible for me. When I enter Advanced Options for the attached map, the factions are set and fixed (Tower for Red and so on).

@Beegee and ~SetGlobalState crash
This is strange, releasing pointer should never crash. Object is global, so it should be "always" alive. Can you capture the callstack? What dies exactly crash?
(you can also try rebuilding solution — it sometimes solves "unthinkable" issues)
(0003310)
Warmonger   
2013-01-22 14:22   
(edited on: 2013-01-22 14:47)
Indeed there were some build issues recently since I dispatched project settings from trunk. The thing is, even with building fixed, interface problem remains.

Maybe we need a singleton pattern for an object or two to prevent compiler-dependent instantiation.

(0003311)
Tow   
2013-01-22 16:11   
I don't see how static initialization order could cause any of these issues. [Also we do use the same compiler. ;) ]

Just try debugging (as Beegee described), and check why settings are not set right.
(0003314)
Warmonger   
2013-01-22 21:15   
I think it's caused by Cove town installed. On map SuperSlam (attached) first player has 2 towns available, the second one - all ten. It makes no difference what i set in starting options, though.

Without Cove it all works fine.
https://www.dropbox.com/s/98pm5ibk9ni7gei/cove.rar [^]
(0003317)
Ivan   
2013-01-23 20:47   
The source of this bug is probably same as in 0000820
New towns are by default enabled so map defaults may not be respected.

Interesting - in map editor you can't select available towns in RoE or AB maps. In vcmi I don't see any checks for map version in this area. Is this a bug of H3 editor or bug in vcmi?
(0003318)
Ivan   
2013-01-23 21:24   
I think I found it. Will fix.

This bug was present always - new towns just made it more visible.
(0003319)
Ivan   
2013-01-23 22:11   
Should be fixed, rev 3124.