I created the WORST chess AI (worse than worstfish)

Sdílet
Vložit
  • čas přidán 27. 06. 2024
  • Ready for another description generated by chat? (It's so weirdly energized, yet lifeless. At least it's pretty accurate)
    Welcome to my latest project, where I set out on an unusual mission: to create the worst chess AI imaginable. In this video, I'll walk you through my journey of trying to design an AI that's exceptionally bad at chess, using neural evolution of augmenting topologies (NEAT) and bitboards.
    🧩 The Puzzle: We start with a simple chess puzzle where your goal is to lose as White. Choices like rook a3, rook g3, or king b1 lead to mate in one. But there's a twist - the worst move isn't always obvious!
    🤖 Worstfish Flaw: Discover the flaw I found in Worstfish, the chess bot that always plays the "worst move." This discovery inspired me to create my own AI.
    🛠️ Building the AI: Before making an AI that's great at losing, I needed one that excels at winning. Using NEAT, I attempted to evolve an AI over generations. However, it wasn't as straightforward as I hoped.
    🚀 Optimization Challenges: Learn about the various optimizations I implemented, including bitboards for efficient move calculations, move caching, multi-processing, and selective game play. Despite these improvements, training time was a significant hurdle.
    🤯 Unexpected Outcomes: After optimizing, the AI still struggled, mainly pushing pawns. I tried numerous adjustments, including changing bitboards to an array of values and refining the fitness function, but results were underwhelming.
    🧠 Mini-Max Algorithm: To give the AI better decision-making abilities, I incorporated a mini-max algorithm. However, the complexity of chess proved too much for my NEAT-based approach.
    💡 Lessons Learned: Ultimately, NEAT wasn't suitable for this complex task. Although my AI couldn't master chess, it excelled at our original goal - losing games. It even managed to consistently draw against Worstfish.
    🎬 Join the Journey: Watch as I navigate through the challenges of AI development, share the ups and downs, and finally, pivot towards more promising techniques for future projects.
    Don't forget to subscribe and hit the notification bell to stay updated on my latest videos and projects. Your support keeps me going! See you in the next one.
    Music:
    Summoning Salt - Chris Doerksen
    Zeta - Vincent Rubinetti
    We Shop Song - Lud & Schlatt's Music Emporium
    Cat - C418
    I'll add the Github at SOME POINT in the future... probably...

Komentáře • 68

  • @waz1y
    @waz1y  Před 2 dny +5

    SUBSCRIBE

  • @HarrisonWhite-wi4ns
    @HarrisonWhite-wi4ns Před dnem +23

    I don’t think forcing the opponent to take your material is actually the best strategy to lose the game. I saw a video where a guy “beat” worstfish by gaining a huge material advantage which allowed him to force worstfish to checkmate him. Having more material lets you play more forcing moves, and your only hope of losing to an intelligence that is trying to lose is to force it to checkmate you, so counter-intuitively, you should strive to keep your material.
    I think that a chess ai that is designed to lose would actually look a lot like a normal ai, just with the values for checkmate switched (so that it values itself being checkmated and gives a negative value to checkmating the opponent). It would even still need to worry about king safety, since your opponent can win material by threatening the king.

    • @waz1y
      @waz1y  Před dnem +8

      Yeah, that’s possible, but I think if my AI had worked, it would have implemented that strategy

  • @calvinzhang4323
    @calvinzhang4323 Před 3 dny +50

    I can create this ai by just playing chess

    • @waz1y
      @waz1y  Před 2 dny +6

      A few years ago, I got would get scholars mated every time I played you 😭

    • @detectiveslime2891
      @detectiveslime2891 Před dnem

      well then it would just be i, but I don't think it would be deserving of that

  • @GigaCraft-420
    @GigaCraft-420 Před 17 hodinami +1

    You're underestimating my ability to make the worst possible move

  • @SnowflakeDC
    @SnowflakeDC Před 3 dny +9

    How does this video have so little views?! This was an amazing and interesting video!

    • @waz1y
      @waz1y  Před 3 dny +1

      thanks so much :). I think my title before was really bad, so... It's better now that I changed the title

    • @etl3nne
      @etl3nne Před 2 dny

      REAL.

    • @SnowflakeDC
      @SnowflakeDC Před 17 hodinami

      @@waz1y I see :)

    • @SnowflakeDC
      @SnowflakeDC Před 17 hodinami

      @@waz1y I hope it does better :D

  • @Silver-AG47
    @Silver-AG47 Před 2 dny +46

    Spoilers for video below.
    Failing to make something that always fails, just means your actually just too good. It's like a double negative.

    • @waz1y
      @waz1y  Před 2 dny +3

      Checks out.

    • @RandomBloonStuff
      @RandomBloonStuff Před 2 dny +1

      I hate when a top comment spoilers the video... On mobile it shows you the top comment even if you don't go into the comment section.

    • @waz1y
      @waz1y  Před 2 dny

      RIP

    • @Silver-AG47
      @Silver-AG47 Před dnem

      @@RandomBloonStuff my fault man I'll fix it

    • @RandomBloonStuff
      @RandomBloonStuff Před dnem

      @@Silver-AG47 You didn't need to but good thing that other mobile/new PC layout users won't get spoiled.

  • @wintrcat
    @wintrcat Před 15 hodinami

    This is a fantastic video mate :) well done - I really like your editing style haha

  • @chess_board_consumer

    That was a really nice video well done

  • @pyplioud
    @pyplioud Před dnem

    Such an underrated channel dude, great work!

  • @simonwillover4175
    @simonwillover4175 Před 2 dny +1

    I would love to see you improve this and make it play even worse. Maybe making an AI that somehow knows both worst moves and best moves would be better.

    • @waz1y
      @waz1y  Před 2 dny

      I that would be interesting, though i think the only way to do that would be to have 2 separate AI

  • @Beardash123
    @Beardash123 Před 9 hodinami

    You forgot…..I DONT EVEN KNOW HOW TO PLAY CHESS CORRECTLY!1!1!!1!1!1!!1

  • @Art3141
    @Art3141 Před 2 dny

    Great vid, I hope you can do the AI in the future!

    • @waz1y
      @waz1y  Před 2 dny

      Yeah I would like to come back and explore it at some point

  • @adammetcalf4231
    @adammetcalf4231 Před 2 dny +1

    another Sebastian League in the making!

  • @etl3nne
    @etl3nne Před 2 dny

    only 1k views HOW, i only realised this until the vid was finished but it deserves alot more

  • @ThemeMusicz
    @ThemeMusicz Před 2 dny

    835 views? Underrated! Pls remember me when u are famous

  • @maxwellhunt3732
    @maxwellhunt3732 Před dnem

    I've tried similar types of projects in the past, in general I don't think that NEAT is very well suited for this type of problem. I think the best thing to try here if you don't want a deterministic algorithm like minimax is to try to emulate something like alpha zero. The idea is to train networks both for finding the probability that an individual move will be good, which can be used to do monte-carlo tree search and then having a separate network for evaluating the position at the end of the tree search.

    • @maxwellhunt3732
      @maxwellhunt3732 Před dnem

      Also, how many generations did you go for? What was the population size? Learning such complex behavior can often take a lot of time and computational ressources.

    • @waz1y
      @waz1y  Před dnem

      Yeah, as I said in the video, NEAT just doesn’t cut it for something complicated like chess. I ran it for 300 generations (full day on my pc) and it didn’t improve. Yeah, I was inspired by alpha zero, but alpha zero uses reinforcement learning and not genetic algorithms.

  • @Sodiumax
    @Sodiumax Před dnem

    Try using deep reinforcement learning or reinforcement learning. I would love to see this chess Ai become good!

    • @waz1y
      @waz1y  Před dnem

      Yeah i would like to at some point

  • @hk2dchannel658
    @hk2dchannel658 Před 18 hodinami

    Isn't the worst chess engine the one with the (Losses/games)*100 ratio? If that's the case, isn't the ai that moves only the first move and then waits until the timer runs out the worst?

    • @waz1y
      @waz1y  Před 18 hodinami

      okay, technically true, but if we don't make the assumption that they have to move in a certain amount of time and they are not allowed to resign, it's kind of pointless

  • @Superhirn
    @Superhirn Před 15 hodinami

    Bro you are so underrated! I thought you had at least 100 k subs lol

  • @SpaceUK45
    @SpaceUK45 Před dnem +1

    4:21 thought that was carykh

    • @waz1y
      @waz1y  Před dnem

      Oh hell nah, I look nothing like him

  • @antoniomonteiro3698
    @antoniomonteiro3698 Před 17 hodinami

    the foreground music is too laud, the background voice is to low. :)

  • @heymajoris
    @heymajoris Před dnem

    Yeah the NEAT algorithm is cool and all but it doesn't really work well for most complex situations, it also takes too long to learn. There's a variation of the NEAT algorithm called HyperNEAT, maybe that's better?

    • @waz1y
      @waz1y  Před dnem

      Cool, I’ll look into it

  • @PolishProgrammer
    @PolishProgrammer Před dnem

    Maybe changing how the ai outputs it's moves would help

    • @waz1y
      @waz1y  Před dnem

      Like directly outputting moves instead of an evaluation?

    • @PolishProgrammer
      @PolishProgrammer Před dnem

      ​@@waz1y I didn't quite catch in the video how the first version chose it's moves, but input and output methods should have great impact on performance. But maybe evaluation with RL would do the trick, since evaluation is a simple single output

    • @PolishProgrammer
      @PolishProgrammer Před dnem

      Also don't think it's implementable in the current genetic method, but using a CNN (like in visual classification) would probably benefit it. Same with normalizing the input range to something like -1 to 1 (values show in visualisation ranging from +inf to 0 aren't too good)

    • @waz1y
      @waz1y  Před dnem

      @@PolishProgrammer that’s exactly how it’s implemented but with neat instead of rl

    • @PolishProgrammer
      @PolishProgrammer Před 21 hodinou

      ​@@waz1y so I guess the training method was the biggest bottleneck
      Edit: great video either way

  • @geraliks
    @geraliks Před 3 dny

    good video!

  • @SmudgleGaming
    @SmudgleGaming Před dnem

    nice, now use reinforcement learning

  • @louisliu6396
    @louisliu6396 Před dnem

    I bet I can lose to your ai

    • @waz1y
      @waz1y  Před dnem

      Calvin said the same thing lmao

  • @Moshinoki
    @Moshinoki Před dnem

    The bgm is louder than your voice.......

  • @KingBob_Stinky
    @KingBob_Stinky Před dnem

    The only CZcamsr that replies on almost every comment. Total goat!
    Don’t zoom in on my pfp 💀

    • @waz1y
      @waz1y  Před dnem

      I only don’t reply to the negative ones >:)

  • @ericmollison2760
    @ericmollison2760 Před 8 hodinami

    Respect for trying. I imagine it would be super hard to train since stalemate would be very likely when it does begin to figure things out. Maybe you could cheat by changing the game. For example, minichess: en.wikipedia.org/wiki/Minichess
    Or make something else up. It would at least work for a proof of concept.

  • @nikos.r
    @nikos.r Před dnem

    Minecraft music is fire

  • @music-zv6je
    @music-zv6je Před dnem +1

    aren't you just recreating antichess by this point lmao (except for forced captures)

    • @waz1y
      @waz1y  Před dnem +1

      Yeah, main difference is that captures are not forced and you still have to get checkmated to win

    • @music-zv6je
      @music-zv6je Před 21 hodinou

      @@waz1y video idea (won't do it myself cause i'm not that smart):
      The Four Horsemen of Chess Engine Strategies
      1. Stockfish
      The engine that tries to win, assumes the opponent is also trying to win (normal chess)
      2. Worstfish
      The engine that tries to lose, assumes the opponent is trying to win
      3. Your AI
      The engine that tries to lose, assumes the opponent is also trying to lose ("soft" antichess)
      4. ???
      The engine that **tries to win, assumes the opponent is trying to lose**
      The last one would be really interesting, it would basically think you're gonna blunder all the time, and would keep trying to set up positions where you can sac everything, or worsen your position. It would be like the best friend for Worstfish trying to lose. No idea how "well" it'd actually play in normal terms tho
      also they could all be pitted to play against each other, that'd be very neat to see

    • @waz1y
      @waz1y  Před 21 hodinou

      haha that'd be funny to see

  • @knowledgeablekaleb
    @knowledgeablekaleb Před 2 dny +1

    This vid has 69 likes 💀💀

  • @dvorakgigachad1444
    @dvorakgigachad1444 Před dnem

    clickbait >:( you should modify stockfish instead of using AI