yairm210 / Unciv

Open-source Android/Desktop remake of Civ V
Mozilla Public License 2.0
8.55k stars 1.58k forks source link

AI Worker spam and inaction (Mod) #12371

Open prod0ad opened 3 weeks ago

prod0ad commented 3 weeks ago

Is there an existing issue for this?

Game Version

4.13.19

Describe the bug

It's at least a mod problem. Not sure this if is a real issue with the main game, but fixing it might enhance the AI anyway.

The AI occasionally constructs or captures way more Workers than it needs. It might end up with almost (or even) all of its units as Workers. Say two or three dozen of them with 4 or 7 cities.

Goes negative in gold. Won't disband them. Won't repair improvements either. Just moves some of them around each turn, some even outside it's borders. Then some Barbarian comes in for fun side effects; hordes of Barb Workers moving around. In such an occasion, I just observed: AI losing 2/3rds of it's 30+ Workers to Barbs, orders all cities to train MORE WORKERS (and has no military)!

Maybe there should be a cap to desired AI Workers, like 2 per city? It shouldn't prioritize them so much over military units anyway. Then no clue on why it won't even use them.

I'm also thinking it might be the lack of some options confusing the AI. For example there's no water units at all added yet.

Btw I think the high ram usage issue I mentioned earlier happens often (and only?) during long spectator games. Related to the many turns happening fast in a short game session?

Steps to Reproduce

Should need the mod, too lazy/unready to upload for now, want to reach a better state then replace the old Ancient Total War mod.

Screenshots

No response

Link to save file

No response

Operating System

Linux

Additional Information

No response

prod0ad commented 3 weeks ago

I think the issue has to do with the AI going bankrupt. For some reason it seems to think it needs more workers at that point.

EmperorPinguin commented 1 week ago

Modifying the number of workers needed based on game turn might be a solution to this.

EmperorPinguin commented 1 week ago

The AI not building enough military water units is a separate problem.