[P] uttt.ai: AlphaZero-like solution for playing Ultimate Tic-Tac-Toe in the browser

tl;dr I developed AI solution (MCTS + NN) inspired by AlphaZero for playing Ultimate Tic-Tac-Toe game in the browser. You can try it yourself here: https://uttt.ai.

Why?

Ever since I started working in Machine Learning 5 years ago, I have always wanted to do some cool project for my portfolio. Reading scientific papers gave me plenty of ideas, but only after I read AlphaZero preprint I knew: this is it!

AlphaZero is a third paper in AlphaGo, AlphaGo Zero, AlphaZero, MuZero sequence. In AlphaZero paper Deepmind generalizes previous work so that AI can learn through self-play not only how to master Go, but also Chess and Shogi. I had read previous papers, but it was AlphaZero specifically that sparked my imagination. Probably because I love simple and elegant engineering solutions and AlphaZero is mostly about that.

I discovered Ultimate Tic-Tac-Toe and implemented AlphaZero in early 2018. After a few weeks of work I realized it's not going to be an easy ride. There were two major problems that essentially made me forget about this project for a long time.

Firstly, although Ultimate Tic-Tac-Toe (UTTT) looks easier than Chess or Go, it is still quite a challenging game. The average length for UTTT game is somewhere between 40 and 50 plies. The average number of legal actions per position is somewhere around 7 (my estimate from self-play data). It is difficult setup for a side-project. One of the key factors enabling AlphaZero success is massive computing power (5000 TPU v1 for self-play and 64 TPU v2 for training). I had to figure out much cheaper way to develop interestingly good AI under my personal budget.

Secondly, when I envisioned deploying AlphaZero in the browser I had zero knowledge of web development and frontend in general. Which meant I had to find some time to learn it. Not easy if you already have a full-time job and other stuff going on in your life. I decided to put the whole project on hold and said to myself: "maybe one day there will be better time for this..."

Fast-forward to 2021. I left my job and decided to spend a year on a career break, pursuing my interests. I realized that I finally had enough time and resources to conquer this project. I learned the basics of web browsers, HTML, CSS, JavaScript and React. I bought a desktop PC. I've managed to incrementally redesign AlphaZero self-play training into something more executable on my co

... keep reading on reddit ➑

πŸ‘︎ 78
πŸ’¬︎
πŸ‘€︎ u/arnowaczynski
πŸ“…︎ Dec 10 2021
🚨︎ report
uttt.ai: AlphaZero-like solution for playing Ultimate Tic-Tac-Toe in the browser (r/MachineLearning) reddit.com/r/MachineLearn…
πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/Peerism1
πŸ“…︎ Dec 11 2021
🚨︎ report
[P] uttt.ai: AlphaZero-like solution for playing Ultimate Tic-Tac-Toe in the browser /r/MachineLearning/commen…
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/gwern
πŸ“…︎ Dec 11 2021
🚨︎ report
I created an online multiplayer game and Progressive Web App for ultimate tic-tac-toe using TypeScript, React, and Socket.IO [GitHub and write-up in the comments] u3t.app
πŸ‘︎ 213
πŸ’¬︎
πŸ‘€︎ u/Rilic
πŸ“…︎ Jul 05 2021
🚨︎ report
I've made Ultimate Tic-Tac-Toe to put in our custom private discord bot using the button interactions! :)
πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/sH-Tiiger
πŸ“…︎ Aug 10 2021
🚨︎ report
I created an online multiplayer game and Progressive Web App for ultimate tic-tac-toe using TypeScript, React, and Socket.IO [GitHub and write-up in the comments] u3t.app
πŸ‘︎ 18
πŸ’¬︎
πŸ‘€︎ u/Rilic
πŸ“…︎ Jul 05 2021
🚨︎ report
I made a Progressive Web App with online multiplayer for ultimate tic-tac-toe using TypeScript, React, and Socket.IO u3t.app
πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/Rilic
πŸ“…︎ Jul 10 2021
🚨︎ report
Ultimate tic tac toe

https://ultimate-t3.herokuapp.com/online-game/bhyb5h37wn66r396s745f80k9

first to beat me gets an award

if you don't know how to play, google it, not that hard.

Edit:gotta sleep, bye, thx for the fun games

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/Coffeeman314
πŸ“…︎ Apr 30 2021
🚨︎ report
First to beat me at Ultimate Tic Tac Toe

wins a random free award

http://mck-.github.io/T3/#/10587

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Coffeeman314
πŸ“…︎ Apr 23 2021
🚨︎ report
Ultimate tic tac toe

The game consists of a Large 3x3 board made of small 3x3 boards

Whatever square you move in on a small board sends your opponent to the corresponding square on the big board

eg. centre square moves opponent to centre board, bottom left square moves opponent to bottom left board

once a square on the large board is won/tied, that square is considered occupied

sending someone to an occupied square gives them a free move, anywhere

the goal is to win 3 squares on the large board in a row

beat me for a free award

https://ultimate-t3.herokuapp.com/online-game/r0lof60nby10s4eokcma38fr

Reply so I know who I'm vsing

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/Coffeeman314
πŸ“…︎ Apr 24 2021
🚨︎ report
So I learned that Ultimate tic-tac-toe is a thing and of course wanted to build it in Scrap Mechanic v.redd.it/vsvb5jnqne261
πŸ‘︎ 407
πŸ’¬︎
πŸ‘€︎ u/kiveon
πŸ“…︎ Nov 30 2020
🚨︎ report
Ultimate tic-tac-toe
πŸ‘︎ 69
πŸ’¬︎
πŸ‘€︎ u/Josenobi55555
πŸ“…︎ Dec 08 2020
🚨︎ report
Ultimate Tic Tac Toe

If anyone is not familiar with Ultimate Tic tac Toe, I will insert the Wikipedia page here. It's a game I think deserves a lot more attention than it has, as it's much more in depth than regular TTT, I'm surprised there is not an online community for the game (if there's not one).

If you want to try out the game, I will link an online version here where you can play with a friend or varying difficulties of AI opponents.

Let me know your thoughts on the game. I think it would be cool to have tournaments or something similar for the game.

πŸ‘︎ 15
πŸ’¬︎
πŸ‘€︎ u/MacMinty
πŸ“…︎ Dec 28 2020
🚨︎ report
Ultimate Tic Tac Toe

Hi smart people.

I am trying to build an algorithm to count how many possible wins can an empty board have (after the 15th move for example, an X number of wins, after the 16th, a Y number of wins, etc.. )

However, the solutions seem way too many for my pc to finish in a timely manner (some rough calculations I made suggested about 100 million years to finish).

Now, let's say the players start playing a board, where every single local board is in this shape :

X O X

O E O

X O X

where E means Empty. This means that the final, global board, only has 9 empty spots.

Now, how many possible solutions are there, starting from this template?

and how many solutions would there be if we made the template like this :

X O X

E E O

X O X

Even if rough estimations, please help me solve this problem.

For those unfamiliar with Ultimate Tic Tac Toe rules, you can read up on them here : https://en.wikipedia.org/wiki/Ultimate_tic-tac-toe

πŸ‘︎ 5
πŸ’¬︎
πŸ‘€︎ u/basharshehab
πŸ“…︎ Jan 03 2021
🚨︎ report
3D Printed Ultimate Tic Tac Toe

I've been learning very basic 3D modeling, and I thought what better project than a 3D printed ultimate tic tac toe game!

3D printed Ultimate Tic Tac Toe https://imgur.com/gallery/zauCX2e

Took about 20 hours of print time altogether. Board is setup so that little pieces are recessed enough that the big "winner" pieces can set on top of them. First game we played didn't need any cats game pieces, so now I'm curious how many we'll really need.

My Instagram is @dream3dprintshop

πŸ‘︎ 82
πŸ’¬︎
πŸ‘€︎ u/nathan118
πŸ“…︎ Jan 21 2020
🚨︎ report
ULTIMATE Tic Tac Toe machine! First commandblockless?
πŸ‘︎ 26
πŸ’¬︎
πŸ‘€︎ u/gnomegnelfgnoblin
πŸ“…︎ May 09 2020
🚨︎ report
Ultimate Tic-Tac-Toe

Does the first player have an advantage?

That is my question. Here is the context. I spent a week in the hospital and got released Wednesday. During my stay to pass the time my fellow patients and I would pass the time playing games. UNO and Chess mostly, but I was corrupting my fellow patients and even the staff with Ultimate Tic-Tac-Toe.

To those not in the know. Ultimate Tic-Tac-Toe is a casual form of chess almost. All you need is something to write with and something to write on. Most people know how to play Tic-Tac-Toe, so there is a familiarity to it. How do you play? Make a big Tic-Tac-Toe board. The size of a page. Afterwards make small Tic-Tac-Toe boards inside of each of the squares of the big Tic-Tac-Toe e.g. Now there are two main rules for Ultimate Tic-Tac-Toe. I added another rule which adds a subtle layer to the game. I normally introduce these rules as they become relevant. First rule: Your move dictates where your opponent gets to move. I like to comment and tell new players that due to this rule: you win by forcing your opponent to let you win. That's almost as cruel as screwing over people at UNO. When teaching new players, I tell them to start by selecting any square they want amoung the many mini Tic-Tac-Toe's (I will also refer to these as boards). Whatever square you select on the mini Tic-Tac-Toe dictates where your opponent gets to play. If they picked the center bottom square on a board, then their opponent plays on the center bottom mini Tic-Tac-Toe and vice versa. Under the first rule we keep going, eventually a board will be won by either the x's or the o's. Second rule: If your opponent sends you to a board that is already won or full, then you get a free go onto any board you want. This quickly restricts your options, for typically you wouldn't want your opponent to have a free go regardless if you are sending them to a board you won. As boards are won you win by making a three in a row by winning the boards in that series. Just like regular Tic-Tac-Toe. Unlike regular Tic-Tac-Toe I added a third rule. Third rule: In the event that the board is filled with either full mini Tic-Tac-Toe's or won min Tic-Tac-Toe's from the representative x's or o's, then whoever has the majority of boards won... wins. I added this third rule to curb the chances of a tie, and to allow another strategy where you focus on winning boards rather than getting a three

... keep reading on reddit ➑

πŸ‘︎ 54
πŸ’¬︎
πŸ‘€︎ u/MadErlKing
πŸ“…︎ Oct 12 2019
🚨︎ report
Ultimate Tic Tac Toe imgur.com/gallery/DhGEz
πŸ‘︎ 5k
πŸ’¬︎
πŸ‘€︎ u/DetectiveDeadpool
πŸ“…︎ Oct 27 2014
🚨︎ report
Played a game of Ultimate Ultimate Tic Tac Toe with my friend. The numbers indicate the order we played. Look at move 315, he made an extremely dumb move.
πŸ‘︎ 333
πŸ’¬︎
πŸ“…︎ Nov 05 2018
🚨︎ report
The Ultimate tic tac toe cup flip challenge !! mini addition !! youtube.com/watch?v=3vTGt…
πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/co1coop
πŸ“…︎ Sep 27 2020
🚨︎ report
I have never been so triggered by a game of tic-tac-toe before v.redd.it/qvf27imffd481
πŸ‘︎ 16k
πŸ’¬︎
πŸ‘€︎ u/WiggilinJigle
πŸ“…︎ Dec 08 2021
🚨︎ report
I'm going to play Ultimate Ultimate Ultimate Tic Tac Toe with my friend!
πŸ‘︎ 208
πŸ’¬︎
πŸ“…︎ Nov 06 2018
🚨︎ report
Ultimate Tic Tac Toe with a minimax algorithm

The Github link is here: https://github.com/Hillo111/minimax-for-ultimate-ttt

The other day I found a game called Ultimate Tic Tac Toe. All it really is is tic tac toe in tic tac toe. You can read up on the rules if you want here. A few days before or after I discovered the game I watched a video by nextProgram about his making of a tic tac toe AI. Naturally, I put 1 and 1 together and got 3. Why not just do what he did but ultimately? And so I did. The project idea is more or less simple:

  • A class that contains the game
  • A function for calculating the score
  • The minimax algorithm
  • Present the game with Pygame
  • And a menu with Tkinter

And that's exactly what I did. If you want to play the game, the executable is there. Any review would be much appreciated.

Cheers!

https://github.com/Hillo111/minimax-for-ultimate-ttt

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/Hillo111
πŸ“…︎ Aug 12 2020
🚨︎ report
Tic tac toe
πŸ‘︎ 8k
πŸ’¬︎
πŸ‘€︎ u/Deep-Jump-803
πŸ“…︎ Dec 29 2021
🚨︎ report
Going to play Ultimate Ultimate Ultimate Tic Tac Toe with my friend. I am printing this picture 9 times.
πŸ‘︎ 204
πŸ’¬︎
πŸ“…︎ Nov 05 2018
🚨︎ report
πŸ‘︎ 15k
πŸ’¬︎
πŸ‘€︎ u/OG_Aedeen
πŸ“…︎ Dec 15 2021
🚨︎ report
Help creating a game bot for ultimate tic tac toe

Hi guys, just wanted to ask a question.

So I challenged myself to make a game bot for ultimate tic tac toe ( https://mathwithbaddrawings.com/ultimate-tic-tac-toe-original-post/ ) and so far I at least got a working game. However, I do not know how to implement a bot for this game. I looked through some options but they all seem pretty bad.

  1. Considered using minimax (or negamax, kind of the same thing from what I see), but from what I know the branching factor for this game would be too large to make this feasible even with alpha-beta pruning. To my knowledge there is no proper evalaution function for me to just stop at a certain depth and evaluate the value of that state.

  2. Considered monte carlo tree search but every single resource I found confuses me. I feel like this may be my best bet but perhaps I may run into the same issues as using minimax. Then again maybe I need more research...

  3. Considered using a deep Q network but I feel that since where the available moves are changes every turn it may confuse the network. May be able to use a neural network as an evaluation function for minimax but as I've said, the complexity of the game may confuse the network.

These are all the options I have considered so far. I would consider myself as a beginner-intermediate coder so maybe I'm missing something here or perhaps I'm biting off more than I can chew with this project. I aim to finish this by the end of this year so I hope you guys can help! Thanks! Language I'm using is python 3 by the way.

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/JonTMCF
πŸ“…︎ Dec 16 2019
🚨︎ report
To play tic-tac-toe, one needs to have...

Tactics.

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/Wisd_Om
πŸ“…︎ Nov 12 2021
🚨︎ report
Ultimate Tic-Tac-Toe: Each spot of a tic-tac-toe board is its own game! kongregate.com/games/Curd…
πŸ‘︎ 121
πŸ’¬︎
πŸ‘€︎ u/Curdflappers
πŸ“…︎ Sep 01 2017
🚨︎ report
Played a game of Ultimate Ultimate Tic Tac Toe with my friend. The numbers indicate the order we played. Look at move 315, he made an extremely dumb move. (Higher quality)
πŸ‘︎ 26
πŸ’¬︎
πŸ“…︎ Nov 06 2018
🚨︎ report
Ultimate tic tac toe

The game consists of a Large 3x3 board made of small 3x3 boards

Whatever square you move in on a small board sends your opponent to the corresponding square on the big board

eg. centre square moves opponent to centre board, bottom left square moves opponent to bottom left board

once a square on the large board is won/tied, that square is considered occupied

sending someone to an occupied square gives them a free move, anywhere

the goal is to win 3 squares on the large board in a row

beat me for a free award

https://ultimate-t3.herokuapp.com/online-game/r0lof60nby10s4eokcma38fr

Reply so I know who I'm vsing

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Coffeeman314
πŸ“…︎ Apr 24 2021
🚨︎ report
Ultimate tic tac toe

Anyone wanna play?

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/Coffeeman314
πŸ“…︎ Apr 23 2021
🚨︎ report
Combined Ultimate Tic Tac Toe with the minimax algorithm

At one point I found an interesting game called "Ultimate Tic-Tac-Toe" that I got really into. At around the same time, I was watching a video from nextProgram about a chess AI that used a minimax algorithm. So naturally, my caveman brain put 1 and 1 together and got 3. I watched Sebastian Lague's video about minimax algorithms, made the game, put in the algorithm, and created a menu with tkinter.

The Github link is here for anyone interested in checking out the project. It contains the executable if you're just interested in playing the game

https://github.com/Hillo111/minimax-for-ultimate-ttt

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Hillo111
πŸ“…︎ Aug 12 2020
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.