Game does not end!!

Bugs should be reported at https://savannah.nongnu.org/bugs/?group=glob2
This section is read only for reference.
Locked
FelixO
Posts: 4
Joined: Fri Jul 20, 2007 9:15 pm

Game does not end!!

Post 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
FelixO
Posts: 4
Joined: Fri Jul 20, 2007 9:15 pm

Fix

Post 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 :-)
User avatar
Donkyhotay
Warrior
Warrior
Posts: 141
Joined: Sat Mar 04, 2006 4:03 am

Post 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
do not be afraid to joust a giant just because some people insist on believing in windmills.
Lexen
Worker
Worker
Posts: 8
Joined: Thu Feb 28, 2008 6:54 pm
Location: Grand Haven, Michigan
Contact:

Didn't end, but does now

Post 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?
My Machine: Ubuntu 7.10 Gutsy Gibbon, Globulation2 Version 0.9.1
User avatar
Giszmo
Warrior
Warrior
Posts: 261
Joined: Sat Nov 26, 2005 10:23 pm
Location: Germany
Contact:

Re: Game does not end!!

Post 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.
Locked