News:

MegaGlests' game mods menu let's you install many new mods. Even more are available on the MegaGlest Wiki and the Mods forum.

Main Menu

scenario runs from scenario menu but not from network menu

Started by andy_5995, 18 June 2016, 16:52:36

andy_5995

This network scenario loads and runs fine when I run it from the 'scenario' menu. The network slot switches to AI as it should.

When I start a game from the host menu, the game loads, and then crashes a few seconds after it starts.

And when started from the host menu, I notice on the 'loading' screen that it is loading a 3rd faction - Persian.

Quote[2016-06-18 11:46:17] Runtime Error information:
======================================================
In [/home/andy/src/megaglest-3.12.0/source/glest_game/main/main.cpp::handleSIGSEGV Line: 5862] Error detected: signal 11:

Stack Trace:
megaglest:Glest::Game::ExceptionHandler::handleRuntimeError(char const*, bool)address [0x7f383855eeb2] line: 0
megaglest:Glest::Game::handleSIGSEGV(int)address [0x7f383855f223] line: 0
/lib/x86_64-linux-gnu/libc.so.6:()address [0x7f38338500e0] line: 0
megaglest:Glest::Game::Game::initCamera(Glest::Game::Map*)address [0x7f3838428b13] line: 0
megaglest:Glest::Game::Game::init(bool)address [0x7f383846d345] line: 0
megaglest:Glest::Game::Program::setState(Glest::Game::ProgramState*, bool)address [0x7f383858036a] line: 0
megaglest:Glest::Game::MenuStateCustomGame::PlayNow(bool)address [0x7f3838608432] line: 0
megaglest:Glest::Game::MenuStateCustomGame::mouseClick(int, int, Shared::Platform::MouseButton)address [0x7f383861699b] line: 0
megaglest:Glest::Game::MainWindow::eventMouseDown(int, int, Shared::Platform::MouseButton)address [0x7f38385628f1] line: 0
megaglest:Shared::Platform::Window::handleMouseDown(SDL_Event)address [0x7f3838a3ac84] line: 0
megaglest:Shared::Platform::Window::handleEvent()address [0x7f3838a3b71d] line: 0
megaglest:Glest::Game::glestMain(int, char**)address [0x7f3838572af2] line: 0
megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x7f38385770f2] line: 0
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main()address [0x7f383383cb45] line: 0
megaglest:()address [0x7f38383424ca] line: 0

<?xml version="1.0" standalone="yes" ?>
<scenario>
--chess_01 / A MegaGlest ( https://megaglest.org/ ) 1 vs 1 network scenario
--Rev 2016.06.16-1
--https://github.com/andy5995/MegaGlest_scenarios_AA
--2 player chess with Indian faction on a 64x64 map
--Your shaman must survive
--By Andy Alt
--CC-BY-SA
<difficulty value="4"/>
<players>
<player control="human" faction="indian" team="1"/>
<player control="network" faction="indian" team="2"/>

--the other 2 players can be observers. No units are created for them.
<player control="network" faction="tech" team="8"/>
<player control="network" faction="tech" team="8"/>

</players>
<map value="forest_for_four"/>
<tileset value="autumn"/>
<tech-tree value="megapack"/>
<default-resources value="false"/>
<default-units value="false"/>
<default-victory-conditions value="false"/>
<fog-of-war value="false"/>

<scripts>
<global>
KingID = {}
</global>
<startup>

--function wait(seconds)
-- local start = os.time()
-- repeat until os.time() > start + seconds
--end

--setDisplayText('Your fire golem must survive')
--wait(7)
--clearDisplayText()

theKing='shaman'

showMessage('Intro' , 'chess_01')

NumOfStickfighters=8
NumOfFireArchers=2
NumOfAxeThrowers=2
NumOfHorsemen=2
NumOfThunderbirds=1


for playerNum=0, 1 do
for i=1, NumOfStickfighters do
createUnit('stickfighter', playerNum, startLocation(playerNum))
end
end

for playerNum=0, 1 do
for i=1, NumOfFireArchers do
createUnit('fire_archer', playerNum, startLocation(playerNum))
end
end

for playerNum=0, 1 do
for i=1, NumOfHorsemen do
createUnit('horseman', playerNum, startLocation(playerNum))
end
end

for playerNum=0, 1 do
for i=1, NumOfAxeThrowers do
createUnit('axe_thrower', playerNum, startLocation(playerNum))
end
end

for playerNum=0, 1 do
for i=1, NumOfThunderbirds do
createUnit('thunderbird', playerNum, startLocation(playerNum))
end
end

for playerNum=0, 1 do
createUnit(theKing, playerNum, startLocation(playerNum))

--assign variable to theKing to see who won later
KingID[playerNum +1]=lastCreatedUnit()
end




</startup>


<unitDied>
--thanks to titi of megaglest.org for helping me determine a winner
if KingID[2]==lastDeadUnit() then
setPlayerAsWinner(0)
endGame()
end

if KingID[1]==lastDeadUnit() then
setPlayerAsWinner(1)
endGame()
end


</unitDied>



</scripts>
</scenario>


andy_5995

I did see some more output. something about 5 players on a 4 player map. Changing the map to a 6-player map worked around the problem temporarily. I still am curious as to why this is happening.

andy_5995

The stacktrace I posted earlier is from error.log. This is the console output, which gives the exact message about the "5" faction problem:

Quote*ERROR* [2016-06-19 12:55:16] In [/home/andy/src/megaglest-3.12.0/source/glest_game/game/game.cpp::init 1277]
error [This map only supports 4 players, factionCount is 5
Stack Trace:
megaglest:Shared::Platform::megaglest_runtime_error::megaglest_runtime_error(std::string const&, bool)address [0x7fdeba7d69a1] line: 0
megaglest:Glest::Game::World::initFactionTypes(Glest::Game::GameSettings*)address [0x7fdeba6759fe] line: 0
megaglest:Glest::Game::World::init(Glest::Game::Game*, bool, bool)address [0x7fdeba6763d3] line: 0
megaglest:Glest::Game::Game::init(bool)address [0x7fdeba1f0415] line: 0
megaglest:Glest::Game::Program::setState(Glest::Game::ProgramState*, bool)address [0x7fdeba30436a] line: 0
megaglest:Glest::Game::MenuStateCustomGame::PlayNow(bool)address [0x7fdeba38c432] line: 0
megaglest:Glest::Game::MenuStateCustomGame::mouseClick(int, int, Shared::Platform::MouseButton)address [0x7fdeba39a99b] line: 0
megaglest:Glest::Game::MainWindow::eventMouseDown(int, int, Shared::Platform::MouseButton)address [0x7fdeba2e68f1] line: 0
megaglest:Shared::Platform::Window::handleMouseDown(SDL_Event)address [0x7fdeba7bec84] line: 0
megaglest:Shared::Platform::Window::handleEvent()address [0x7fdeba7bf71d] line: 0
megaglest:Glest::Game::glestMain(int, char**)address [0x7fdeba2f6af2] line: 0
megaglest:Glest::Game::glestMainSEHWrapper(int, char**)address [0x7fdeba2fb0f2] line: 0
/lib/x86_64-linux-gnu/libc.so.6:__libc_start_main()address [0x7fdeb55c0b45] line: 0
megaglest:()address [0x7fdeba0c64ca] line: 0
]
In [/home/andy/src/megaglest-3.12.0/source/glest_game/main/main.cpp::handleSIGSEGV Line: 5862] Error detected: signal 11:
Error saved to logfile [/home/andy/.megaglest/error.log]

Oddly enough, when I switch to a 6-player map, MG doesn't try to load the '3rd' faction when the scenario is started from the host menu.