Intelligent Mistakes: How to Incorporate Stupidity Into Your AI Code
March 21, 2019
Press Releases
March 21, 2019
Games Press

If you enjoy reading this site, you might also want to check out these UBM Tech sites:

Intelligent Mistakes: How to Incorporate Stupidity Into Your AI Code

March 18, 2009 Page 3 of 3

Poker AI

When I programmed the AI for Left Field's World Series of Poker, the AI computation was basically the same for each difficultly level.

The computer would calculate the odds of winning based on the known cards, and an estimate of the opponent's hand strength based on betting history. The odds would then be used to calculate a rate of return, which would be used to decide if they would fold, call, or raise.

There were many special case rules and exceptions, but that's the basics. The AI players would all make the same extensive computations, running tens of thousands of simulated hands through an evaluator to calculate the rate of return.

After these calculations were performed, only then would the differentiation be performed. At that point, the best players would play their best move, and the weak AI players would make intelligent mistakes.

For weak poker AI, an intelligent mistake consists of figuring out what you should do, and then not doing it, so long as not doing it does not make you look stupid.

For example, if the human player just put in a big raise, yet you know there's a 75 percent chance your hand is the best, then an intelligent mistake would be to fold. The odds are the AI would win, yet we are simulating a weak human player, and weak human players often fold to a large raise when they are unclear on their odds.

Conversely, weak human players often call when their chances are weak. It's a natural thing to do and allows us to reduce the strength of the AI player, without it looking artificially stupid.

These intelligent mistakes were implemented in a probabilistic manner. The fake-stupid AI would not always fold when the human player seemed to be bluffing -- it was just more likely to.

This worked very well in the highly random game of poker, because the player could never tell in any individual situation if the AI was actually making a mistake.

Since the AI was still performing its full set of millions of calculations, it never made mistakes that were inhumanly stupid, but the layer of artificial stupidity brought on by increased recklessness was enough to even the playing field and give the weak and average human players an enjoyable game.

Artificial Inaccuracy

In pool and in shooters, the computer AI is blessed with an omniscient accuracy. The shooter AI knows down to the billionth of an inch exactly where you are, and could shoot your hat off your head from five miles away. Similarly in pool, the AI knows the position of every ball and can calculate where every ball will end up before it takes a shot.

When I implemented my snooker AI, it could perfectly pot any ball off two cushions, and would almost always get a perfect break of 147 every time it played (except when it potted the white due to its lack of positional play).

It was obviously not a fun opponent to play against, so even at the highest levels, the accuracy had to be reduced, and the cushion shots had to be restricted to getting out of snookers.

Simply reducing the accuracy of the AI is not always the best way to improve gameplay. As I found with the "positional play" in snooker, random outcomes that happen to favor the computer are perceived as being intentional. If the ball ends up in a good place, or the poker AI makes a lucky call and wins on the river, it can be perceived as unfair or even cheating.

So instead of reducing the accuracy, I'd suggest, as in chess, we increase the accuracy. In order to provide an exciting and dynamic game, the AI needs to manipulate the gameplay to create situations that the player can exploit.

In pool this could mean, instead of blindly taking a shot and not caring where the cue ball ends up, the AI should deliberately fail to pot the ball and ensure that the cue ball ends up in a place where the player can make a good shot.

In a shooter, the enemy aliens should not simply randomly break from cover -- they should sometimes break from cover when the player is close to them and panning toward them. They should "accidentally" throw themselves into the line of fire to make the game more interesting.

Luck of the Draw

Playing against a perfect opponent is no fun. But playing against a crippled opponent is no fun either. To create more interesting gameplay, we have to introduce the concepts of artificial stupidity and intelligent mistakes.

Intelligent mistakes seem like failings on the part of the AI, but are actually carefully calculated ways of throwing the game that make it more entertaining for the player. This does not remove the challenge, as the player still has to have a certain level of skill.

For the programmer, adding intelligent mistakes is much more complex than simply reducing the accuracy of the AI, but provides a much more rewarding experience for the player.

Resources

Liden, Lars. "Artificial Stupidity: The Art of Intentional Mistakes," in AI Game Programming Wisdom 2, Charles River Media, 2004. http://lars.liden.cc/Publications/Downloads/2003_AIWisdom.pdf

Lopez, Steven. "Intelligent Mistakes," Chessbase News, 2005. http://www.chessbase.com/newsdetail.asp?newsid=2579

Page 3 of 3

Related Jobs

Giant Enemy Crab — Seattle, Washington, United States
[03.20.19]

Gameplay Engineer
Embodied Inc. — Pasadena, California, United States
[03.20.19]

Junior Scripter
Disbelief — Chicago, Illinois, United States
[03.20.19]

Senior Programmer, Chicago
Disbelief — Chicago, Illinois, United States
[03.20.19]

Junior Programmer, Chicago