Civ 5 AI

Been ages since my last post – definitely appears that I have given up doing the top coder problem analysis for a while – I’ll probably get back into the swing of it when this year’s comps start up again….

So I’ve been playing a bit of Civilization 5 – I played the original a bit and some of the intervening editions but I was never the addict that many people I knew were. Civ 5 has several things about it which I like a lot better than previous versions, but the AI is not one of them.

I’ve been slowly working my way up the difficulty levels – finding that they weren’t that hard. I know I’m not a very good player when it comes to these games, but I won my first game on each difficulty level up to emperor (excluding the games where I quit in the first 50 turns because I inadvertently taunted the AI and it decided to steam roll me with units early on – while I stupidly had no army or defence).
It took me a couple of goes to get Immortal difficulty level, in the end I explicitly chose a map that was large with only 4 players, ensuring I had room to work with at the start before the AI found me, time for a half decent strategy to catch up with the advantages given to the AI at the beginning. In pretty much every game at these high difficulty levels I did the science victory because I am no good at the war side of the game (despite the AI being even worse, at high difficulty it has a lot more units), and can be converted to diplomatic or domination victory if it becomes problematic. On Immortal the space race was very close, I had to pay other countries to attack whoever was going for space victory in order to slow them down that little bit extra I needed to win.

So when it came to my first deity level difficulty match (the highest difficulty level), I decided I wanted to try something different. I had done a single city culture based victory on the easiest difficulty level for one of the achievements, and I remember that I won quite early on in the game. So I thought maybe that would alleviate some of the problems with the science victory approach as I would be done before the AI. I also wanted to minimize tweaking of the game parameters since it feels a bit like cheating, choosing options which you know you are good at, or the AI is weaker at. So I decided the standard Duel size on the standard Continents map should be acceptable – At least I wouldn’t start next to the AI, but small map so I wouldn’t have much room to grow and the AI would likely turn up and smack me fairly early on. Random opponent and I chose India for myself since its good for a small number of large cities which the cultural victory type favours.

In the end I didn’t end up finishing the game any sooner than my science victory on immortal difficulty level, indeed the culture victory took me longer. But I won all the same – my first game on deity level – no retries, nothing.

I built a single city. I had intended on building maybe 3, but the duel map was even smaller than I expected, there was only really room for 2 large cities on my ‘continent’ and there was a city state taking up a few squares at one end, so I decided (at the time fully expecting to lose imminently) to see how I went with a single city.
I focused on culture buildings (obviously!), but with a single city expanding quickly you quite easily keep up with the technology tree so there wasn’t much thinking involved in choosing what to build next – I basically just built everything. I had a couple of units to explore, which quickly showed the map had no shallow water to the other AI, and 3 city states within my reach. I quickly grabbed 2 to ally level, but the AI got the third, spending alot of money on it, made it beyond my means to get ally with immediately. As the game progressed, my single worker upgrading tiles as they became available and me raking in money, production and having such a high happy rating that I was in a golden age more often than not, it became apparent that I was doing okay, but not that great. Cultural victory was definitely going to take longer than the Immortal AI would win a science victory. The AI I was playing against this time was the French, who get a cultural advantage and early on looked highly likely to be ahead in that respect, as well as being far, far ahead in science, and based on the trading screen having enough money to buy all of the city states off me 4 times over. Not to mention I had a single city defended by a single unit, no walls and the AI had an army capable of destroying a 20 town continent with a half decent army.

So it did indeed look like I was going to lose, as I had thought all along. But as the game went on, the inevitable ‘the French have built the Apollo program’ or ‘united nations’ or ‘has declared war on you’ just didn’t happen. Indeed I almost built the united nations myself, since by then I had amassed enough money to steal the city states away from the AI and the AI didn’t attempt to use its huge reserves of cash to fight me for them. (As an aside my single city with its 4 friends and certain cultural policies was almost generating science as fast as my first failed attempt at Immortal difficulty level where I had a dozen towns – just a sign of how badly I play really…)
Finally, I just sort of won by default. I kept playing after game over to see what the AI had in mind – and ~40 turns later it built the UN and purchased all of the city states in an aggressive fashion. Up until that point I assumed that I had just had a lucky run and ended up with an AI who had decided to try and win on points (the AI had a huge score), but losing on points at turn 500 is a sure sign you weren’t actually trying to win… but here lies the problem.
As far as it can be determined it seems the AI picks a single strategy and sticks to it. There doesn’t appear to be any comparative evaluation to decide which strategy is most likely to result in victory at any given time. The game is slow enough as it is, the original Civ ran on ~386?, and the game logic doesn’t seem to have really become that much more complicated. Even when you switch from the 3d graphics to the old 2d display Civ 5 chugs on a moderate size map in the late game, the large maps are quite painful. To think how it would be with real strategic evaluation … horrifying. But without it a game is mostly about luck of the draw as to whether the AI will use a strategy you are terrible against, or one which is practically useless. Without the dynamic strategic evaluation there is no real challenge, no competitive force which helps you improve. You increase the difficulty level because half the time its too easy, but then half the time you get a game which is too hard given you’ve never learnt how to cope with the AI’s strategy.

Anyway, enough rant, I guess I’ll go play another round… 😛