Ticket #42191

AIs Getting Tax-Locked (Tax 100%) Too Often (S3_0, civ2civ3)

Open Date: 2021-05-06 19:22 Last Update: 2024-02-09 15:43

Reporter:
Owner:
(None)
Type:
Status:
Open
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
None
File:
11

Details

Tax-locked is where an AI puts tax up to 100% and leaves it there for dozens/hundreds of turns.

A tax-locked AI does almost no research and is left behind in the game. If all the AIs remain tax-locked for 50 turns, the human wins without trying.

I don't know if the incidence of this has been getting higher over time, or if maybe I wasn't playing far enough into games to notice it, but it's bad right now. All 5 of the last 5 games I played, have ended with almost all AIs getting tax-locked. To give an example of what happens, I'll go through my last game.

This game has 15 players, me and 14 Hard AIs. By turn 100, 6 AIs are tax-locked. This has increased to 7 by turn 120. At turn 130, 9 AIs are tax-locked. By turn 139, 11 AIs are tax-locked.

During turn 139, I obsoleted Marco Polos, so I can only report on the AIs that I had hard-embassies with. So, in turn 140, all of the 5 AIs I could see were tax-locked.

Turn 150, all of the 9 I could see were tax-locked.

Turn 160, all of the 12 I could see were tax-locked.

Turn 170, all of the 13 I could see were tax-locked.

During turn 182, I got the last outstanding embassy and I can finally confirm that all of the AIs are tax-locked. During this turn, I am researching Miniaturization, while the AIs are researching Bridge-Building and Chivalry (those that have somewhat higher tech, bought or were given it by me (or stole it from someone I sold/gave)). The game is sooo completely over because of this tax-locking. And this is happening to me ever game (well, all 5 of the last 5). It's quite weird that nobody else reports this problem.

Interestingly, in turn 183, the Hungarians un-tax-locked themselves. They put a flimsy 10% into science. But this is too little, too late. Staying tax-locked for 60 turns has excluded you from the game.

I'll attach some of those savegames, in case you don't believe me.

Ticket History (3/48 Histories)

2021-05-06 19:22 Updated by: chippo
  • New Ticket "AIs Getting Tax-Locked (Tax 100%) Too Often (S3_0, civ2civ3)" created
2021-05-06 19:30 Updated by: cazfi
Comment

That has always been an issue with civ2civ3. At one point during 3.0 development reverting back to classic as the default ruleset was considered because of this alone, but we managed to improve a bit - maybe it just happens later in the game now.

2021-05-06 21:22 Updated by: cazfi
  • Resolution Update from None to Accepted
  • Milestone Update from (None) to 2.6.5 (closed)
  • Component Update from (None) to AI
Comment

Logically attached patches improve the situation (I plan to push them unless actual bad effects are detected), but only testing will tell if the improvement is noticeable in practice.

2021-05-07 06:29 Updated by: chippo
Comment

The patch doesn't seem to do much. The AIs are still falling into the tax-locked hole. Maybe a bit slower. But nothing bad seemed to happen. Things seem about the same, to a little improved.

2021-05-07 06:35 Updated by: chippo
Comment

As the AIs are getting cash-strapped, I would have expected them to drop their science expenditure slowly, like 40%, then 30%, 20%, 10%. But no! It's like 70% science to 0% science in one turn.

2021-05-07 17:43 Updated by: cazfi
  • Resolution Update from Accepted to None
Comment

Will move those patches to a new ticket, and keeping this ticket open for more effective fix.

2021-05-07 18:33 Updated by: cazfi
Comment

It's probably unit gold upkeep which is killing AI's economy. And I don't know if it even considers the fact about the governments when choosing which one to run. Looking at effects.ruleset (not documentation) it seems that Tribal, Communism, and Republic have no gold upkeep at all; Fundamentalism, Federation, and Democracy have double gold upkeep; rest have normal gold upkeep.

2021-05-07 18:50 Updated by: chippo
Comment

I dreamed about this issue last night. Why do I never see this issue in Normal or Easy, but hit it every time while playing Hard?

My tentative answer (worked out while awake) is that in Normal and Easy, the AIs have to follow the max-tax rules of the current government. Since the AIs (and I) follow the government sequence Despotism->Monarchy->Federation->Communism (max-tax 60%, 70%, 90%, 80%), they never are allowed to set 100% for anything.

As a human player, I would never set 100%. After you've hit Technology Upkeep (which I think is somewhere around Steam Engine), you have to put 10% into science in order to not lose some tech.

I propose an interim-fix, until we can work out what the correct fix is (we are trying to release 3.0 where civ2civ3 is going to be the default):

In Hard difficult, never allow the AIs to set tax higher than 90%.
I reckon that a correctly functioning AI might only really want 100% tax for around 10-20 turns around turn 80, while under Monarchy.

2021-05-07 19:02 Updated by: chippo
Comment

Reply To cazfi

Communism, and Republic have no gold upkeep at all

But in Communism and Republic you have to pay in shields?

2021-05-07 19:06 Updated by: cazfi
Comment

Reply To chippo

Reply To cazfi

Communism, and Republic have no gold upkeep at all

But in Communism and Republic you have to pay in shields?

That's not such a problem for AI (shield upkeep has been in all rulesets since dawn of time), and any way is a different issue from gold expenses going over the top.

2021-05-07 19:08 Updated by: cazfi
Comment

Typical output from a log message I added to function deciding AI tax rates:

100% tax rate for a balanced treasury (income: 38 expenses: 59, trade: 36)

2021-05-07 22:47 Updated by: cazfi
Comment

Reply To cazfi

Will move those patches to a new ticket, and keeping this ticket open for more effective fix.

-> #42195

2021-05-08 17:41 Updated by: alain_bkr
Comment

S3_0 beta1+

I have the same beahavior (all AI 100% tax stucked in early tech)

3.0 alpha4

I looked back to november game, and found a game where AI behaves much better , (except my allies who stayed weak since the beginning)

Allied :
  * Austria, monarchy,    148 gold, 100% tax ,   0% research democracy
  * Mongolia, monarchy,    27 gold, 100% tax ,   0% research finance

Ennemies :
  * Poland, federation,    25 gold,   0% tax,  100% research for advanced_flight.  (btw, it should be 90% max ?)
  * Thai , communism,     129 gold,  50% tax,   50% research Mass production
  * Sweden , monarchy,     30 gold,  90% tax,   10% research ingeneering  (transport and destroyer)
  * Portugal, monarchy,     4 gold, 100% tax,    0% research Leadership (dragons)   
  * Khmer, communism,      56 gold,   0% tax,  100% research Rocket (cruise missile, aegid ...) 
  * Persia, monarchy,      61 gold, 100% tax,    0% research feodalism
  * Holland, despotism,    12 gold, 100% tax,    0% research construction
  * Sioux , monarchy,       41 gold, 100%tax,    0% research university 
(Edited, 2021-05-09 17:09 Updated by: alain_bkr)
2021-05-08 17:55 Updated by: alain_bkr
Comment

(comment moved from #42195)

I have the same things in several recent games with 3.0 = All AIs are locked to 100% taxes very early in the game => boring easy win

I think that #42169 is another symptom. (AI builds tons of caravans to improve already very good trade routes like +8)

The problem may be : AI wants gold, nothing else, or AI spend too much and thus needs money ?

But for which use ? i prepared double irrigation around several allied cities (size 4 to 6 surrounded mostly by desert) , teached him supermarket, give him 5000 gold, and it does not build supermarket ! They bought weak units instead of buying improvements for all cities, do research, change government or something useful. They stay stucked to 100% TAX even when they needed several turns to spend all the money i gave them.

2021-05-08 18:08 Updated by: cazfi
Comment

Reply To alain_bkr

S3_0 beta2+

Where you get such a version number? I thought it was a typo when you mentioned it first time, but now you've mentioned it several times. The very latest development version of S3_0 is only beta1+. Beta2 is still a thing of the future (should be ready in a week).

2021-05-08 18:30 Updated by: chippo
Comment

Reply To cazfi

Reply To alain_bkr

S3_0 beta2+

Where you get such a version number? I thought it was a typo when you mentioned it first time, but now you've mentioned it several times. The very latest development version of S3_0 is only beta1+. Beta2 is still a thing of the future (should be ready in a week).

Next time you compile, add '--enable-gitrev' to autogen or configure, then when quoting your version, you just cut'n'paste it from Help->About-Freeciv.

2021-05-09 17:07 Updated by: alain_bkr
Comment

Reply To chippo

Reply To cazfi

Reply To alain_bkr

S3_0 beta2+

Where you get such a version number? I

Sorry i made a mistake

Freeciv version 3.0.0-beta1+

commit c7ddb47e46c9acc Date: Thu Apr 22 04:54:14 2021 +0300

I also play with AI_level = difficult

(Edited, 2021-05-09 17:12 Updated by: alain_bkr)
2021-05-09 17:20 Updated by: chippo
Comment

Reply To alain_bkr

* Poland, federation, 25 gold, 0% tax, 100% research for advanced_flight. (btw, it should be 90% max ?)

Nope. On Hard difficulty the AIs can spend as much as they want on anything regardless of government type.

2021-05-11 02:23 Updated by: bard
Comment

Right, this is a problem since I started working on civ2civ3 ruleset (freeciv v2.2). From my tests (I don't know AI code), I agree cazfi that it is mostly related to the gold upkeep of units, that AI do not seem to know how to handle.

I suggest to play the ruleset with "cheating" AI level (where AI can't bypass max tax rates), instead of "hard" level. As you already pointed, even "Normal" level is more challenging than "Hard", just because AI is forced to set at least 10% to science. Max rates were readjusted in this ruleset (up to 90), taking this issue into account.

2021-05-11 20:22 Updated by: cazfi
Comment

Reply To cazfi

And I don't know if it even considers the fact about the governments when choosing which one to run.

Indeed it will change to a government with higher unit upkeep factor without considering the upkeep.

Government want is formed from two parts; city want and want of other effects.

dai_city_want() has a comment: "Unit upkeep isn't handled here."

dai_effect_value() has EFT_UPKEEP_VALUE in section commented as: "Currently not supported for building AI - wait for modpack users"

2021-05-24 02:22 Updated by: bard
Comment

I remember to check the AI code related to tax rates a long time ago, and there was a code (I don't know if still there) that prioritizes gold over science when the AI is in a state named "on war footing", even if they do not need the gold right now.

I suspect the AI is in that war state more often in civ2civ3. With classic rules, AI uses Republic and Democracy more often, and the has_senate effect limits the amounts of wars. In civ2civ3, Republic does not has senate, democracy is hardly used by the AI, and it is harder to conquer a city. As result, most AIs are continually at war, spending lots of resources to create units that die without capturing any city, and they seem to maximize gold when they are in this state.

In my tests (with 2.5 and 2.6), when I give has_senate to every AI, or I give them a high value of AI love (100 or so) so they are mostly at peace, the tax lock problem seems to disappear.

(Edited, 2021-05-24 02:23 Updated by: bard)
2021-05-24 02:38 Updated by: chippo
Comment

Reply To bard

In my tests (with 2.5 and 2.6), when I give has_senate to every AI, or I give them a high value of AI love (100 or so) so they are mostly at peace, the tax lock problem seems to disappear.

Well done! I've checked many savegames, now, and the tax-locked AIs are always at war with at least one other player. This is, in my opinion, the biggest bug in S3_0 and I foresee that it will be solved soon. Yay!

2021-05-24 03:00 Updated by: cazfi
Comment

When I first checked the code for this ticket, I too first considered war_footing to be the reason. However, on closer inspection of the code it seemed that war_footing is set much less time than one would assume from the name (besides, I think there has always been never-ending wars going with classic ruleset too - AIs attitude towards the other gets only worse when it suffers casualties). I'm not saying it can't play a role, but neither am I totally convinced that it's the reason - still believing unit upkeep to be the main reason.

2021-05-31 04:06 Updated by: bard
Comment

Reply To cazfi

When I first checked the code for this ticket, I too first considered war_footing to be the reason. However, on closer inspection of the code it seemed that war_footing is set much less time than one would assume from the name (besides, I think there has always been never-ending wars going with classic ruleset too - AIs attitude towards the other gets only worse when it suffers casualties). I'm not saying it can't play a role, but neither am I totally convinced that it's the reason - still believing unit upkeep to be the main reason.

Ok, good to know.

There is something related that I have always wondered when designing rulesets: If the output bonus to science from scientific buildings is lower than the output bonus to gold/luxury from financial buildings, does it encourage the AI to prefer taxes to gold over science?

I mean, if most cities receive a +100% to science, and +200% to gold, from buildings, could it worsen the tax lock problem of AIs? civ2civ3 rules reduce the bonus from libraries/universities/labs compared to freeciv rules. From my tests, I have not seen evidences that it could be affecting the AI, but I'm not sure. If it does affect, maybe the ruleset could be improved by increasing the output bonus to science (compared to gold) given to cheating/hard AIs.

2021-05-31 10:57 Updated by: cazfi
Comment

Earlier discussion in hrm -> https://www.hostedredmine.com/issues/694778

2021-06-02 23:10 Updated by: cazfi
2021-12-10 08:05 Updated by: cazfi
2022-04-13 20:18 Updated by: cazfi
2022-06-11 21:49 Updated by: cazfi
2022-08-05 08:55 Updated by: cazfi
2022-10-07 09:14 Updated by: cazfi
2022-12-07 02:29 Updated by: cazfi
2023-02-02 06:31 Updated by: cazfi
2023-04-04 18:29 Updated by: cazfi
2023-06-25 19:40 Updated by: cazfi
Comment

We should check situation with this again, after the AI fixes that are in 3.0.8.

2023-11-10 15:39 Updated by: cazfi
2024-02-09 15:43 Updated by: cazfi

Edit

Please login to add comment to this ticket » Login