Possible Firaxis Bug Which Causes An Infinite Loop!

Shqype

Shqyptar
Joined
Nov 15, 2005
Messages
2,468
Location
New York + Shqypni
I believe I have just uncovered a bug in CIV4 (BTS) which causes an infinite loop. Bhruic's patch does not address this, so I'm hoping he will investigate this issue and pick up on it, to fix it in a future release of his.

First I will explain the circumstances under which this occurs. Although I've noticed it in TAM, this could happen in any mod, and I strongly believe it has something to do with code in the C++ files.

Two factions (the Tartessians and Iberians) go to war with each other. A Tartessian stack of a Javelineer and a "sapper" unit approaches an Iberian city. The Iberians send out a Slinger to intercept the Tartessian stack; the Tartessian Javelineer is destroyed, the Iberian Slinger is now on his defeated foe's tile, in addition to the Sapper unit. The game then goes into "infinite loop mode," where the AI is apparently attempting to do something over and over again, but fails, and doesn't stop trying.

I can Ctrl+W to open the Worldbuilder, but I can't edit anything. I can load an old save, but I can't advance to the next turn.

What is significant about the Sapper unit is the following: it is <OnlyDefensive> and <Invisible> (plus Mechanized, but I doubt that makes a difference). It has a UNIT_AI of ATTACK_CITY, instead of acting like a spy.


I finally found out how to get past this "infinite loop." Open up the Debug Menu by pressing Ctrl+D, click on the Game tab, and select the option "Reset Unit Movement and Combat." The result? The Tartessian sapper moves from the tile now inhabited by the Iberian Slinger back into its home territory.




My thoughts: some Firaxis bug that has to do with movement. The Sapper appears invisible and Can Only Defend, and for some reason when an enemy moves onto its plot, it (probably) tries to move away but cannot and is trapped, resulting in an infinite loop, or the AI repeatedly attempting to do something that it cannot.

Since Bhruic has undertaken the crusade to fix all the errors and bugs that come with the vanilla BTS, I'm hoping he will investigate this and fix it.
 
NOTE: When I go in and change the Sapper unit to be visible with the tag <bInvisible>0</bInvisible>, when the same sequence as above occurs, the Sapper is destroyed and the game progresses without a problem.

Again, this shows there is something wrong with the code governing unit movement for an invisible unit when its tile is occupied by an enemy.
 
Top Bottom