TicTacToe with MinMax AI
BadToxic (Michael Grönert)
$0.0
(no ratings)
Date |
Price |
---|---|
日期和时间 |
价钱($) |
05/14(2022) |
0.0 |
11/17(2024) |
0.0 |
Jump AssetStore
A Tic Tac Toe game with an artificial intelligence that can play perfectly using a MinMax algorithm.Tic Tac Toe (= noughts and crosses, or Xs and Os) is a paper-and-pencil game for two players who take turns marking the spaces in a three-by-three grid with X or O. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner.This ready to use game asset can be played locally in turns or against an artificial intelligence that can play perfectly using a MinMax algorithm. The main purposes of this asset, besides playing the game yourself, are:Adding this as a mini game to your own project.Learn about using a simple AI algorithm by watching the visualized thinking steps the AI does and retracing the well documented code.ContentTicTacToeController script (Game and AI)TicTacToeSettings script (Controlling the game and AI)Documentation pdfRequirementsNothing special: Works on all platforms supported by Unity.UsageClick "Start" to play against the AI - but sorry, you will never win. ;)You can activate the AI (toggles) for each player, both or none.Activating "Shortcuts" will activate hard coded behavior for the first two moves of a game. This is to show how the calculation time can be improved by using some kind of wisdom database of optimal moves and to generate variety by choosing between different optimal moves by random.Activating "Visualize" will enable the rendering of all moves the AI tests while calculating and displays the recursion depths and scores from the MinMax algorithm. It also activates a slider that can regulate how long each AI test move should be displayed before making the next move.More detailed info in the included documentation.SupportNeed help? Contact me on Discord.