Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

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?

share|improve this question
    
So you found and implemented the optimum, always winning strategy. Why not moving to slightly more complicated games now? Or, what about a challenge: Implement a strategy which always loses, no matter what the other player does. See also: Losing Chess/Antichess –  Martin Sojka Aug 23 '11 at 8:52
    
Maybe you'd like to take a look at my answer on this other question: gamedev.stackexchange.com/questions/12858/… –  Tyn Aug 24 '11 at 10:21
    
Fox and hounds is not as complex as chess. One wrong move and AI loses for sure. It's very easy to make AI look dumb. The fact that I solved it using pen and paper and hours of strategic thinking, does not mean that my players will do the same. –  Milan Babuškov Sep 29 '11 at 19:15

2 Answers 2

up vote 6 down vote accepted

Many implementations may lead to a random weighted chance for moves -- say, a chance to make an optimal move and a chance to make a suboptimal move. Determining how suboptimal a move is could be a very tricky problem, but will also lead your AI to making much more seemingly-intelligent decisions.

Important note: No matter the difficulty setting, it would probably be a bad idea to have the AI pass up a chance to immediately win the game. If there is a possibility to make a move that would finish the game that turn, it should always be taken. If not, it will absolutely destroy the player's impression of how the AI is acting.

share|improve this answer
    
Thanks. I decided to let it play smart for all the simple patterns. There are two complex patterns where player's path to freedom is not easily visible, so I created additional patterns that make AI lose by playing moves that would resemble a novice human player in such position. At start of the game, I randomly switch winning pattern with losing one for such positions. –  Milan Babuškov Aug 24 '11 at 6:52

Since this appears to be a 'solved' game, the only answer is that the computer must make intentionally bad moves.

A quick solution may be to calculate the best move, then also calculate another legal move that may not be so good. The difficulty rating of the AI would be measured in the percent chance it picks the other not so good move, over the perfect move.

  • Difficult - 90% good moves
  • Hard - 70% good moves
  • Normal - 50% good moves
  • Simple - 20% good moves
  • Was Dropped As A Child - <5% good moves
  • Hotdog - All Random
share|improve this answer
10  
This is probably a good idea, but you'd end up with a retarded AI if it is intentionally taking wrong moves. Off the top of my head, I would first do a pass for "legal" moves, then apply weights to each move and order them by weight, the highest weight being the best move. You can then make a RNG converge towards better moves depending on difficulty. –  Jonathan Connell Aug 22 '11 at 13:03
4  
I agree with @Jonathan Connell. Consider: hiding behind crates vs hiding behind explosive barrels vs hiding among crates and an active grenade. The AI should evaluate how bad the move is, with better AI making better moves more often. An AI won't be great or hard if 70% of the time it shoots you and 30% of the time it blows itself up. It will just be hilarious. –  Jonathan Hobbs Aug 22 '11 at 13:12
2  
@Adrian Seeley Your last comment really touches the biggest problem; for me a human playing against AI will always instinctively find a reasoning behind it's choices even if they are theoretically completely random. In a board game for example this can be countered by limiting the number of iterations in predicting moves, so maybe this could be a good solution in a solvable game? –  Jonathan Connell Aug 22 '11 at 13:43
2  
I agree with both Jonathans, but I'm giving this answer +1 for 'Was Dropped as a Child' and 'Hotdog' –  thedaian Aug 22 '11 at 13:49
2  
@Jonathan Connell: You should post your proposition/solutions as an answer. It would deserve some upvotes. –  bummzack Aug 22 '11 at 14:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.