I was reading an article over at TAGN (which I do often – and I’ve linked to him quite a bit recently so not linking that post directly today – may be accused of over-linking!!) The article is his play through of Civ 5 with friends online and what happens to their strategies when anyone drops and the computer AI takes over. Basically its a gong show with little consistency with what the AI chooses to do after you leave. You would think (well that may be a bit presumptuous – I think) that it would be sensible for the computer controlled AI to watch what moves you have done over the past x number of moves, and continue along the same course – if you tend to work with countries on things through diplomacy while beefing up a ground defense, it wouldn’t make sense to suddenly divert all of your resources to build a navy now, would it? (hint: something like that did happen to him. It didn’t make sense to me.) After reading through his well written article and my personal experiences with Civ 5 it dawned on me that the AI programmed there is probably preset by ruler and attached to current units/research tied to what year it is. So, when you drop from the game, the computer AI completely ignores what you felt were sensible moves and immediately reverts to its core thinking regardless of current state.
That feels like poor programming to me. That is immediately what I thought. Then I pulled a great big “WHOA NELLY!” and thought what in the hell do I know about programming AI – hell, programming in general? (yes, I think in italics.)
Turns out very little. I can’t imagine trying to program an AI for a game that complex. For games such as World of Warcraft you would expect the average AI to be pretty simple.
Spawn. Stand there until one of three things happen
a) a player character walks within X units of you (aggro radius)
b) you are hit for damage from a player character
c) you are idle for x minutes so path somewhere.
In the event any of those happens, the AI is also simple enough to imagine –
a) chase them for x units – if you reach them start attack sequence, -if you don’t then reset
b) move x units to player character – begin attack sequence, or
c) walk to coordinates.
I don’t even know if this is how it works but it makes sense to me. And it also feels like the type of sensible “if-then” arguments in programming.
So programming is easy peasy! Seriously though, imagine the layers and thoughts and concepts being building an AI capable of being a fair challenge in a game that has so many complex options, moves, ideas, player skill levels and the like. Imagine the investment that would take to make that game engaging and make the AI make sense. Obviously a bit more than Sid was willing to invest.
But fear not, gentle reader – for I HAVE programmed a computer based AI! It was for a math based game 23 years ago in Turing, in high school. (does that even exist anymore? Turing?). There were three difficulty levels and it was pretty easy to code – The hardest level, aptly named Satan, was perfect. It would calculate every possible remaining move on the board and always make the right move to win, recalculating every possible move every time. If you played a perfect game against the AI (Satan) – AND had the first move, you would win. If you made one mistake or he had the first move, you lost.
The second level (Einstein)Â was based on the same formula, but had a 30% chance to choose any move BUT the right move. I programmed in human error.
The third level (Gumby), the easiest, was based on the perfect game formula but only had a 30% chance to make the RIGHT move, making a wrong one 7 out of 10 times.
Of course that is incredibly basic but the theory was there was always the opportunity to have a challenging game. Einstein or Gumby could go on streaks and make the game fun, and due to the chosen percentages if you weren’t very good at the game there were different options to enjoy it. This, at a most basic and root level, a math game on an 8 x 8 board. (I also tried programming in background music in Turing, but that is a completely different story).
The point of this entire post and the way I want to end this is twofold:
1) A newfound appreciation for programming gaming AI, and imagining the complexity and vision behind programming for that that must be required. If anyone has any insight on this I would love to hear it!
2) A curious question – has anyone gone up against GOOD gaming AI in the past – and if so, where, and why was it good?
I don’t ever recall feeling like gaming AI giving me a fair run for my money but I bet I am missing a big one or two out there that have.
If you want to analyze some good MMO AI, I would recommend checking out ESO, which has some pretty interesting Mob behavior going on.
Having taken some formal AI training, I can tell you almost every game is going to opt into some form of Finite State Machine (if-then branches). For your traditional two player board games, you can develop a minimax algorithm to solve, but it only fits well into a very small subset of games (perfect information, alternating turn, finite (and optimally small) move count)
Makes you wonder just what EQNext’s revolutionary AI is going to be like doesn’t it? He said, ironically.
A long time ago I read an interview with developer that I wish I kept a copy of because I often want to refer to it and I’d like to be able to give a citation. I suspect it was either Mark Jacobs talking about DAOC before or just after launch or it was someone from SOE around the same time.
The gist of it was that (even then) MMO devs were perfectly capable of programming much more sophisticated AI but they had to avoid doing so because players hated it. Players like to feel they are smarter than mobs not the other way round.
I have very clear memories of the difference in “smartness” between the mobs in DAOC and those in EQ back in 2001. I can even remember specific mobs we would avoid because they seemed able to outhink us. I can’t say I’ve run into any mobs that smart since.
I tend to cite the Halo games for having exceptional AI. Sure, some of that was scaling given the difficulty, but I do think the series did a great job of providing AI that was reactive and aware enough to take advantage of the environment at hand.
Especially when it came to Elites picking up stray weapons on the ground when their own was compromised!
@kodra I was pretty amped for WildStar so I skipped ESO, and after my 3 months with WildStar I think I have to accept I won’t get the value from a sub game. Life is hectic. That being said, I’ll keep an eye out for an opportunity to try it (free trial, F2P conversion, what not.)
@Murph looking forward to the new Halo game (that has all the halo games combined, if I recall correctly?) I played the first couple when they first came out but missed the bulk of the series. That will be a fun one to play through start to finish.
@Bhagpuss: First off, sorry – you were stuck in my spam queue! I barely check that. I think a strong AI may be a nice differentiator in the future. Something has to be! =)
WordPress is doing something weird. I just posted on Keen’s blog and I think that has gone to spam too. On the other hand, my comment on your WildStar post went straight through. Did I spell my name wrong? That can cause problems.
No clue. It was odd, having it there sort of randomly. I don’t check the spam queue often and was weird to see a poster not selling Michael Kors handbags stuck in the filter =)