World war weirdness and infinite loops

Eater of Dreams

Chieftain
Joined
Dec 12, 2007
Messages
6
Background: Sheaim/Marathon/Huge/Permanent Alliances/18 of 19 civs alive. The year is 1077, the AC is in the high 60's. The two largest blocks were one consisting of me and my vassals Hyborem, Cardith Lorda and Beeri Bawl, and one consisting of Flauros/Rhoanna and their vassals Kandros Fir/Sheelba/Basium(!), Falamar, Keelyn and Sabathiel. Hyborem had a Defensive Pact with Flauros/Rhoanna.

I was happily minding my own business (read: building up forces for an assault) when the world war broke out. The war announcements don't always come in the logical order, but the war must have started with Basium declaring war on Hyborem (and me), as he is supposed to. This brought in all his team mates, and, AFAIK, his masters and their other vassals. What happened then, is that Flauros/Rhoanna declared on everyone declaring on Hyborem and me, including themselves. As a result, all troops in Flauros', Rhoanna's, Falamar's and Bannor's territories who belonged to those players were expelled and relocated to different tiles (can't occupy the same tile as an enemy, even one of the same nationality). Many of those troops showed up right outside my borders, but I could handle that. Strangely, this didn't happen to Keelyn (vassal of F/R). Other civs were also brought into the war by DPs and vassal agreements, and every civ is now in multiple wars.

Now I am unable to continue the game because one of the AI's get stuck in an infinte loop. I have tried to use WB to find out what is causing it, so far without success. I have however seen the empty cities of Hippus and Calabim, leading to my understanding of what happened.
 

Attachments

  • Civ4ScreenShot0015.JPG
    Civ4ScreenShot0015.JPG
    229.6 KB · Views: 251
  • Civ4ScreenShot0016.JPG
    Civ4ScreenShot0016.JPG
    191.3 KB · Views: 178
  • Civ4ScreenShot0020.JPG
    Civ4ScreenShot0020.JPG
    225.3 KB · Views: 228
damn, why don't i ever have mass wars like that, looks like fun

as far as i can see, the game crashed/hung up due to the top entry in that event log: 1 team member declaring war on the other. Don't have a clue how it happened though :crazyeye:
 
I loaded this and set the ai players to peace and the loop didnt occur, so I think you are right that the self-loathing is responsible for the spinlock. But I dont know why the self-loathing occured.

It might have something to do with forced war declarations and defensive pacts (ie: i have a defensive pact with you and then I delcare war on you and now according to my pact i have to declare war on myself). I'll check it out.
 
I loaded this and set the ai players to peace and the loop didnt occur, so I think you are right that the self-loathing is responsible for the spinlock. But I dont know why the self-loathing occured.

It might have something to do with forced war declarations and defensive pacts (ie: i have a defensive pact with you and then I delcare war on you and now according to my pact i have to declare war on myself). I'll check it out.

Thanks for looking into it. I have attached the autosave from the previous turn in case you want to review the various treaties that caused this.
 

Attachments

I really appreciate the save from before the war declarations. Thats exactly what I needed. There were a lot of strange war declarations that could because I didnt have any vassal logic in the process. Im not going to have the warscript ever push vassals into battle.

I played it through and you don't encounter your spinlock. This will be fixed in "shadow". Thanks for the info (and noticing that leaders were declaring war on themselves, that was key).
 
Cool.

I wanted to continue my game, so I tried editing the python files myself. I don't have any experience with python, so needless to say there was much trial and error. I ended up with the following changes to CvEventManager.py:
Code:
	def onChangeWar(self, argsList):
		'War Status Changes'
		bIsWar = argsList[0]
		iTeam = argsList[1]
		iRivalTeam = argsList[2]
		[B][U]iVassal = argsList[3][/U][/B]
		if (not self.__LOG_WARPEACE):
			return
		#if (iVassal) :
		#	CvUtil.pyPrint('Hallo')
		#	return
		if (bIsWar [B][U]and (not iVassal)[/U][/B]:
			strStatus = "declared war"
		else:
			strStatus = "declared peace"
		CvUtil.pyPrint('Team %d has %s on Team %d'
			%(iTeam, strStatus, iRivalTeam))
Underlined and commented parts are mine (I originally managed to get the commented if block to work, but stupidly deleted a part I thought was unnecessary. Now I am unable to reconstruct it. Lesson learned: comments are your friend.). Now the war does not happen, while vassals still follow their masters into battle if I start any. Unless you think my changes could cause other problems, I'm going to leave them like that until "shadow".
 
So this is caused by missing vassal logic? I ask because my last game locked up when Ethne and her team mate declared war on themselves. I took vassals out for the current game and haven't had the problem again yet.
 
Your vassal actually had a defensive pact with someone? That is really odd. In my current game I had a defensive pact with Cardith Lorda, but it was cancelled the instant he became a vassal of Arturus Thorne (and no wars were declared based on that vassalage either). The option doesn't even come up any more.
 
Vassals shouldn't be able to declare war, sign peace or enter defensive pacts on their own, but always follow suit whenever their master does any of this - and only then. Vassals should have no direct say in any agreements to do with war.
 
There is indeed something weird with Hyborem's DPs. They do not get canceled when one of the parties declare war, only when one declares war on the other. I was also only able to sign an one-sided OB agreement with him.
 
Back
Top Bottom