Notes |
|
(0007590)
|
Warmonger
|
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
|
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.
|
|
|
|
Daily builds also crash RMG, in different ways but not always. Regular game works fine. |
|
|
(0007593)
|
AVS
|
2018-07-17 13:31
|
|
Test failure indicates problem in map format |
|
|
|
Right, but why it is working for everyone else? |
|
|
(0007595)
|
AVS
|
2018-07-17 13:37
|
|
Might be compiler-dependent |
|
|
|
Sometimes (for a second time now) map is generated, but contains no monsters.
Might be an issue with "monster strength" blinking buttons. |
|
|
|
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); |
|
|
|
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. |
|