 |

|
 |

| |
Analysis: Game AI & Our Cheatin’ Hearts
by Soren Johnson [PC, Console/PC, Mobile Console, Exclusive]
|
|
| |
|
September 14, 2009
|
| |
[In this design analysis, first published in the May 2009 issue of Game Developer magazine, Maxis designer Soren Johnson (Spore, Civilization IV) addresses the careful balance between smart AI and player perception that the game is cheating.]
The designers of Puzzle Quest have a frustrating burden to bear – everyone thinks they are a bunch of dirty cheaters. The game centers on a competitive version of Bejeweled, in which players duel with an AI to create the most “match-3” colored patterns.
The problem comes from how the pieces on the gameboard are created - when, for example, a column of three green orbs is lined up and removed from play, new pieces fall in to take their place. However, sometimes, these three new pieces happen to be of all the same type, which means that a new match is automatically made, and the player scores again.
The odds of such a result are low (around 2% for getting three of the same colors in a row), but they are still high enough that a player will see it many times with enough games played.
Of course, the AI is playing the same game, so the player will see this lucky match fall into the enemy’s lap as well. At this point, human psychology takes over. Because the new pieces are hidden from view, how does the player know that the computer is not conducting some funny business and giving itself some free matches?
The human mind is notoriously bad at grasping probability, so many players are convinced that the AI is cheating. The developers have pledged over and over again that everything is fair and even, but whether they like it or not, the player experience has been affected by the simply possibility of cheating.
Trust Me
Games do not start with a player’s trust – this trust needs to be earned over time. Our audience is well aware that we can make a game do whatever we want under the hood, so the transparency and consistency of a game’s rules contribute significantly to player immersion.
The worst feeling for a player is when they perceive – or just suspect – that a game is breaking its own rules and treating the human unfairly.
This situation is especially challenging for designers of symmetrical games, in which the AI is trying to solve the same problems as the human is. For asymmetrical games, cheating is simply bad game design – imagine the frustration which would result from enemies in Half-Life warping around the map to flank the player or guards in Thief instantly spotting a player hiding in the shadows.
However, under symmetrical conditions, artificial intelligence often needs to cheat just to be able to compete with the player. Accordingly, designers must learn what cheats feel fair to a player and what cheats do not. As the Puzzle Quest team knows, games need to avoid situations in which players even suspect that the game is cheating on them.
Cheating is not the same thing as difficulty levels – by which the players are asking the game to provide extra challenges for them. Cheating is whether a game is treating the player “fairly” – rewarding them for successful play and not arbitrarily punishing them just to maintain the challenge. Unfortunately, in practice, the distinction between difficulty levels and cheating is not so clear.
Show the Mechanics
Fans of racing games are quite familiar with this gray area. A common tactic employed by AI programmers to provide an appropriate level of challenge is to “rubberband” the cars together. In other words, the code ensures that if the AI cars fall too far behind the human, they will speed up. On the other hand, if the human falls behind, the AI slows down to allow the player to recover.
The problem is that this tactic is often obvious to the players, which either dulls their sense of accomplishment when they win or raises suspicions when they lose. Ironically, games which turn rubberbanding into an explicit game mechanic often becomes more palatable to their players.
For example, the Mario Kart series has long disproportionately divvied out rewards from the mystery item boxes sprinkled around the tracks relative to the riders’ current standings. While the first-place racer might receive a shell only useful for attacking other lead cars, players in the rear might get a speed bullet which automatically warps them to the middle of the pack.
These self-balancing mechanics are common to board games – think of the robber blocking the leader’s tiles in Settlers of Catan – and they don’t feel like cheating because the game is so explicit about how the system works. Thus, players understand that the bonuses available to the AI will also be available to themselves if they fall behind. With cheating, perception becomes reality, so transparency is the antidote to suspicion and distrust.
Cheating in Civilization
Sometimes, however, hidden bonuses and cheats are still necessary to provide the right challenge for the player. The Civilization series provides plenty of examples of how this process can go awry and drive players crazy with poorly-handled cheating.
Being turn-based, the developers could not rely on a human’s natural limitations within a real-time environment. Instead, Civilization gives out a progressive series of unit, building, and technology discounts for the AI as the levels increase (as well as penalties at the lowest levels).
Because of their incremental nature, these cheats have never earned much ire from the players. Their effect is too small to notice on a turn-by-turn basis, and players who pry into the details usually understand why these bonuses are necessary.
On the other hand, many other cheats have struck players as unfair. In the original version of the game, the AI could create units for free under the fog-of-war, a situation which clearly showed how the computer was playing by different rules from the human. Also, AI civilizations would occasionally receive free “instant” Wonders, often robbing a player of many turns of work.
While an AI beating the human to a Wonder using the slow drip of steady bonuses was acceptable, granting it the Wonder instantly felt entirely different.
How a cheat will be perceived has much more to do with the inconsistencies and irrationality of human psychology than any attempt to measure up to some objective standard of fairness. Indeed, while subtle gameplay bonuses might not bother a player, other, legitimate strategies could drive players crazy, even if they know that a fellow human might pursue the exact same path as the AI has.
For example, in the original Civ, the AI was hard-wired to declare war on the human if the player was leading the game by 1900AD. This strategy felt unfair to players – who felt that the AI was ganging up on the human – even though most of them would have followed the same strategy without a second thought in a multiplayer game.
In response, by the time of Civ3, we guaranteed that the AI did not consider whether an opponent was controlled by a human or a computer when conducting diplomacy. However, these changes still did not inoculate us against charges of unfairness. Civ3 allowed open trading – such as technology for maps or resources for gold.
An enterprising human player would learn when to demand full price for their technologies and when to take whatever they could get – from a weak opponent with very little wealth, for example.
We adapted the AI to follow this same tactic, so that it would be able to take whatever gold it could from a backwards neighbor. To the players, however, the AI’s appeared to be once again ganging up against the human. Because the AI civs were fairly liberal with trading, they all tended to be around the same technology level, which led the player to believe that they were forming their own non-human trading cartel, spreading technologies around like candy (or, in the parlance of our forums, “tech-whoring”).
Perception is Reality
Once again, perception is reality. The question is not whether the AI is playing “fairly” but what is the game experience for the player? If questions of fairness keep creeping into the player’s mind, the game needs to be changed. Thus, for Civ4, we intentionally crippled the AI’s ability to trade with one another to ensure that a similar situation did not develop.
The computer is still a black box to players, so single events based on hidden mechanics need to be handled with great care. Sports game developers, for example, need to be very sensitive to how often a random event hurts the player, such as a fumble, steal, or ill-timed error. The dangers of perceived unfairness are simply too great.
Returning to our original example, the developers of Puzzle Quest actually should have considered cheating, but only in favor of the player. The game code could ensure that fortunate drops only happen for the human and never for the AI.
The ultimate balance of the game could still be maintained by tweaking the power of the AI’s equipment and spells - changes which appear “fair” because they are explained explicitly to the player. The overall experience would thus be improved by the removal of these negative outliers that only serve to stir up suspicion. When the question is one of fairness, the player is always right.
|
| |
|
|
As for the main topic though, how to avoid people thinking the AI is cheating? They key IMO is making it so we can see the reasoning behind it. In board games when a player does something and it makes the table almost get flipped we can demand WHY they are doing it. The answer will come and things settle down... in video games the AI does something and there is NO reason why... you go to a diplomatic screen and get the same canned banter instead of options asking why they are doing what they are doing. You have the decision tree, you want to make the AI appear human, maybe a 'readable' interface to their thoughts would be a way to make them appear more human?
In the case of puzzle quest, maybe it's just flawed design to think you can have a strategy game where that much luck can blow the whole strategy idea out of the water...
Of course, the human dimension makes this a 2 edged weapon. Once I'd worked out that it was scanning and detecting a certain unit, I just ran that unit back to the furthest corner of my map - the computer would ALWAYS scan that area then, concentrated on that specific unit. I can get on with the game somewhere else then, unfettered by pesky scans. All my other stealthed units could then function normally, and I knew they would never be revealed!
Still, for a game where you rely on the computer being subject to the sames rules, processes and limitations on play to make things fair and fun, it left a very bitter taste to discover the computer "cheating" so blatantly, and also made me question what else it was nudging the odds on....
I also totally agree with the "It's only wrong if you get caught" mentality with AI cheating. I recall a time where I significantly dialed back the environmental damage given to NPCs in certain circumstances and even I couldn't tell that they were taking less damage than the player.
This isn't to say that I necessarily think rubberband AI is terrible. The latest edition of Sega Rally on the PS3 and 360 had it in play and it was even mentioned by the designers in video documentaries. It helped to keep the races close and exciting. Sure there were times when I'd lose a race and be livid, but the game at least let you adjust the difficulty per competition.
I wanted a challange, playing in "normal" was boring to me, I utterly crushed the AI... But playing on "hardest" the AI instead of rushing on you or using any other agressive tactive, it was the same AI as "normal" (utterly idiotic, like if you attack a island in one side, all enemy units remain there forever until you attack the other side) but clearly cheating.
Age 2 cheating: The "hardest" AI get free resources and if there are several AI players they can ignore ALL diplomacy settings (you can even on the game setup screen set them as your allies and lock teams) and will gank on you, this was utterly stupid because sometimes 3 minutes on the game you had the AI jumping into second age and each one sending 20 soldiers on you, and you kept wondering: where the hell that came from?
But I must say that there are one other problem than cheating AI, it is "perfect" AI, specially in games that involve physics, like Worms, Gunbound, Osmos... Osmos "boss" for example can move around with perfect precision and attaining a perfect speed using much less fuel than the player, the reason for that it is that being a AI it can use physical formulas to predict perfecly the path of everything on the screen, plan ahead and execute with perfect precision, happily only the boss do it, so it is "fair", but I saw AI on worms doing perfect shots on easy, that is not fun, specially in worms that NOONE (but AI) do ever a perfect shot, and part of the game fun come from that (and the accidents that result)
I have really enjoyed several RTS/Empire Building strategy games such as Civ, Total War, and Age of Empires. The frustration that all of those games held in common for me was the diplomacy. I always felt that my enemies (the AI) were conducting diplomacy in a way that I couldn't match. AI factions would consistently reject any proposal that would actually change the dynamic of the map except 100% favorable options like gifting them a territory. Options like attacking another faction or becoming a protectorate seemed perpetually off the table.
The first comment hit it dead on. The frustration isn't just the fact that my proposals weren't accepted, it's that the only AI denial responses seemed limited to "We aren't interested in that right now". It made it impossible to "dialogue" with the AI. Meanwhile, reasonable or not, it felt like the AI knew what was going on behind the scenes and had the ability to make those sorts of transactions successfully because they could "speak the language".
Great article, very thought provoking.
Another rather different example, which hits both sides of the table, would be the original Advance Wars for the GBA. The computer completely disregarded fog of war and this was blatant to see. There were a couple of exceptions, like when using forests or reefs (the game's built in 'hide in me' spots), but otherwise every unit was fair game. This was incredibly frustrating on certain maps, as one might imagine.
However, in contrast, the AI also had a huge exploitable flaw - the highest priority they had was for APCs. You could be on the verge of victory with a unit about to capture their headquarters, but if there was an APC around the computer ignored EVERYTHING else and went straight for it. This leads to an interesting counter-dilemma: If the player wants to keep things fair, how do they deal with their own APCs? If you know having them is going to automatically screw with the AI and force it to make bad decisions, do you not build them? But then you're handicapping yourself by removing the unit, and once again the playing field isn't fair.
I grant a scenario like this where a player actually cares this much is rare, but I know it came up a few times for me, even in small games with friends against computers. Ah, the razor's edge ... isn't it grand?
Exposing the rules of play means showing and telling the player exactly what in-game actions are available (things a player can do), as well as defining the constraints on action (things players can't do). Believing that AI players are following the rules depends on being able to know what all the rules are so that there is a single standard for "fair" behavior. And this applies to both explicit rules (e.g., "players on turn 10 have five skill points they can spend") and implicit rules (e.g., "players can't move faster than a controller or mouse+keyboard would allow"). (Note: This should apply to most games, but there may be some games whose gameplay is actually based on discovering the rules of play. In these games, designers need to be aware that if this discovery process is competitive and AI players are allowed to compete, they risk charges that AI players cheat.)
The second requirement for avoiding a perception of cheating -- show AI player actions -- means letting all other players (human and AI) see how the AI player affects the game space. This is necessary to allow human players to confirm that AI players are complying with all the rules. Some discretion may be necessary here for certain games where limiting information about opponents is a part of gameplay. Games with stealth or "fog of war" elements, for example, may need to hide AI player actions temporarily. But when the effects of those AI player actions are revealed, players still need to be able to see that those effects could be achieved within the rules of play that are available to all players.
Being a better player should mean making applying the rules of the game more effectively in a given situation, rather than breaking the rules. Of course that means game designers will have to develop something closer to true game AI, rather than relying on the quick-and-dirty fix of allowing AI players to break explicit or implicit rules to provide a greater level of challenge. But if the alternative is to lose players because of a perception that AI players cheat, developing "smart" logic for computer players may simply be a necessary cost of doing business as a developer of a single (human) player game.