I created the WORST chess AI (worse than worstfish)
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...
SUBSCRIBE
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.
Yeah, that’s possible, but I think if my AI had worked, it would have implemented that strategy
I can create this ai by just playing chess
A few years ago, I got would get scholars mated every time I played you 😭
well then it would just be i, but I don't think it would be deserving of that
You're underestimating my ability to make the worst possible move
How does this video have so little views?! This was an amazing and interesting video!
thanks so much :). I think my title before was really bad, so... It's better now that I changed the title
REAL.
@@waz1y I see :)
@@waz1y I hope it does better :D
Spoilers for video below.
Failing to make something that always fails, just means your actually just too good. It's like a double negative.
Checks out.
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.
RIP
@@RandomBloonStuff my fault man I'll fix it
@@Silver-AG47 You didn't need to but good thing that other mobile/new PC layout users won't get spoiled.
This is a fantastic video mate :) well done - I really like your editing style haha
That was a really nice video well done
Such an underrated channel dude, great work!
Thanks!
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.
I that would be interesting, though i think the only way to do that would be to have 2 separate AI
You forgot…..I DONT EVEN KNOW HOW TO PLAY CHESS CORRECTLY!1!1!!1!1!1!!1
Great vid, I hope you can do the AI in the future!
Yeah I would like to come back and explore it at some point
another Sebastian League in the making!
only 1k views HOW, i only realised this until the vid was finished but it deserves alot more
835 views? Underrated! Pls remember me when u are famous
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.
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.
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.
Try using deep reinforcement learning or reinforcement learning. I would love to see this chess Ai become good!
Yeah i would like to at some point
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?
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
Bro you are so underrated! I thought you had at least 100 k subs lol
Great vid also
4:21 thought that was carykh
Oh hell nah, I look nothing like him
the foreground music is too laud, the background voice is to low. :)
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?
Cool, I’ll look into it
Maybe changing how the ai outputs it's moves would help
Like directly outputting moves instead of an evaluation?
@@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
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)
@@PolishProgrammer that’s exactly how it’s implemented but with neat instead of rl
@@waz1y so I guess the training method was the biggest bottleneck
Edit: great video either way
good video!
Thanks :)
nice, now use reinforcement learning
I bet I can lose to your ai
Calvin said the same thing lmao
The bgm is louder than your voice.......
The only CZcamsr that replies on almost every comment. Total goat!
Don’t zoom in on my pfp 💀
I only don’t reply to the negative ones >:)
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.
Minecraft music is fire
aren't you just recreating antichess by this point lmao (except for forced captures)
Yeah, main difference is that captures are not forced and you still have to get checkmated to win
@@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
haha that'd be funny to see
This vid has 69 likes 💀💀
💀
clickbait >:( you should modify stockfish instead of using AI