As a French person I feel like it's my duty to explain strikes to you. - AdrienIer

Create an account  

 
AI Maintenance bugs and problems

Found something pretty shocking today. Or a few of them.

Tons of inconsistencies on AI handling of maintenance.

AI decisions (tax and farming)
This is using the maintenance multipliers for everything EXCEPT buildings which insecticide disabled. (I never knew, omg!)

AI loss of stuff to maintenance
The AI cannot lose units or spells to maintenance at all. Exception is the Time Stop spell.
Used to be all global enchantments lost if at exactly zero mana left at the start of the AI's turn, but insecticide removed that (since it is obviously wrong, both the timing and how it checks actual mana crystals instead of income, maintenance might be still payable!). The AI never had the capability to lose city spells or unit spells or fantastic units this way however :
Instead, the AI willingly disbands all units they assume they can't afford during their turn. So in theory they would never run into the upkeep problem on units anyway - yes this also means they'll rather lose all their units than to cancel enchantments, that they are incapable of.
This disbanding is done using the calculations that include the AI maintenance multiplier, except the buildings which insecticide removed (see above, it's the same change affecting both)

AI maintenance payment
This is where it gets nasty. The AI pays the full upkeep just like the human player. Except for the part that nothing can desert if there isn't enough. It just leaves the AI at 0 gold or mana.
As far as I can tell this means, once the AI has an army they can maintain using the AI multiplier, but not if they were human, they'll be eternally stuck at 0 gold, or worse, mana crystals. I haven't seen the latter yet (summoning so much stuff without being able to afford the cost is unlikely) but the former I see frequently in peaceful games, AI players sitting around with 0 gold for many turns.

I just checked with tweaker, and AI with 33 mana income (45 power, 75% on mana production), and only 5 casting skill, gained a mere 5 mana crystals when I pressed end turn, having a Great Wyrm and some ghouls in play and not attacking anything so it wasn't spent in combat (added the wyrm with tweaker on turn 5) but on maintenance. The active maintenance multiplier was 30% so it was supposed to pay less than 10 mana on maintenance but paid over 20...the full cost of the units and spells it had.
So the above bugs are confirmed.

Not sure what to do here. I guess at least the actual payment for units and spells should include the cost multiplier, but what about buildings? Keep it disabled or restore pre-insecticide functionality?
Also this will make the AI a LOT stronger. I mean, this is, like, a huge boost to their income, one that was supposed to be there but...happened to be missing all the time lol.
Reply

After fixing the above, I observed the AI to have much larger amounts of gold and mana in treasury. I didn't observe too significant speedup in expansion or research though that doesn't mean there isn't any, I just didn't notice since it's subjective. They seemed to rush buy or hire mercenaries a lot more though. I feel the impact of the fix on gold is much larger, fantastic unit maintenance is not too high (since there are a more limited amount of them), but gold maintenance on units and buildings is a lot. The leftover effectively acts as an extra bonus production, but probably nothing that could compare to the huge bonus they already get on that, so the overall impact might not be as large as I expected.

Where it does make a big difference : diplomacy, tribute will need more gold to use, and they will also pay more to the player since they have more in their treasury.
Reply

(June 21st, 2016, 20:02)Seravy Wrote: After fixing the above, I observed the AI to have much larger amounts of gold and mana in treasury. I didn't observe too significant speedup in expansion or research though that doesn't mean there isn't any, I just didn't notice sthe computer players already have enough gold and mana, they don't need more. ince it's subjective. They seemed to rush buy or hire mercenaries a lot more though. I feel the impact of the fix on gold is much larger, fantastic unit maintenance is not too high (since there are a more limited amount of them), but gold maintenance on units and buildings is a lot. The leftover effectively acts as an extra bonus production, but probably nothing that could compare to the huge bonus they already get on that, so the overall impact might not be as large as I expected.

Where it does make a big difference : diplomacy, tribute will need more gold to use, and they will also pay more to the player since they have more in their treasury.
Reply

I think they should lose some bonus resources if they're gaining more resources.

"Supposed to" is pretty subjective. There was a bug and people in charge of how many cheating resources to give them just kept giving them more until it felt right.

The solution worked without having to know the bug existed at all. IMO Either leave the bug in or find a way to reduce the bonuses so that ai incomes are still mostly the same. (except in the fringe cases where the ai falls apart.)


In my games the ai never has 0 gold. That said I never check the ai's gold when the ai only has one city because I don't care how well they're doing, I'm about to kill them. I reckon fixing the bug will be a big boon to AI players who are doing badly and might help them stay in the game and not get killed by other ai's or even the player.
For ai's that are doing well 300% bonus is more than enough to make up for not getting their upkeep discount. Heck why even bother to give someone an upkeep discount? it makes no sense. If I give you triple the salary I don't also have to give you a 50% off sale. Which is one reason I'd almost say not to fix the bug. Or well. Fix the actually bugged parts of the bug. Just reset the AI's bonus to maintenance costs to be 100% equal to the players. If they can summon 3 times as much as me they don't need to be able to support an army 9 times as big as mine. Summoning 3 times as much and keeping 3 times as much sounds reasonable to me?

That way they don't get stuck on 0gold but also don't get an even bigger resource lead than they already have on high settings?
Reply

Crazyness.

Yeah, he'll certainly have to make other adjustments to compensate for this once he's figured out how much of an effect it has.
Reply

Some more findings :
-AI can raise taxes, but never lower them.
-AI decides to raise taxes if their gold income is lower than (turns*1.5), not if there is low enough unrest to do it
-AI can only set more farmers, never reduce them
-AI assumes each new farmer will provide 2 food, even if they don't, so units might starve
-Town data is not refreshed between these changes and when the units are checked and disbanded, so even if more farmers were set, the units still die...but due to the above next time they will survive since extra farmers remain.

Seriously, how did this even work...oh yeah they got 400% of everything so they did fine without raising taxes and hard to lose units to starvation when a farmer produces 8 food but you still require many of them because minimal required farmers does not consider AI food bonus...even though the "minimal" farmers also produce extra food thus more than the town actually needs.
well, lol.
Reply

Wow, that's insane. Bugs offsetting bugs, and hacks kludging around bugs.
Reply



Forum Jump: