TicTacToe with MinMax AI View on Asset Store (opens in new tab)

Package details

Latest version
1.1
Last updated
First released
Unity version
2021.3.1 or later
Package size
215 KB
Files
6
Favorites
52
Views in the past week
5

Price tracking

Last checked
Tracked since
Lowest recorded
Free on

Keywords

TicTacToe with MinMax AI

by BadToxic (opens in new tab)

No ratings yet

A Tic Tac Toe game with an artificial intelligence that can play perfectly using a MinMax algorithm.

Price Free

Get it free on Asset Store (opens in new tab)

Affiliate link · Purchases support this site

Price history

Last 6 months

USD
Price history for TicTacToe with MinMax AI, 6 months Current Free; lowest Free; highest Free in this period. $0 Jun Jul Aug Sep Oct Nov

Asset preview

1 / 1

TicTacToe with MinMax AI video 1

About this asset

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.

From the publisher's Asset Store listing.

Technical details

Content

  • TicTacToeController script (Game and AI)
  • TicTacToeSettings script (Controlling the game and AI)
  • Documentation pdf

Requirements

Nothing special: Works on all platforms supported by Unity.

Usage

Click "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.

Support

Need help? Contact me on Discord.

Compatibility

Render pipelines supported in each Unity version
Unity version Built-in URP HDRP
2021.3.1f1 Compatible Not listed Not listed

As listed on the Asset Store.