[151.9] Giant AI Bug

In the game I just started (152.2, Pangaea Plus, Empreror), I notice the following, maybe it helps:

On turn 68, the tile yields of the AI seem to be in the normal range, I don't see anything special.
All diplomatic AI's have low capital population (Gandhi 3, Sejong 3, Harun 2). Too low for their surroundings. Gandhi expanded (but will get eaten soon by Catherine), and Harun probably took the liberty settler, Sejong is still at one city.
All militaristic AI's fare very well (Darius 8, Catherine 7, Harald 8 in a very hilly environment).
Of the "neither" AI's, Suleiman doesn't do well (one city 4 pop), but he got rushed hard time by Harald and his terrain isn't favourable anyways. Washington however had 4 cities up in no time and a capital of 6.

I play as Genghis and I gotta say, the 3-move-scout at the start is much fun. But it was very easy to get the wonders (but I added additional ones from the Wonder Pack and changed the wonders up a bit to test them).

So, might the bug have something to do with the militaristic-diplomatic distinction?

PS: btw. is it normal that all city states have the exact same number of population (4) on this turn?

EDIT: On a second look, apparently Arabia has been sending one settler after the other unprotected into Barbarians...
EDIT: And I confirm as well that 50 turns later the capital sizes have normalized and Gandhi still hasn't been conquered, rather, he now keeps on founding cities and gaining score. Something changes between early turns and later on...
 
How are you checking the production of those cities?

Arabia has been sending one settler after the other unprotected into Barbarians...
I wish I knew how to change this. It's part of vanilla; tougher barbarians in vem make it more visible. I suspect it has something to do with MultiUnitFormations.xml and the MultiUnitFormation_SlotEntries table, and tried a few things, but nothing's worked so far. I asked around once in the main modding forum but no one knew for sure. I might try again.
 
On turn 68, the tile yields of the AI seem to be in the normal range, I don't see anything special. All diplomatic AI's have low capital population (Gandhi 3, Sejong 3, Harun 2). Too low for their surroundings.

EDIT: On a second look, apparently Arabia has been sending one settler after the other unprotected into Barbarians...

EDIT: And I confirm as well that 50 turns later the capital sizes have normalized and Gandhi still hasn't been conquered, rather, he now keeps on founding cities and gaining score. Something changes between early turns and later on...

My anecdotal experience is that diplomatic civs seem to expand less - even presumably expansionist ones like Arabia.

Lost settlers are a factor, and probably so is the purposeful reduction of early AI expansion.

That the situation reverses somewhat later in the game is also pretty much universally confirmed. Are we sure that reloading is what triggers the change, as opposed to something else? An argument in favor of reloading is that the kick start seems to come at different points.
 
also I didn't reload ;)

Unfortunately, I only "checked" the production via the tile yield, as I said I was primarily toying around with the modified wonders...
 
I'd like to help out testing this when I start a game Wednesday.

The last 2 6-7 mod games have been non-challenges. The AI is basically lifeless even in deity with my custom extra 10% boosts in handicaps.xml.
Rome seems to still have some strength, but via unit overproduction and conquering cities.
Are we still using Infoaddict and Fire Tuner?
What's the latest way to get an inside look at the AI.

My first suspicion is that the AI is filling the specialist slots and not using terrain improvements. This would explain the tiny cities.
I notice that once my cities have walls, libraries and granaries, the specialists slots take priorities over terrain features with much better yields. They seem not to prioritize growth.

In previous VEM, I don't believe the AI would buy these buildings quickly enough to stunt their growth. Instead, they could only use specialists after 50 or so turns of construction.
 
Are we still using Infoaddict and Fire Tuner?
What's the latest way to get an inside look at the AI.

My first suspicion is that the AI is filling the specialist slots and not using terrain improvements. This would explain the tiny cities.

Check the thread called "The Tuner."

I don't think slot abuse is the problem. It's evident before there are slots to be filled.
 
The only sure way to check the AI bug I've found is the Have Fun mod - the Tuner might be resetting the yield library (though I'm far from sure about that). It will be immediately obvious - production, science and culture will be around 1/4-1/5 the correct amount.

Specialist slots may be a reason for smaller AI cities in general, but that's a different topic and unrelated to the bug. I did notice when I used the tuner to autoplay that the AI does seem to like to fill all specialist slots for no good reason (is there any sort of modifier or flavor for this, Thal?), even in small cities.

Thal - Can we force the AI's yield library to update every turn? It's a heavy-handed approach and would probably increase turn times, but might be worth it until (if?) we find and fix the bug.

Update: Started a game on 152.6b and noticed the Persian capital only had two citizens at turn 38. I used HF to swap seats and saw that it was building a settler - which was going to take 30 turns to complete! When I went into the city, the production reset before my eyes, dropping the turn count to six.. Rome appears to be growing/producing normally and has planted it's Liberty settler successfully.
 
The only sure way to check the AI bug I've found is the Have Fun mod - the Tuner might be resetting the yield library (though I'm far from sure about that). It will be immediately obvious - production, science and culture will be around 1/4-1/5 the correct amount.
I suspect that mod uses the vanilla functions, not the civup functions, so its information is probably not reliable.
 
Vanilla uses a convoluted mix of functions to check a city's yield rate:
city:FoodDifferenceTimes100()
city:GetCurrentProductionDifferenceTimes100()
city:GetBaseYieldRate(YieldTypes.YIELD_GOLD)
city:GetBaseYieldRate(YieldTypes.YIELD_SCIENCE)
city:GetJONSCulturePerTurn()
happiness is missing
Civup uses one centralized function:
City_GetYieldRate(city, yieldID)
Mods like infoaddict display information with the vanilla functions, so they are not aware of changes made in civup like distributed citystate yields. I was trying to change to the city:method() format in v148.4, which would let other mods use civup's data more easily. I ran into some problems and had to put it on hold. Without access to the game core it's difficult to do (but theoretically possible).

There's a way we can figure out if it's actually the yield library causing a problem, or if the "ingame editor" is simply reporting incorrect numbers. I'll add output of the civup yield library to the tuner's "selected city" tab. If the yield library works fine, then our problem is simply poorly-weighted AI priorities, which should be easy to fix.
 
I've noticed rates readjusting more often lately. These tend to be turns until a tech is researched, where one panel says one thing and then another says something different (and ultimately accurate). I don't know if there is a link to the older issue of late-game slowdowns in the research and culture counters (which make it hard to micro-manage).
 
Ah, I think there's a misunderstanding of what Have Fun (not Ingame Editor) does - I'm not using a function like you describe, I'm using the "take seat" feature of HF which isn't available in any other mod (IGE has a stunted version of this, but you can't actually look inside cities). Not surprisingly, I'm not sure how the mod works, but when switching back to my civ I get the same popup that appears in Hotseat, so it *may* be using a different method of switching seats than the tuner. But I could be wrong, this is all quite mysterious to me.:lol:

Deep Blue, the mod creator, describes what it does here:

Unfortunately the built-in function ChangActivePlayer do not allow you to take full control. I mainly use it to check info on the AI and to see inside cities.

What can you do with take seat:
- You can give movement order to units but they will move after you switch back to original civ and click next turn.
- View their cities
- Change Production
- Buy Buildings / Units in city screen
- Sell Buildings in city screen
- Manage citizens in city screen

All Edit functions (Add gold, resources, units....) work with AI players, and you can apply changes without switching.

All I'm doing is looking inside AI's cities, viewing the yields displayed. I have to assume these are VEM's yields, the yields shouldn't change from this action.

@Txurce, I've noticed a few anomalies this game as well.
 
That might actually be revealing hotseat bugs, not yield library bugs. Anyway it doesn't matter... I'm writing up the tuner changes so we can check this information directly and reliably. :)
 
Excellent news. I've attached screenshots of the bug in action (finally!) - the first shows a "most productive civs" popup while I was playing as Askia, revealing that Korea has a ridiculously low .26:c5production:/turn; the second shows Seoul after I switched into Korea immediately after, the settler is due in 13 turns; the third shows inside Seoul, the settler is now due in the correct 6 turns (and the fourth is just funny - I love it when Sejong hides behind his throne!:lol:).
 

Attachments

  • prod1.jpg
    prod1.jpg
    295.9 KB · Views: 95
  • prod2.jpg
    prod2.jpg
    440.3 KB · Views: 88
  • prod3.jpg
    prod3.jpg
    219.1 KB · Views: 87
  • Sejong_lol.jpg
    Sejong_lol.jpg
    318.2 KB · Views: 110
It's not perfect, but I've got a yield display working. In v152.7 click the + button next to "menu" on the top bar. It prints a list of all city yields to lua.log and the tuner.

Code:
TopPanel:  Food  Prod  Gold   Sci   Cul City                 Player
TopPanel:     1     5     3     3     9 Persepolis           Darius
TopPanel:     0     1     4     2     2 Pasargadae           Darius
TopPanel:     7     3     2     2     2 Beijing              Wu Zetian
TopPanel:     7     3     2     2     2 London               Elizabeth
etc...
 
I played up to turn 135 and haven't encountered the bug (in any obvious way) except the two times I mentioned above when the AIs were building settlers. The AI was not especially competitive, however - there's one civ ahead of me in SPs and most of us are on a level wrt tech.

When I wrote the OP, every AI city was severely gimped in almost every way, and did not fix itself when I entered the city - this bug is annoyingly (or thankfully) inconsistent.
 
I'm starting to think it's not a bug, but just poorly-assigned AI priorities. I've been adjusting those priorities each version since I made the big change a week ago. Some recent changes were:

  • Much higher growth priority for cities of 4:c5citizen: or smaller.
  • Purchasing growth buildings checks from smallest to largest city, instead of vice versa.
  • Ditto with production in cities building a wonder.
Changes along these lines should improve the issue of tiny AI cities, and AIs under-competitive for wonders.
 
Back
Top Bottom