Good AI vs. Fun AI

Dave Mark on March 11, 2008

This article was written by Dave Mark, CEO and designer at Intrinsic Algorithm. Let him know what you think and post a comment below!

Playing to Lose

With this week’s discussion, I am tapping back into the outflow of the 2008 Game Developers Conference. One of the lectures, “Playing to Lose: AI and Civilization,” was given by Soren Johnson, the lead and AI programmer on Civ 3 and 4. The main premise of the lecture was that there exists a spectrum ranging from “Good AI” to “Fun AI”. (Read my notes from the lecture.)

“Good AI”, according to Soren, is one that is designed to take the place of a human player. It is meant to play as well as possible, using all the same tactics available to a human player. In fact, this form of AI is most likely to appear in symmetrical games – where all players are in similar roles and maybe even using the same units. We can measure the AI’s performance through specific metrics of score, ability to win, or any other objective mechanism. In theory, it is meant to be able to pass the Turing Test — at least in the framework of the game. His example of one of the most pure types of “Good AI” was that of Chess.

Good to Fun

On the other side of this range is what Soren termed “Fun AI”. In this case, the point of the AI is simply to provide something entertaining. That’s it. His token example was “Desktop Tower Defense”. The entirety of the enemy AI is pathfinding. All the enemy units are trying to do is move from one side of the map to the other (but they do it in a menacing way!). The game experience is based on the player trying to prevent them from doing so.

We aren’t expecting much out of those enemies. They aren’t using our tactics or even our units. As such, any performance has to be measured strictly by our own ability to play rather than the ability of the AI to challenge or defeat us. The only test of the AI is subjective based on how much entertainment value it provides. And of course, such a lack of even an attempt at performance means that the Turing Test doesn’t even apply.

Playing To Lose [1]
Soren Johnson
Game Developer’s Conference 2008
Download ZIP (7.5 Mb)

In Practice…

Having defined these theoretical bookends, Soren proceeded to spread various games across this spectrum. Starcraft was tilted more towards the “Good” end, Heroes of Might and Magic V was on the “Fun” side. Using the criteria that Soren laid out, most games could be arranged on this continuum. Of course, he placed Civ 4 right in the middle. Much of the rest of the lecture addressed design decisions that they made in order to facilitate that blend of “good” and “fun”. And that is where I started feeling something was wrong.

Good vs. Fun

Is There Something More…?

While I appreciated what he was trying to convey, there was something about this approach that didn’t sit right with me. Perhaps it was simply the semantics of the word choice that bothered me. I refused to admit that “good” was necessarily the polar opposite of “fun”. I can honestly say, for example, that I have often thought that a game was not “fun” because the AI wasn’t playing well (i.e. “good”). (Imagine playing a Chess opponent that uses a similar approach to the AI in “Desktop Tower Defense”… I can’t see how that would be fun at all.) The crux of the matter is, in Soren’s definition, being “good” and “fun” is not possible. Obviously, this is not exactly what he intended to convey.

Soren is not the only one who has broached this subject, however. I have personally been involved in plenty of discussions with other game designers and AI programmers about exactly this issue. Often, there is one side whose arguments reduce to the dogmatic tenet:

“We are not in the business of creating smart [good] AI, we are in the business of creating an entertaining [fun] experience for the player.”

But is that necessarily true? Are these ideas necessarily mutually exclusive?

Diplomacy in Civilization 4

Can We do Both?

In the past, the creed expressed above was sometimes a smoke screen for the fact that AI programmers had to “cheat” in order to create the coveted “illusion of intelligence”. We couldn’t even approach creating smart/good/realistic AI — since we were going to have to fake it anyway, we obviously had to focus simply on making it “fun”. That was our only charge at the time. Lately, as processing power has increased, so have the expectations of the abilities of the game AI. Ironically, depending on the game genre, it is now becoming harder to fake the expected level of intelligence without actually building that smarter system. So where does that put us on Soren’s “good vs. fun” scale?

This brings me to my discussion topics for the week. Is it possible for an AI to be both “good” and “fun”? What are some examples of this? What are some examples of where a “good” AI would not be “fun?” Would it be better if this graph had been done on two axes rather than one? If so, what would this look like? “Good vs. Bad” plotted against “Fun vs. Not Fun?” Most importantly, are we as game developers – designers or programmers — shorting ourselves and our players by holding to the premise that good, realistic AI does not make for an entertaining experience? Or maybe it’s just that our approach to solving this problem is flawed?

I certainly hope that this discussion will be challenging [good] — and yet still be “fun” to talk about. Let’s hear it!

Discussion 10 Comments

Andrew on March 11th, 2008

I think Soren is mainly correct - that the words are wrong are perhaps the biggest shortfall. For instance, Desktop Tower Defence, as an example, cannot have any real AI. It is more the lack of AI which makes it fun... In the same sense, certain RTS games have "fun levels" where the AI is non existent - they either are attacking the player (and so come in waves...duh, me no think that a good plan boss!), or are being attacked (so need to stay defensive and die, rather then attack and kill the player). In games without perfect knowledge, ala chess, some non-good AI techniques need to be used. Anything from "guessing", to using memory of sorts, to fuzzy logic on what to do. You'll never have a RTS AI play as good as a Chess AI due to the fact, like humans, they can't see everything and don't have perfect knowledge of the play area. It might be more there is a 2 way axis, with "AI" and "No AI" on one axis, and "Lots of information" and "Little or no information" on the other axis. You can aim to make any of the AI's in the scope - all of them can be fun of course! (Which is where Soren falls down. Good chess players wouldn't want to play against a Desktop Tower Defence AI!). Civilization, for instance, has a variable amount of information, but never are the entire map or all enemy forces revealed. Chess is a [i]de facto[/i] perfect knowledge game. Down the list you'll find Simulation games (near-perfect knowledge about self, terrain and competitors, eg; Transport Tycoon), RTS and TBS games (FOW is the main barrier to knowledge), FPS games (multiplayer levels or no, your knowledge about the level's contents is limited to your memory and what you can see or hear directly around you, although some include maps), then perhaps down the list is even more limited games - Battleships, for instance, a classic game which you have total FOW. Or Poker, where aside from mathematical percentages, you know a limited amount about what cards are played, what is available, and who has betted what. On the "AI or no AI" side, it entirely depends on the game's aim. It has nothing to do with "fun or not", since generally, there is entertainment anyway. Some games don't need to give the AI any information at all. Sonic the Hedgehog's enemies simply act as barrier to slow the player down, their AI is limited to "Player on screen? Run towards them!" most of the time. This is considered "fun" - compared to those things coming at you off screen, or setting ambushes intentionally! But FPS games generally tend to having autonomous AI's - if they didn't, it'd be awfully easy to play for starters! They should at least know how to take cover, aim, and move around the level to find the player, lest they just run past them. Going with "No AI" can work in some cases - on the rails shooters, for instance, require entirely scripted "AI" due to the nature of the game (and in this case, the amount of information is high - the AI always knows where the player is at any given moment, of course!). Then if the AI is ever helping the player, there needs to be AI there to do a good job, else the player will get frustrated (Escort missions, I'm looking at you). This is difficult - the amount of information about what the player intends to do is very very low, so requires either additional player input or "guesswork" far beyond what an NPC squad would need. In these cases it's easy to see - if the AI is the adversary, rather then the gameplay, it tends to be on the "Some AI" axis (such as most FPS's, timed jumps are not needed ;) ), but if the gameplay (such as Sonic's) is the main difficulty element, it tends towards "No AI". It can mix it up however - Civilization itself combines managing yourself a lot (gameplay difficulty), with having AI's with and against you through the game (AI adversary), so is somewhere in the middle of that definition. So, how about a 2 axis approach? I could cite examples of all the extremes, and make a diagram, if this wasn't clear :) but I've rambled enough! It could even have more axis elements - as noted on the slide, the game being symetrical or fair, multiplayer or not, unlimited/limited tactics...I think a single axis approach doesn't work with so many elements (I think information is a major player however!).

alexjc on March 11th, 2008

Hi Soren, Thanks for dropping by! It should make a great discussion. Your talk really got me thinking about this topic, and it's surprising how many decisions are made under the assumption that "good" AI is what's required. For example... [LIST] [*]For individual soldiers in shooters for example, developers have gotten increasingly used to not "cheating." So any omniscient information is frowned upon... yet sometimes it makes the AI worse. [*]When building multiplayer AI, just having the concept of two factions opposing each other is very centric on "good" AI. A fun AI instead would assign squads to go and entertain the player, give him something to snipe (or whatever he's chosen to do).[/LIST]It really does require a radical rethink of most approaches, and it's an important thing to get the team to agree on beforehand! I can see this as a possible source of conflict too... Alex

Dave Mark on March 11th, 2008

Wow. It didn't take long for you to drop by, did it Soren? Less than 2 hours? I hope that you stop back to see my contrition at not being clearer. I didn't mean to say that your lecture - and even the concept - were not relevant or inspired. In fact, I enjoyed it a lot. If you listen to the GDC roundtables, I even invoked your name a few times! However, my goal here was not to argue against your point but rather to expand on it somewhat. Also, given that this is the Discussion column, my surreptitious intent is to stir up a little... er... controversy. I want to give the readers something to talk about. As I mentioned above, I believe that it was the semantics of the word choice that disturbed me somewhat. That is why I proceeded to mention the ubiquitous discussion in the industry that seems to imply that good AI and fun AI [I]are[/I] mutually exclusive. To me, that sort of mindset amongst the AI crowd will only serve to hold us back. On that note, I AM quite pleased that you have managed that blessed sweet spot with Civ 4. I have to admit that I played Civ 2 for around 10 years, skipped over 3, and am currently beating my head against Noble on Civ 4. It IS challenging - and, at least for me, THAT is the reason that it is "fun". In fact, you can expect a Post-Play'em writeup over at my site pretty soon. I would love it if you busted off an email to me about some of the things that are really holding me down! But, as you said in your lecture, if the player loses, at least teach them why! For that experience alone, I thank you. Again, we are glad you stopped by Soren. (Did you create a message board account? We would all appreciate your wisdom in the forums!)

Jon S on March 12th, 2008

I think that this is a very thin line to try to define. For me I think that good/fun AI is something that challenges a player, wins occasionally but isn't an impenetrable opposition that can never be concurred. To achieve this state is not easy and is dependent on many different things already mentioned like is it multiplayer or single player. It also needs to be able to scale appropriately to the player as he grows and becomes better himself. The same thing happens when it is two player characters playing against each other for the most part an equilibrium is reached where it is challenging for both to win. For a single player game it might not need to be the all knowing bot, but rather making sure that each encounter is challenging and not impossible. It also needs to make sure to give the player a break from action from time to time. I have heard that the Left 4 Dead game is doing some type of event/scenario manager to handle these type of issues that could come up with multiple enemies attempting to hinder your path. So I guess to sum up my point you need to be able to scale the difficulty, either by difficulty settings, or controlling the number on enemies the player has to deal with at any given time to provide a challenge for the player but not put in an impossible situation with no way out.

Andrew on March 12th, 2008

I sure did ramble a bit. I'll cut it down next time, haha. Fun and clever AI ftw! (anyone can build an unbeatable FPS bot, but who can make a fun one? :D Unreal 3 really fell down since it was too damn accurate. Curse it, UT2004 was fun, UT3 isn't as much :( )

Dave Mark on March 12th, 2008

The example you gave about the enemy flanking you is a common one. Everyone uses that particular example - especially to drive home the "audio/visual feedback" premise. I believe that it is also potentially flawed. It is becoming obvious over the years that many people prefer the online (i.e. human v. human) play of our games to that of the solo (i.e. vs. AI) experience. One of the common tactics - and therefore occurrences - in online play is to flank the player, snipe from behind, etc. One of the reasons for the popularity (and even existence of) that tactic is that it is what humans would tend to do in "reality". Why? It is intelligent and it works. As AI designers and programmers, we eviscerate that mentality from our own agents. Why? People continually complain anecdotally that our agents don't act intelligently - "not human". Statistics also show that people prefer to play against real humans if possible... shunning the experience of playing against our AI agents. So, the conclusion could be that players prefer what humans do to what our AI is doing. Could this possibly be connected to the fact that we are continually plodding along with the mantra that "we can't use XYZ because players don't find it 'fun'" despite the fact that human players/enemies actually DO use XYZ? It's just something that continually seems contradictory - and I wonder if anyone is checking the premises on which this mentality is based. (This is starting to look like a topic for a future discussion column! "The Great Flanking Debate!")

Jare on March 13th, 2008

I disagree with two of your generalizations, Dave: - While online is certainly growing, there's a lot more to it than "people prefer to play against other people." Coop is slowly getting the spotlight it deserves, thanks to games like Gears of War and Halo. And even in MMORPGs, the online experience is again about cooperating (groups, raids) and also about participating in economies and, to a certain extent, in a community. - Just because people enjoy playing against other people, doesn't mean that they will enjoy AIs behaving similar to humans. Player vs player games tend to take the shape of equal vs equal: two players of comparable skill / abilities, or two balanced teams. Even in asymmetric games where one team defends and the other attacks (or protect the VIP, etc), the game encourages teams that are fairly even. Single player, on the other hand, excels at 1 vs many experiences and also at scripted and puzzle-oriented scenarios, where the numbers, abilities and goals of one side are completely different from those of the other side. A typical example: Devil May Cry artificially prevents enemies from attacking you from off camera, an asymetry that makes no sense in human vs human. Thanks to this, it empowers evasion and dodge tactics because the player has a chance to see and react to the attacks. It also creates the opportunity for tactics that, while some will find them cheesy, can be very satisfying in their execution: for example, isolating one of the enemies from the pack, cornering it and then ripping it apart while relatively safe from the rest of the enemies. This behaviour feels very natural and is present in the fight scenes of countless movies. "A Theory of Fun" would be a very relevant read on this topic. [quote]People continually complain anecdotally that our agents don't act intelligently[/quote] I'd argue that people complain when they see our agents do blatantly stupid things; not mistakes, but things that don't make sense: stop and run for cover when he had me cornered, switch to a shotgun in a ranged fight, build a factory when he's low on resources, etc.

Dave Mark on March 13th, 2008

Excellent points as always, Jare. I was wondering when you were going to pop in. Interesting about the AI using the same or similar rules/tactics as the player. That's something Soren actually mentioned in his lecture. He pointed out that in the "good" AI games (e.g. Chess), the AI was allowed to use the same tactics that a human player would. Everything was on the table. Civ 4 did much of that - far more than prior Civ games. However, in some cases, they actually limited what the player could do so as to make it a better battle (to coop Damian's lecture title). Anyway, in the example you gave about Devil May Cry, the artificial limitation on off-camera attacks makes a lot of sense from a dramatic tension point of view (so to speak). I hadn't thought through all of that, I suppose. I don't think we could expect perfection in the move towards intelligence equality of the AI - and I don't mean to espouse that here. Your example is one that should NOT be implemented in an FPS game. However, there are plenty of idea that get shelved - either conciously or uncounciously - because the umbrella of "because it's not fun" gets to be fairly large. Sometimes we may end up... uh... shooting ourselves in the foot because we don't let our AIs do things that are more natural. So, as always a balance needs to be struck... but where? Great conversation folks - thanks for stopping by! (Now all we need is for Soren to pop his virtual head back in. Also, I may try to summon someone else who might have some insight here.)

Jon S on March 13th, 2008

I have made this point elsewhere in a different thread before but it is relevant so I will restate it. I agree with Jare in that multiplayer games and single player games have different focuses one on balance one on one man vs the world. If you are writing AI for a balanced game then the player expects it to be equal to other players abilities. However if they were that smart in a single player game you would need to balance it for the player so he isn't getting killed every few seconds. You could still let them do all the advanced things like sniping far away, flanking, whatever but you either need to let the player take many shoots with little affect on him, or force the AI to have horrible accuracy unless the player can see him, or give the player an equally competent squad for backup so he isn't constantly getting shot in the back. Typically we have been striking that balance in single player games by making the enemy's have built in flaws and lack of smart tactics. I think that when a game is most fun is when the player believes it is balanced and he has a good chance at winning but also a fear of loss. In online games if it is a very one sided fight it isn't much fun, sure it might be fun for the team winning for a little bit but even the winning team soon gets bored. The hard part in single player games is that the AI typically doesn't change with the player, and every player has different skill levels. Multiplayer games account for because the people playing get better and teams are generally fairly random so there is a good chance there will be good players on both sides. So maybe on single player games you might need to mimic this, but I could see the game not being too much fun if you had to wait for one of your good bots to take out their good bot blocking your path before you move on.

mex on May 17th, 2008

A friend of mine made his degree on how to lead units in a strategic game. Its main point was that directing "lowest level" units one-by-one is opposing to the manner real generals and campaign-leaders usually do in battles. For hundreds of years it became a habit to organize armies in such a way that each leader gives order to up to 7 other people, not more. That raised the idea of providing the player with AI-driven vice leaders. I think this context would be an opportunity to create good AND fun AI characters at the same time. mex

If you'd like to add a comment or question on this page, simply log-in to the site. You can create an account from the sign-up page if necessary... It takes less than a minute!