Sunday, September 26, 2010

Cruddy AI

I have been playing a lot of Civilization V (or CiV as the internet prefers to call it) and for a lark I wandered around the internet looking for reviews of the game.  I have found a few small issues with the game mostly in the tooltip department but still feel like the overall experience is excellent.  However, I wanted to find out if others saw the same things I did.  The reviews I found suggest that the reviewers have a very tenuous grip on the realities of computing and programming and expect things that make absolutely no sense.  One guy in particular complained that he was managing his empire, just chilling out, and a huge force showed up on his border and smashed him and this was not fun.  Well gee, a game that you can lose by playing badly?  Who would have thunk it?  Try scouting, or diplomacy, or building your own damn army you tool!  Since when is "I am bad at this game and lost" a negative point about a game?  The reviews tended to focus on how good the overall game experience feels and how slick the new combat system is but came down hard on the AI, complaining that it did all kinds of terrible things and made the game not fun.  The part I found most amusing was that their complaints seemed to primarily revolve around the idea that the AI wasn't doing what they wanted it to do.

See, here is the thing:  When you are in a game with an enemy AI and it declares war on you, you have *no idea* why that happened.  Maybe it got paid off by another AI to attack, maybe your army was small, maybe its behaviour was simply programmed to be extremely aggressive, or maybe it noticed that you were in a winning position and figured the best/only way to prevent that was to attack.  The only thing the player knows is that the AI attacked and because that is usually bad for the player the player goes on the internet and complains that the AI is stupid.  Some people complained about 'irrational' behaviour like making a big attack and then when it fails, offering the player a huge bribe to secure a peace treaty.  Aside from the possibility of never attacking, this sounds like the best possible strategy to me.  Sometimes you attack and lose and are in a bad position and offering peace with no bribe is going to get you laughed at - when I am ticked off at an AI I will only accept a peace offer if it comes with a ton of stuff attached.  The other option is to just stand there and eat the counterattack and probably die, so bribery sounds pretty good!

People also seem to have completely bizarre ideas of how powerful an AI can be in this sort of game.  Some people seemed to think that we could just code up AIs so skilled that they would never need a handicap and could provide even the best possible human players a stiff challenge.  Hint:  Even though a computer can beat the world chess champion, chess is *much* simpler than CiV and we are running this on mediocre home computers and expect the computer's turn to take 1-3 seconds.  Even if we could code up an AI that would actually be as good as a expert human, which we cannot, it couldn't possibly run in reasonable time on the machines it needs to run on.  The fact is that just because an AI didn't do what you wanted or what you think it should from your very uninformed perspective doesn't mean it sucks, and making one as good as everyone seems to think it should be is completely impossible.


  1. The AI is terrible. The fact that it would be hard or impossible to make it better doesn't mean it isn't true.

    In the game I just finished Greece attacked me early. They took out two of my cities, one really close to them and one really far away. I snapped back and retook my close city. My army marched on my far one and I sent him a message demanding he give it back for peace. He said no. I ended my turn and at the start of my next turn he offered me his entire treasury, tons of gold a turn, every good he had, and every single city he had.

    I took no actions between the two negotiations. All I did was end my turn. I had 3 military units and 3 cities. He gave me 4 cities and everything of use he had. I was going to get my city back in a couple turns. Pushing on _maybe_ I could have taken the rest of his cities after many, many turns, but I was at war with other nations so probably not. I just wanted Spockland back.

    I can see the logic for saying no to giving me my city back and fighting it out. I can see the logic for overpaying me to leave him alone. I just can't see saying no to 1 city and then massively overpaying later.

    The AI is also bad in how it tactically positions its units and I can abuse that to no end. That's the sort of thing I can understand, though. I can figure out its heuristics and then adapt to them and it can't do the same to me. That's 'terrible' but acceptable AI. The silliness with diplomacy though is just nonsensical.

    (For the record, taking all his cities at once almost cost me the game. My civ became very unhappy and the 33% combat penalty was brutal in my other wars. The 50% construction penalty made getting out tough, too.)

  2. I gotta say, giving you 4 cities seems ... insane? That sounds like a bug and not so much like a general strategy problem. In a game where you have a handful of cities it hardly seems like they intended the AI to give up 4 in a single negotiation!

  3. I have also never had an AI offer me a city, they sometimes tried to get peace by giving me some cash or access to luxuries, which seems very reasonable, but never a city. I think giving of cities should really be saved for the most extreme of circumstances.

  4. It was every city he had except his capital. This basically meant he stayed in the stone age forever. (He'd settled everywhere around him and then gave them to me so he couldn't expand again.) Many, many turns later I sent a max level cavalry after him, killed his hoplite, and took over his last city.

    It's gone the other way too. I've asked for peace when I was 'losing' and they demand most of my cities in response. The AI in my game just seems to think giving away cities is a good idea despite the fact it's actually bad for both sides. (I'm pretty sure burning cities you conquer to the ground and resettling if you like the spot is superior in most cases.)

    Maybe it's a difficulty thing? I'm playing on the middle one (prince I think).

    I also think it 'cheats' or has bad decision making leading up to and during wars. It'll build a ton of units (more than seems even slightly feasible), stick them on my borders, and attack. After it attacks it won't build any more units. If I can kill the attackers then I always have a clear path into their territory to take whatever I feel like from them. I either lose the game from an invasion or get half their empire in response. (And then only because I have to pull back to defend some other idiot's massive influx of invading dudes.) The first game I played I lost because I didn't pull back fast enough and ended up losing too many of my real cities with happiness buildings. An empire of very unhappy puppets doesn't get very far. 8P

  5. It happened again. The Germans were spreading over the whole continent building a bunch of small cities and pounding out their cheap unit. They wiped out two civs and turned on me. I had one musketeer when they declared war and trivially took one of my 3 cities. My other 2 cities just made musketeers and I pretty quickly overwhelmed his smaller units and took Spockland back. I asked for peace. Turn after turn he demanded my 2 non-capital cities and all my other stuff for peace.

    I slowly and methodically started wiping out his cities in response, burning them to the ground. He stopped even offering peace for all my stuff, refusing to talk, as he sent another wave of stuff at Spockland. I had units this time so he didn't get it back. I took his capital and he gave up. His offer?

    12 cities, all his money, and all the goods he could throw at me. He basically ceded all of the American cities and all of his own cities on my border to get me off his back. I took them all, shot to -70 unhappiness or something similarly ludicrous and burned them all to the ground.

  6. You broke the AI! I have been in lots of rough situations and when I climb back out and put pressure on the AI offers me some luxury goods and some cash to secure peace but never a city. I have never seen a city on offer and when I try to ask for one I get rejected. I don't know what we are doing differently.

  7. Stylistically I tend to run with no military at all and just build up when attacked. I'm also playing on Prince difficulty. I never initiate interactions with other players unless I need luxury goods and tend to go with whatever anyone suggests to me.

    Not sure what else could be different between how we play.

  8. I always run a small military and build up for attacks now and again. I never have a military anywhere near as large as the AIs do, as they often run 20 unit armies with 5 cities. I usually have about 1-2 units per city but with enough science and money emphasis that I always have the best tech so I can beat them even when badly outnumbered.