prog: (galaxians)
prog ([personal profile] prog) wrote2008-06-11 10:25 am

Cleverly stupid game AIs

I read a good article in Game Developer last night about building weak AIs (automated opponents) that maximize the fun for the human player. The upshot was a recommendation to rely less on stunting the AI's allowed computation time, or clouding its actions with random variances, and more on having the AI intentionally and subtly providing the player with openings to smack it down.

For example, in a billiards game, a weak-and-dumb AI would just make wild shots. A weak-and-clever AI would calculate precisely the shot necessary to not only barely fail to sink a ball, but also have the cue ball end up in a spot where the human can follow up with an easy shot. It can look quite natural, when done correctly. You wouldn't want to do this on every turn, but you might want it to happen more often if the computer player starts winning. The article's author apparently wrote this very thing for a commercial project.

The article also referenced a chess program for PCs named Fritz, which pioneered this strategy for computer chess AIs. Historically, Chess AIs' difficultly levels are simply a factor of how long they're allowed to analyze the board and thumb through look-ahead positions. At weaker levels, there's a drop-dead timer on their thought process, and when it ends they just make the best move they happened to come across by then - which can often be a transparently terrible move.

Fritz, on the other hand, when set to a gentle difficultly level, plays a strong game but keeps an eye on how well the human is keeping up. If it's falling behind, Fritz will start intentionally making moves that aren't stupid, per se, but definitely leave openings for the human to grab a positional advantage. When (and if!) the human catches on and strikes at the opening, Fritz will resume playing for keeps.

There were other examples specific to Poker (weak players tend to fold when someone else makes a big raise, and so should weak AIs) and even first-person shooters (bad guys that have the "bad luck" to break from cover just as the player's crosshair is panning over them). I really like this.

[identity profile] prog.livejournal.com 2008-06-11 05:24 pm (UTC)(link)
It really is literally letting the poor pathetic human win, but trying your hardest to make it look like you're not. In the case of the billiards game, the computer gets to use its total mastery of game-universe physics to do so. "Oh - look where the ball landed! Lucky you!" I love it.

[identity profile] cortezopossum.livejournal.com 2008-06-11 06:53 pm (UTC)(link)
I had two professors who would often play each other on one of the billiards tables at the student union game room. They were both extremely polite to each other and you could often tell that if one was losing badly the other would play a significantly weaker game until the the first one caught up.

This talk reminds me of the game 'Oddworld' where you could sometimes defeat guards by talking to them. If they couldn't see you, you keep jamming away at the speech buttons the guard would get more and more upset that he could hear you but not see you. Eventually the guard would get so upset it would run off the edge of a cliff and die.

[identity profile] kahuna-burger.livejournal.com 2008-06-11 10:03 pm (UTC)(link)
I know a lot of people play games to be competitive and would resent that behavior, but for myself it sounds quite nice. I play games to enjoy the game while it's going on and "the thrill of victory" is a minor endnote. Blowouts aren't fun for me whether I'm winning or losing.