I made an (unstoppable) ULTIMATE Tic-Tac-Toe AI

Ғылым және технология

A lot of people make minimax AIs for tic-tac-toe, but that's kind of boring, so I made one for ultimate tic-tac-toe. It's (as of now) beatable, but it's quite difficult to win, and with some improvements it will probably be perfect. To twist it up a bit more, instead of making it in python (like a lot of people do), I made it in javascript, so you can play it in your browser.
Sebastian Lagues video on Minimax: • Algorithms Explained -...
Link to itch page: Will post soon, I just have a bunch of exams and have to fix a few more bugs.
0:00 - Intro
0:25 - Ultimate Tic Tac Toe
1:59 - Minimax
3:50 - The issue
5:33 - Attempt #1
7:29 - Attempt #2
9:14 - Attempt #3
12:03 - Game Over

Пікірлер: 20

  • @zesardine2613
    @zesardine26132 жыл бұрын

    Hey all! I finally decided to come back to this project, and I'm pretty sure I managed to fix all the issues the game has. The code is now available on GitHub, along with some side notes that I wrote. Here's the link: github.com/zesardine/UltimateTicTacToeAI

  • @galileodirectio

    @galileodirectio

    2 жыл бұрын

    Thank you for doing this! I am making this game and an ai for it as an accademic project (extra credit simester stuff) and this video has been great at helping me shape the way I want to approch the ai bit. Thanks a lot!!!

  • @gmonge6251
    @gmonge62513 жыл бұрын

    Thank you for this video, I was doing the exact same thing, making an AI to play Ultimate Tic-Tac-Toe and was stuck and your video helped a lot.

  • @cros108
    @cros1082 жыл бұрын

    Hi, a few days ago I started making an ultimate tic tac toe engine of my own, cool to see others doing the same!

  • @aderitosilvachannel
    @aderitosilvachannel2 жыл бұрын

    You deserve to have more views in your video. Great video!

  • @Supware
    @Supware Жыл бұрын

    Great video, seen it a couple times now :p I've been consumed by this game the last few days for some reason, and decided to try make my own AI. Totally new to minimax and board game AI in general, so it's been a steep learning curve (always found writing recursive functions super confusing)...! Though I do have a couple ideas I'm excited to try out once I get the recursion working -- my static eval function knows about forcing moves, which should(?) reduce required depth in most critical positions (i.e. returning +/- inf if it recognises that a player is in zugzwang). I imagine this should only be called when at least one player is very close to winning; in the same vein, I'd also like to try swapping out the eval function for another, or even just tweaking its values, based on the current phase of the game (e.g. the "zugzwang test" I just mentioned is only called in the "endgame", and isn't there something to be learned by pitting different opening algs against each other...?). Would love to talk if you're still interested in the project!

  • @zesardine2613

    @zesardine2613

    Жыл бұрын

    Hey! I was also quite new to minimax when I made this project (it was a bit of a fun challenge, you know), and I do agree that recursive functions are extremely confusing :D To be honest, it seems like your approach is far more organized than mine ever was, and I think most of my thought process was documented in the video (that's really about as much help as I can provide on this topic :D). I wish you the best of luck!

  • @vanminh4502
    @vanminh45028 ай бұрын

    Very nice video, what if I want to change the ai to 1, which parts do i need to change? thank you

  • @stront4469
    @stront4469 Жыл бұрын

    so for every empty slot you let the minimax algoritm give it a score, and then you just pick the slot with the highest score? so when you take the score board on 13:00, you would have picked the slot with score 5 (right center, and than the center slot)?

  • @dodongogaming5526
    @dodongogaming5526 Жыл бұрын

    I would despratly need, for school project, your final evaluation function in attempt 3.

  • @cokomairena
    @cokomairena8 ай бұрын

    I would like to see an ultimate tictactoe zero bot

  • @luongminhduy9373
    @luongminhduy93732 жыл бұрын

    12:54 I can't understand why you have this board, how do you add score to it? Can you explain it in details?

  • @zesardine2613

    @zesardine2613

    2 жыл бұрын

    Hey! Basically, the AI runs minimax on every empty square, meaning that one by one, it plays on all the squares and sees how the game will evolve after that move, looking some amount of moves ahead. Based on how it evolves, it gives the square an evaluation. Finally, it chooses to play on the square with the best resulting evaluation. It's basically the same thing that happens with a normal tic-tac-toe minimax AI, except there's 81 squares it needs to go through.

  • @user-gu4ob5ol6e
    @user-gu4ob5ol6e2 жыл бұрын

    there is a way to convert this amazing into desktop app?

  • @jennyc642
    @jennyc6423 жыл бұрын

    Post itch page!

  • @zesardine2613

    @zesardine2613

    3 жыл бұрын

    Hey, I feel like it was about time to address why no link has been posted yet, and your comment gives me an opening for that. Long story short, the AI doesn't work quite as perfectly as I thought it did. Sure, it wins a lot of the time, but it's not even close to an unbeatable AI, which is kind of what I wanted to create. I got caught up in the video production so much that I only did thorough testing after releasing it, which was frankly a hasty decision. I intermittently tried to go back to fix the bugs I thought were present, but honestly I got burnt out quite fast, and moved on to other projects. I kept the video up because I'm quite sure that the logic is correct, my code is just not the right representation of that logic, and I don't want to release a project in that kind of a state. I'll eventually try to come back to it, or at least post a GitHub link to the code I have, but probably not in the near future, I'm sorry.

  • @user-di6wf9fs7t

    @user-di6wf9fs7t

    2 жыл бұрын

    @@zesardine2613 is it possible if you could personally send the code (even if it doesnt work right)

  • @ViliamF.
    @ViliamF.4 ай бұрын

    0:49 Hey! X goes first, not O. What is this nonsense...

Келесі