Woah, this looks slick! I had no idea this existed.
Now I kinda want to have a poke at this Civ AI business. Or at least look at the code so I can get a better idea of how the AI is implemented and why it's so bad.
Edit: that is, assuming this version has similarly bad AI to the original.
Mostly because the AI isn't able to really strategically "plan".
Most of the work goes into iterating over all units and giving each an action based on certain metrics. Thus coordinating units and strategy isn't really present.
Now with some work you could add a higher level planner system. Vox Populi, a Civ5 mod, has done some really clever stuff with organizing units into formations for battle.
Makes sense. Only game AI I know intimately is chess AI, so my intuition is to do minimax tree search(like alphabeta). The implementation is tricky though because there's multiple moves. And likely the branching factor is far to high for alphabeta to be helpful.
I think Monte Carlo methods might be more promising. Maybe with some simplified gamestate, allowing you to modify it more cheaply, reducing the overhead per node. "Computing a turn" can take a long time in late game civ5. Probably a lot of probabilistic stuff is needed to get it cheap enough. Like you could have credences based on current information about which win condition is most likely for each civ. Then you could feasibly decide what the long term goal should be.
Kinda feels like a cognitive architecture(like soar) is necessary to get anything even resembling decent play.
It's sort of hard to have an intuition of what kind of heuristic search is feasible without having some idea of the branching factor, though.
Really the simpler answer is have a planning layer that can influence the lower agent decision weights.
Top level AI is going for Domination Victory? Higher weight on making Military Units at your Cities. Pick a target and weight movement of the army towards it. Etc.
Yes, this type of thing is what I was alluding to qt the end of my 2nd paragraph. I was sort of thinking it over as I typed and that's where I sort of ended up. You need some sort of coarse grained planning like that. Or I guess the technical term is hierarchical planning?
Pick a win condition. Science.
Ok, what are the subgoals you want for that? You want growth, first and foremost. And you want to get to plastic asap. How do you get growth? Improve food tiles tiles, research civil service and chemistry, spec into tradition, unlock more caravan. Which of those are more worthwhile? Chemistry kinda conflicts with getting to plastics faster, and so on.
Sort of feels like some sort of SAT problem. Which isn't great news, I admit.
I need to read more papers and maybe have a peek in my Russell & Norvig because now I can't stop thinking about this.
Having played a good number of hours of Unciv myself as well as Civ V, the AI is indeed similarly bad. Their meta-strategies are largely one-trick ponies making them trivial to predict. Harder difficulties just wildly tip the resource scales in the AI's favor without improving their decision making at all.
Now I kinda want to have a poke at this Civ AI business. Or at least look at the code so I can get a better idea of how the AI is implemented and why it's so bad.
Edit: that is, assuming this version has similarly bad AI to the original.