MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002972VCMIRandom Map Generatorpublic2018-07-17 11:332018-07-19 05:16
ReporterWarmonger 
Assigned ToSXX 
PrioritynormalSeverityblockReproducibilitysometimes
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version0.next 
Target VersionFixed in Version 
Summary0002972: RMG crashes
DescriptionI have several issues with RMG in my build going to dump them here.
TagsNo tags attached.
Attached Filespng file icon image.png [^] (15,243 bytes) 2018-07-19 05:16

- Relationships

-  Notes
(0007590)
Warmonger (administrator)
2018-07-17 11:34
edited on: 2018-07-17 11:40

When creating random map with default options, get access violation at AI player 2:

bool CGameState::isVisible(int3 pos, PlayerColor player)
{
    if(player == PlayerColor::NEUTRAL)
        return false;
    if(player.isSpectator())
        return true;

    return getPlayerTeam(player)->fogOfWarMap[pos.x][pos.y][pos.z];
}

On second try, it crashed at player 4.

(0007591)
Warmonger (administrator)
2018-07-17 11:40
edited on: 2018-07-17 11:43

Unit tests fail with team mismatch:

[----------] 2 tests from MapManager
[ RUN ] MapManager.DrawTerrain_Type
[ OK ] MapManager.DrawTerrain_Type (96 ms)
[ RUN ] MapManager.DrawTerrain_View
[ OK ] MapManager.DrawTerrain_View (9 ms)
[----------] 2 tests from MapManager (105 ms total)

[----------] 3 tests from MapFormat
[ RUN ] MapFormat.Random
e:\programowanie\vcmi\source\test\map\mapcomparer.cpp(87): error: Expected: actual.team
      Which is: 1-byte object <00>
To be equal to: expected.team
      Which is: 1-byte object <03>
Google Test trace:
e:\programowanie\vcmi\source\test\map\cmapformattest.cpp(69): MapFormat_Random saved
e:\programowanie\vcmi\source\test\map\cmapformattest.cpp(67): MapFormat_Random serialized
e:\programowanie\vcmi\source\test\map\cmapformattest.cpp(60): MapFormat_Random generated
e:\programowanie\vcmi\source\test\map\cmapformattest.cpp(42): MapFormat_Random start
e:\programowanie\vcmi\source\test\map\mapcomparer.cpp(87): error: Expected: actual.team
      Which is: 1-byte object <03>
To be equal to: expected.team
      Which is: 1-byte object <00>
Google Test trace:
e:\programowanie\vcmi\source\test\map\cmapformattest.cpp(69): MapFormat_Random saved
e:\programowanie\vcmi\source\test\map\cmapformattest.cpp(67): MapFormat_Random serialized
e:\programowanie\vcmi\source\test\map\cmapformattest.cpp(60): MapFormat_Random generated
e:\programowanie\vcmi\source\test\map\cmapformattest.cpp(42): MapFormat_Random start
[ FAILED ] MapFormat.Random (949 ms)
[ RUN ] MapFormat.Objects
[ OK ] MapFormat.Objects (443 ms)
[ RUN ] MapFormat.Terrain
[ OK ] MapFormat.Terrain (20 ms)
[----------] 3 tests from MapFormat (1412 ms total)

This result is consistent after multiple tests.

(0007592)
Warmonger (administrator)
2018-07-17 13:25

Daily builds also crash RMG, in different ways but not always. Regular game works fine.
(0007593)
AVS (administrator)
2018-07-17 13:31

Test failure indicates problem in map format
(0007594)
Warmonger (administrator)
2018-07-17 13:35

Right, but why it is working for everyone else?
(0007595)
AVS (administrator)
2018-07-17 13:37

Might be compiler-dependent
(0007596)
Warmonger (administrator)
2018-07-17 13:59

Sometimes (for a second time now) map is generated, but contains no monsters.

Might be an issue with "monster strength" blinking buttons.
(0007598)
Warmonger (administrator)
2018-07-19 05:12

Map is generated correctly if you set SPECIFIC number of players in options
Not random

In
 CVCMIServer::prepareToStartGame()
si always contains infos about 8 players
Game crashes if there are less

This snippet in lobby defaults to 8 players at random setting

    // Generate player information
    mapInfo->mapHeader->players.clear();
    int playersToGen = PlayerColor::PLAYER_LIMIT_I;
    if(mapGenOptions->getPlayerCount() != CMapGenOptions::RANDOM_SIZE)
        playersToGen = mapGenOptions->getPlayerCount();
    mapInfo->mapHeader->howManyTeams = playersToGen;

    for(int i = 0; i < playersToGen; ++i)
    {
        PlayerInfo player;
        player.isFactionRandom = true;
        player.canComputerPlay = true;
        if(mapGenOptions->getCompOnlyPlayerCount() != CMapGenOptions::RANDOM_SIZE && i >= mapGenOptions->getHumanOnlyPlayerCount())
        {
            player.canHumanPlay = false;
        }
        else
        {
            player.canHumanPlay = true;
        }
        player.team = TeamID(i);
        player.hasMainTown = true;
        player.generateHeroAtMainTown = true;
        mapInfo->mapHeader->players.push_back(player);
    }

    mapInfoChanged(mapInfo, mapGenOptions);
(0007599)
Warmonger (administrator)
2018-07-19 05:15

However, monster strength buttons are also broken as a separate issue

monsterStrength grows by 2 every time this function is entered

Buttons are stored in a map, so they grow when adresed incorrectly

Uploaded image from debugger.

- Issue History
Date Modified Username Field Change
2018-07-17 11:33 Warmonger New Issue
2018-07-17 11:33 Warmonger Assigned To => Warmonger
2018-07-17 11:33 Warmonger Status new => assigned
2018-07-17 11:34 Warmonger Note Added: 0007590
2018-07-17 11:40 Warmonger Note Edited: 0007590 View Revisions
2018-07-17 11:40 Warmonger Note Added: 0007591
2018-07-17 11:41 Warmonger Note Edited: 0007591 View Revisions
2018-07-17 11:43 Warmonger Note Edited: 0007591 View Revisions
2018-07-17 13:25 Warmonger Note Added: 0007592
2018-07-17 13:31 AVS Note Added: 0007593
2018-07-17 13:35 Warmonger Note Added: 0007594
2018-07-17 13:37 AVS Note Added: 0007595
2018-07-17 13:59 Warmonger Note Added: 0007596
2018-07-19 05:12 Warmonger Note Added: 0007598
2018-07-19 05:15 Warmonger Note Added: 0007599
2018-07-19 05:16 Warmonger File Added: image.png
2018-07-19 05:16 Warmonger Assigned To Warmonger => SXX

Site | Forums | Wiki | Slack | GitHub


Copyright © 2000 - 2019 MantisBT Team
Hosting provided by DigitalOcean