Page 1 of 1

Game does not end!!

Posted: Fri Jul 20, 2007 9:21 pm
by FelixO
Delete log files before starting
Play joeys campaign, which is a 2 player game. (1 human , 1 AI)
Regularly grep the logs to see if 'Team 1 is dead', e.g. 1 per minute
After 9mins 30 secs the logs show that 'Team 1 is Dead'
After 12 minutes Quit game.
The stats graph shows that player 1 (AI) was destroyed at about 8min 30 secs.

But the game did not end!!

Downloaded and installed from source on 19th July 2007
version 0.8.23
OS: Fedora 7

Fix

Posted: Fri Jul 20, 2007 11:59 pm
by FelixO
To get the game to end at approx the correct time edit Game.cpp and replace the existing function with this:

Code: Select all

void Game::scriptSyncStep()
{
	int countAlive = 0;
	int rememberAlive = 0;

	// do a script step
	script.syncStep(gui);

	// alter win/loose conditions
	for (int i=0; i<session.numberOfTeam; i++)
	{
		if (teams[i]->isAlive)
		{
			countAlive += 1;
			rememberAlive = i;

			if (script.hasTeamWon(i))
				teams[i]->hasWon=true;
			if (script.hasTeamLost(i))
				teams[i]->isAlive=false;
		}
	}

	if (countAlive ==1)
	{
		teams[rememberAlive]->hasWon=true;
	}
}
This might not work if you have alliances (??) but will end the game when you are the only player alive.
The stats graph will show that the last enemy still had some units but at least the game doesn't go on for ever :-)

Posted: Sat Jul 21, 2007 3:36 pm
by Donkyhotay
In the future you should report all bug reports within the bug tracker. You will get better response there then in the forums.
http://savannah.nongnu.org/bugs/?group=glob2

Didn't end, but does now

Posted: Fri Feb 29, 2008 11:40 pm
by Lexen
I am using Ubuntu and the game wouldn't end, but then I updated it with the version on getdeb.net and now I don't have that problem anymore. Do you still have that problem with the new version?

Re: Game does not end!!

Posted: Sat Mar 01, 2008 1:47 pm
by Giszmo
in the campaign system there was a bug that made games last forever if you performed too well in that you upgraded buildings to a state the win condition was not expecting:

echo "Build 2 schools!"
while(count of __level 1__ schools <2) wait
win

this was only fixed for the next version to come I guess.