How to create a reasonable AI?

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

Now I have to stun the AI ​​so that a person can win, but I don’t know how to do it. The current logic of AI is based on pattern matching - if I imagine random moves that cause the board to leave the template space, the AI ​​will most likely play dumb until the end of the game.

I also think about deleting a set of templates, so it seems that AI does not know this “trick”, but in this way players can find a way to beat the computer using the same moves every time.

Any ideas on how to drown out the AI ​​in such a way that it does not come from a “genius” to a “completely silent” in one turn?

+6
source share
5 answers

In the end, I created a couple of quasi-smart patterns (as if a 10-year-old player could play), so he is not completely dumb, and then I choose one or two of them at random before the game starts. Thus, the game always wins, but the player does not know how (that is, he cannot use the same strategy to always win, he must first explore the weak spot).

+2
source

We used MinMax as an AI algorithm for our game, and we implemented AI levels by setting different depths for each level.

+2
source

If your zero-sum game is the only one, the MiniMax algorithm with alpha beta optimization is a good choice. You can create difficulty levels by stopping the search when the algorithm reaches a certain depth.

0
source

Since I am not a game development specialist, and my AI is actually too dumb at the moment, I would make a kind of "training AI." Say you turned off all of your regular expressions, and you turn them on when the player uses them.

0
source
  • I think this is a zero-sum game, and you can use the MinMax algorithm to solve the game instead of matching patterns, thereby controlling the depth of the search, you can control the level of expertise of the agent.
  • Alternatively, you can use the A * search to determine the best move for a given fox / dog. And by choosing various heuristics, you can control the effectiveness if the agent.
0
source

Source: https://habr.com/ru/post/895581/


All Articles