Cleverly stupid game AIs
Jun. 11th, 2008 10:25 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
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.
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.
no subject
Date: 2008-06-11 04:55 pm (UTC)no subject
Date: 2008-06-11 05:24 pm (UTC)no subject
Date: 2008-06-11 06:53 pm (UTC)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.
no subject
Date: 2008-06-11 10:03 pm (UTC)no subject
Date: 2008-06-11 06:42 pm (UTC)no subject
Date: 2008-06-11 07:54 pm (UTC)no subject
Date: 2008-06-11 08:08 pm (UTC)no subject
Date: 2008-06-11 09:35 pm (UTC)I don't think the point of adaptive difficulty is to remove difficulty levels, it's to make the full range of them more fun. As I mentioned with HoMM, lower difficulty levels can be tedious if done badly.
no subject
Date: 2008-06-11 11:54 pm (UTC)It also depends a lot on the game--driving games are by far the worst, where you can tell the other cars are deliberately driving slower (and not just taking the corners badly) to give you a chance. Arrrgh I hates it!