Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a reasonable AI?

I'm creating a logic game based on Fox and Hounds game. The player plays the fox and AI plays the hounds. (as far as I can see) I managed to make the AI perfect, so it never loses. Leaving it as such would not be much fun for human players.

Now, I have to dumb-down the AI so human can win, but I'm not sure how. The current AI logic is based on pattern-matching - if I introduce random moves which make the board go out of pattern space the AI would most probably play dumb until the end of the game.

I'm also thinking about removing a set of patterns, so it would seem as AI does not know that "trick" but this way players could find a way to beat the computer using the same moves every time.

Any ideas how to dumb down the AI in such way that is does not go from "genius" to "completely dumb" in a single move?

like image 779
Milan Babuškov Avatar asked Aug 22 '11 10:08

Milan Babuškov


2 Answers

We used MinMax as the AI algorithm for our game and we implemented the AI levels by setting different depth for each level

like image 87
sternr Avatar answered Nov 03 '22 00:11

sternr


I ended up creating a couple of quasi-smart pattern plays (as if a 10 year old might play) so it is not completely dumb, and then I pick one or two of those at random before the game starts. This way the game is always beatable, but the player does not know how (i.e. he cannot use the same strategy to always win, he has to explore for weak spot first).

like image 36
Milan Babuškov Avatar answered Nov 03 '22 02:11

Milan Babuškov