[NFP] AI disbanding its military

Ansive

Prince
Joined
Aug 22, 2010
Messages
388
EDIT: AI will disband units if they run out of gold (will sometimes happen while they set up their empire)


Why is the AI deleting its units?

I've noticed this for quite a while now.
I'm getting entire games where most of the AIs have close to no military strength.
All they manage do to is kill city states. (won't capture them due to loyalty pressure)

The AI is producing units but they are also disbanding them.
Their gold per turn is positive.
They are not at war.
I even disabled barbarians.

For example I started a game in the industrial era.
After some turns both Brazil and Scotland went down to 0 combat strength.
 
Last edited:
Do you have a save available which allows reproduing this? Without it very likely no one will be able to find out what is going on - and the chance for an offficial fix is zero then.
 
I've noticed something similar in that AIs combat strength will suddenly reduce to zero or close to it. I just figured that they had just been in a war. Next time I see it happen, I'll take screenshots.
 
I've noticed something similar in that AIs combat strength will suddenly reduce to zero or close to it. I just figured that they had just been in a war. Next time I see it happen, I'll take screenshots.

Same here, but since they are usually having some war with each other, or trying to conquer a city state, I figured that explained it. I will look more carefully next time.
 
I´ve seen it as well. From a huge military strength to zero in a few turns. I am playing with Historic Eras mod which add a gold to all unit maintenance so I just thought they went bankrupt.
 
I´ve seen it as well. From a huge military strength to zero in a few turns. I am playing with Historic Eras mod which add a gold to all unit maintenance so I just thought they went bankrupt.

This is not a new problem: I used to bankrupt the AI with Diplomatic Favor. Even if they had 0 Gold and 0 GPT, the next turn they had like 300 GPT and some pocket cash: the AI is programmed to disband all its military units once it bankrupts, not just a portion of it*. But somehow, it doesn't change its behavior: it will neither go for some Trade in order to get some spare change nor stop training new military unit even if it just disbanded all of them.

* : I wonder if the AI still believe that it can delete military units for Gold. Scythia / Venetian Arsenal were once overpowered because they could generate Gold faster thanks to Production cards and double units. Maybe the AI were once programmed to delete military units one at the time until it is not longer bankrupted. Since now military units do not generate any Gold when deleted, maybe it is selling all of it at once because the AI isn't going to face the "well I got enough Gold so I can stop delete my military" (at least: all of it which are sellable since damaged units cannot be sold).

I took me a long time to understand that: I was too quick to think it was a bug and believed that my action sometime doesn't substact to the Gold generation of the AI, or it could under/overflow the AI into crazy amount of Gold. In fact, it is just an exploit!
 
Last edited:
It happens to me all the time. I'll post a screen shot next time it happens. I thought it was the barbarians annihilating their militaries, but one person posted that it happened with barbarians turned off.

I'll post a link when I recreate it (I'll turn barbarians off just to see if barbarians are what is causing it).

The reason I thought it was barbarians is the new barbarians mod was not necessarily tested to see if civilizations could handle them. Presumably if it IS the barbarians that is effecting this, then tuning will happen in unannounced patches some time in the future.
 
Ouch; worrisome to read so many confirming reports :( Sounds like a massive issue for AI performance and likely especially hits them on lower levels (what is a pitty, as the game is overall more fun without the AI running away for the first half of the game because of starting boni...) It also unfortunately pairs well with their troubles to improve ressources. Be it luxuries or strategics: Neglecting them both costs them gold income directly (missed tile yields and potential for selling) and indirectly (need to purchase them). In case of strategics it might cause a viciuos circle - the spend gold to buy a strategic ressource, hard built a unit with it, lack funds to maintain it, disband and start all over again...
 
  • Like
Reactions: uhu
This is a fantasistorical city builder. I think it is about time that everyone stops pretending there is an AI in this game.
 
If you give the AI a deal they cannot refuse so they use all their gold, this gold does not include their maintenance so they do not have to delete units.... then a drought occurs or you pillage a lux ... they start deleting units.
I have seen many players say they always do this before war...
the AI does not seem to consider contingency money.
However I have not seen what @Ansive is saying but others have mentioned it.
 
Crazy how terrible the AI is. Just when you think it can't get worse you see a post like this.

Nothing like sending out my apostles and finding so many cities completely pillaged by the barbarians. Sometimes even capital cities. Or starting my attack on another civ late - just to see that they have exactly zero military. This makes it easy even for ME to attack :)

In the early game, I am thinking about how weak my military is - and I see that most civs have LESS than my meager forces, and the few that have more have JUST A TAD BIT more. And of course, warmongers have the weakest militaries of all ???

I attributed most of this to barbarian activity - and it would make sense that a warmongering civ would get the brunt of the barbarian activity since they are the ones with units running into the barbarian camps and drawing units to their borders (to pillage their cities and destroy their army). I hope this is correct, since that just means that Firaxis has one feature that kind of got out of control.

I used to do good in King, and not so good on Emperor. Now that I've learned to use the new version of barbarians to my advantage, I can get a pretty quick advantage on Emperor consistently. This is after a long delay. I don't attribute this to being more skilled - rusty would be more applicable. I think that the barbarians (or whatever this bug or set of bugs is) makes the game orders of magnitude easier.

The tech shuffle idea, which I think is absolutely brilliant, definitely slows down my own progress. I bet that this also slows the AI down by an even more significant amount (at least I now know to scout out 3 city states so I can find and beeline for Political Philosophy for a quicker change of government). So this could partially account for me finding Civ much easier to play these days.

I would also like to point out another ... feature that seems to have been added. If I play a warmonger type civilization, I am surrounded by empty territory and definitely no competing civilizations. Warcarts are useless if the nearest enemy city is 30 moves away - and that's if you know which direction to GO in. If I play an economic or religious civ, then I am surrounded by lots and lots of civs, completely boxed in unless I switch to attack mode and commit to an early attack. This has happened consistently enough that I consider this to just be a regular occurrence and to expect it. This is reversed of what would be ... fun to play.
 
Since it seems I generated some negativity I decided to do an actual test.

I started a deity game in industrial era with 11 AI and no barbs.
Used debug to reveal the entire map and played for about 100 turns.

All the AI started at about 500 strength.
2 or 3 of them lost their initial army due to gold issues in the early turns but eventually recovered (after building some commercial hubs and improving luxuries).
Most hovered at 400 strength, with a few going over 600 strength. A few wars occurred.

My initial complaint was wrong. I would say the AI seems mostly fine, they don't disband units for no reason.
It might be possible to cause the AI to disband their units by buying all their GPT and free gold.
To be honest they should be exempt from unit disbanding. (since they are really bad at managing their units against barbs and during war anyway)

Improvement rate was bad, maybe 1 or 2 builders per city.
I spied and they prefered infrastructure, military units and even city projects over builders!
They might as well periodically give the AI free builders at this point.
 
  • Like
Reactions: uhu
AI has less gold for some reason. That useless monopoly game mode makes it worse, as they do not improve anything.
 
Ok, so here is a possible reason why it's being noticed more now, especially (but not exclusively) with the new barbs.

Barbs are pillaging their gold making capabilities more now, so the AI civs run out of gold and then, as you pointed out, start disbanding their military to compensate. This would be consistent (but hardly proof) that the new barb feature makes the game easier as humans can learn to minimize the damage caused by the barbs, and can also be a source of cheap military units, lots of unit experience, and sometimes gold when I pillage their city before taking it back again and getting rid of it. I've also gotten some nicely placed city states a few times, and have also gotten good at getting other city states to take the brunt of their units. It sounds like the AI does none of this, or at least very little, while doing a poor job of defending against them.

And of course, once they start disbanding units, they stop having the ability to repel other barbarians going forward. This would also explain why aggressive civs have such low military strengths - they would most likely attract more barbarians to their cities (and also would lose more units that are just moving around and running into barbarians).

Thanks for testing this out :)
 
AI seems mostly fine, they don't disband units for no reason. It might be possible to cause the AI to disband their units by buying all their GPT and free gold.
The major Youtubers do this systematically all the time.
To be honest they should be exempt from unit disbanding. (since they are really bad at managing their units against barbs and during war anyway)
Would probably mean to cancel maintenance costs for AI player units completely. I'm actually uncertain, we have sufficient access to do this (ie. units being disbanded despite none maintenance costs and/or hard coded disbanding).

There is also a big psychological element: the human player drains AI's gold coffers on evil purpose. So I'm toying around an ECB approach (not ICBM, but Mr. Draghi's bazooka "... ready to do whatever it takes. Believe me, it will be enough.") in order to unlearn that exploit.

So how to shape this? (Finally a simple house rule could do it: "Just don't make the AI players bankrupt".)
I decided to do an actual test. [...] Improvement rate was bad, maybe 1 or 2 builders per city. I spied and they preferred infrastructure, military units and even city projects over builders! They might as well periodically give the AI free builders at this point.
Key question is probably, whether the AI players are able to properly use free builders (building improvements, repairing pillaged tiles), which are injected via Fire Tuner (or Lua script). (In the worst case they may just ignore or even disband them unused.)
 
Not sure if it would have an impact on the AI behaviour -as it sounds that the AI goes way beyond it-, but at least the automatic disbanding could be probably disabled globally fairly easy, as there is an entry in the GlobalDefines.xml:

<Replace Name="GOLD_NEGATIVE_BALANCE_DISBAND_UNIT_LINE" Value="-10" />
<Replace Name="GOLD_NEGATIVE_BALANCE_SUBSEQUENT_DISBAND_UNIT" Value="-10" />

I guess setting this to a greater negative value like -10000 could stop any auto-disbanding
 
Not sure if it would have an impact on the AI behaviour -as it sounds that the AI goes way beyond it-, but at least the automatic disbanding could be probably disabled globally fairly easy, as there is an entry in the GlobalDefines.xml:

<Replace Name="GOLD_NEGATIVE_BALANCE_DISBAND_UNIT_LINE" Value="-10" />
<Replace Name="GOLD_NEGATIVE_BALANCE_SUBSEQUENT_DISBAND_UNIT" Value="-10" />

I guess setting this to a greater negative value like -10000 could stop any auto-disbanding

That might probably do the trick.
And since in all the time playing I have never gone bankrupt, it would not impact me.

I'll try a game with that and monitor their army strength.


I try to sell all my spare resources every 30 turns to avoid the constant micromanagement. (epic speed)
If I ever need emergency gold I just sell strategic resources, diplo favor or trade GPT for lump.

I don't think I ever bankrupted an AI on purpose.
I also don't play with corporations, or if I do I start after Economics so the AI can improve their resources. (there is also a mod that fixes this)
Sad to hear that the AI handles the Barbs game mode poorly.
 
Not sure if it would have an impact on the AI behaviour -as it sounds that the AI goes way beyond it-, but at least the automatic disbanding could be probably disabled globally fairly easy, as there is an entry in the GlobalDefines.xml:

<Replace Name="GOLD_NEGATIVE_BALANCE_DISBAND_UNIT_LINE" Value="-10" />
<Replace Name="GOLD_NEGATIVE_BALANCE_SUBSEQUENT_DISBAND_UNIT" Value="-10" />

I guess setting this to a greater negative value like -10000 could stop any auto-disbanding
Any auto-disbanding, yes, but maybe not the AI manual disbanding if that's coded with a reference to the treasury value.

Worth trying.
 
Top Bottom