AI

In Resources/GameplayData you can change the AI type and AI level.

There are two AI available: Random, and Minimax.

Random is a very weak AI that just plays randomly. While Minimax is a much stronger AI that will evaluate moves using an Heuristic. It is quite strong but will not beat a good player.

AI level is not relevant for the Random AI. It will change the strength of the Minimax AI. 10 is the maximum level and has no randomness in the calculation. The lower the value, the more randomness will be added to heuristic calculation.

The reason I included a random AI, is that it is much more practical for testing, if you don't want to get completely destroyed while trying to test a specific card. Also, if you are going to edit the code of the game rules (in GameLogic.cs), this could affect the AI and if you want to focus on game rules before worrying about the AI issues, it is much easier to edit and adapt the Random AI since its script is like x10 shorter. The other advantage of the random AI is if you want to debug the GameLogic.cs script, since the AI will use the functions in that script hundreds of times when trying to predict moves, it can be really hard to debug that script. The random AI does not use the GameLogic.cs for predictions, and only use it for doing the actual actions. You can go back to the Mini Max AI once your gameplay works well and you are ready to tackle the AI.

Last updated