Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
AI Unit Upgrade Anomaly

Here's an interesting little cheat the AI has going ...

First, Mecca in 1948. Note the 6 Infantry guarding the city.
[Image: saladinpremecca9ax.jpg]

Then in 1949, an interesting thing happens ... those 6 Infantry are transformed into Mechanized Infantry.
[Image: saladinpostmecca0wl.jpg]

Seems pretty simple. The AI had just discovered Robotics and had paid to upgrade its units. Right???

[Image: saladincashflow4gk.jpg]

Nice deal. At minimum, 8 visible Mech Inf upgrades for a total of 20 gold and 3 gpt. (I don't show the other two, but they occurred in a city I was bombarding.) In fact, the 20 gold was likely a map purchase and the 3 gpt difference most likely arose due to differences in the tiles I was stepping on during my attacks. So the AI are upgrading units for "free".

This is not an isolated incident. This is at least the 3rd time in this particular game I have seen the AI upgrading units for "free", and at minimum the 5th time I have noticed it occurring. The occurrences were over at least two patches (can't remember whether the first time I saw it was in 1.00 or 1.09) and multiple civs/maps/eras.

Neither of the other two AI had a change in their amount of cash between these two turns, so Saladin did not get the money from someone else.

In 1950 Saladin had 250 gold (I took ~200 by razing one of his cities) and 5 gpt. So this is not some bizarre research/production/trade turn order artifact.

Deep thoughts on what is actually occurring in the next post. wink
Reply

First I'll state something odd: I do not think this is a bug. Instead, it's an undocumented feature. tongue

The AI cannot be programmed to intelligently upgrade units. Just think about how the human decides whether to spend money on upgrades. Off the top of my head, the logic might look something like this: I'll upgrade units if my neighbor is aggressive, unless he's at war with someone else at the time, but then only in my border cities, especially if the upgrade is to my UU, but taking into consideration the troop mix my neighbor has to prioritize which unit types to upgrade, realizing that I may want to not upgrade units that have promotion capabilities the upgraded unit can't have (City Raider Rifles?) ... Unless I'm at war. lol Try to put that into a simple equation! lol

So the AI can't know when it would be wise to stop research and run high cash for upgrades. It also can't be trusted to have a lot of cash laying around either, because those clever human players would always be willing to sell them a non-military tech on the cheap to ensure the AI has outdated units. So what to do ...

I see two potential mechanisms that could be at work here:

(1) The AI is allowed to buy upgrades on credit. Fairly simple to program, when the AI discovers an upgrading tech, it receives xxx gold now, payable in gpt for a fixed number of turns. The AI then just does its usual adjustment on the science slider (max with positive gpt) accounting for the payment. Self-adjusting for difficulty level since the upgrade costs are reduced for the AI. If this were occurring we might see spikes in gpt when the "loan" expires out-of-sync with a tech discovery.

(2) The AI has a cash slush fund that the human can't see. Every turn some fraction of taxes (say 10%) are held in reserve. When the AI wants to upgrade it uses these funds. You could skew this on higher difficulty levels by allowing the slush fund to earn interest, or giving the AI a bonus on the gold put into the fund. This wouldn't produce hiccups in the tech rate, which might be noticable in scheme 1. Also fits with the AI occasionally having outdated troops, as the AI may not accumulate slush funds quickly enough to do two sets of upgrades in rapid succession. If it were allowed to borrow money that shouldn't happen.

Of course, the game could also just be giving the AI the slush fund money for free each turn. rolleye

So ... has anyone else noticed this? Or know what is really going on?
Reply

I don't know, but it would be an explanation for why the AI always seems so thorough about its upgrading.
Reply

McClure Wrote:So the AI are upgrading units for "free".

No, they're not. (If they were, they'd upgrade their entire armed force the instant they get a new tech, and there are plenty of examples to show that this does not occur.)

You may not be aware just how deep are the discounts they get, though.

[Image: upgrade-costs-ai.gif]

If you're playing on Monarch on Normal speed, it only costs them 21g apiece to upgrade Infantry to Mechs.

You're right that it is so cheap as to be an area where the AI is given clear advantage (even on Settler!) and you are pretty much right about why. This is not "undocumented", however. You can open the XML for yourself at any point, and see what's going on with most of the game settings and rules, and this fact is not only documented but heralded. There is no conspiracy.


- Sirian
Fortune favors the bold.
Reply

Quoth I: So the AI are upgrading units for "free".

Sirian Wrote:No, they're not.
Yes. Hence free being in quotes. smile

Sirian Wrote:There is no conspiracy.
Nor was one ever alleged.

Interesting bit from the discount table: Not only does the AI pay 20% of list for upgrades on Monarch, they have a cost factor of 0.95 for units. Meaning ... cost to upgrade an Infantry to a Mech should be 0.95*0.2*105 = 20 gold (keep the change). Exactly the amount that Saladin's treasury was depleted. Of course, he actually needed about 300-400 gold to upgrade all of his units (160 for just the visible).

Hmmm. Looks like two possiblities:
(1) This is a bug, and the AI is only being charged for the first upgrade.
(B) The AI retains a second treasury for upgrades.

Strongly lean to the latter, as I've seen other examples where the AI's visible treasury doesn't change at all after the upgrades. After leading with the sledgehammer of discount, it would only require a few % tithe for the AI's to have enough money on hand to (almost) always upgrade their units. So long as the money isn't falling out of the ether, it's fair (and probably necessary).

It just looks really fishy during the game. splat
Reply

If the AI is smart enough to turn research down (like we are) to earn money between turns just for the purposes of upgrading. Then he could have earned +400 gold and then he needed 420 to upgrade the units. so to you he appears to only loose 20 gold.

I dont know. but the trade screens show a specific word in 1.52 that got me thinking, "Available". 440 gold Available for trade, 7gpt available for trade.

I dont know. just my thoughts
"It's not about the XP, it's about the experience!"
"You see that civ you beat up, yup, thats me!" - I said it!
Logic Problems
Reply



Forum Jump: