I Made a Weird Chess AI from Scratch

  Рет қаралды 286,819

nextProgram

nextProgram

Күн бұрын

I made an algorithm that can play you in chess in Python. It uses the minimax algorithm with alpha-beta pruning. I ended up creating a custom chess engine for it that works okay.
I considered using Java and Javascript for this but decided against it for some reason. Another way to approach this is to use machine learning, neural networks, or some other form of artificial intelligence. This was a similar process to my tic tac toe video, which goes a lot more into the detail of how a program like this is made.
This video was loosely inspired by Code Bullet's "I Created an AI to Play Chess" video. The next video will be a Keeper devlog.
Follow me on Twitter! / nextprogramyt
Support me on Patreon! / nextprogram
Join the Discord! discord.me/nextprogram (if link doesn't work, check newer video)
(Next Program)

Пікірлер: 1 000
@nextProgram
@nextProgram 4 жыл бұрын
This video took like 70 hours to make :)
@KindagoodAtguitar
@KindagoodAtguitar 4 жыл бұрын
😳 wow that’s very impressive. You clearly put lots of effort into your videos and I’m glad you’re getting the well deserved recognition!
@swordyboiii260
@swordyboiii260 4 жыл бұрын
Very big oof size
@ambersage3205
@ambersage3205 4 жыл бұрын
Good job!
@Daniel-gu1gt
@Daniel-gu1gt 4 жыл бұрын
Can u do a face reveal after 10k subs
@meeverse875
@meeverse875 4 жыл бұрын
#youtubeputallthisdudesvideosinrecommendedsohegetslotsofnewsubsbecauseheisawsomeandmakesamazingcontent that is hard to read
@clavesi
@clavesi 4 жыл бұрын
Ahh, the programmer's paradox: That which seems the simplest takes the longest and that which seems the hardest takes a minute.
@nextProgram
@nextProgram 4 жыл бұрын
clavesi very true
@IronDizaster
@IronDizaster 4 жыл бұрын
That's probably because computers are extremely good at what we are bad at, but extremely bad at what we are good at
@Supreme_Lobster
@Supreme_Lobster 4 жыл бұрын
"ah yeah, writing a function that checks for when a 'check mate' state occurs is gonna be easy, about 5 minutes" Literally takes a week to do it
@fahdv2597
@fahdv2597 4 жыл бұрын
how dfq does that make any sense
@NStripleseven
@NStripleseven 4 жыл бұрын
Well, normally, unless you expect it to. Then it does what it seems like, so that when you pick the complex-seeming thing, it is complex.
@JelleVermandere
@JelleVermandere 4 жыл бұрын
Great video! That little game you made called “chess” could definitely take off.
@nextProgram
@nextProgram 4 жыл бұрын
Yeah I think it has some potential haha
@OrangeC7
@OrangeC7 4 жыл бұрын
@@nextProgram I think it really benefits from its roots in the structure of old medieval governments, which should make it quite relatable for a lot of people from the western world. Perhaps you could make a similar version of it that could reel in more eastern cultures as well? You could call it "shogi".
@grapehool7699
@grapehool7699 4 жыл бұрын
@@nextProgram I sense sarcasm
@nottheboi3518
@nottheboi3518 4 жыл бұрын
CheSs is AlrEadY a gAmE yoU stUpId
@cybertak4195
@cybertak4195 4 жыл бұрын
Not The boi r/wooosh
@someone58932
@someone58932 4 жыл бұрын
*if(aboutToLose):* *dont()* The best code in existence, just don't forget your functions.
@barrrakudam
@barrrakudam 4 жыл бұрын
If(about To Win) : do()
@someone58932
@someone58932 4 жыл бұрын
@@barrrakudam Functions/Variables do not have spaces, try using underscores. (_)
@clonefighter1996
@clonefighter1996 4 жыл бұрын
@@someone58932 if(aboutToWin): do()
@someone58932
@someone58932 4 жыл бұрын
@@clonefighter1996 better
@asteroidX
@asteroidX 4 жыл бұрын
Fun fact, dont( ) is a recursive function 🤣
@supernukey419
@supernukey419 4 жыл бұрын
“I made my own engine.” You poor soul.
@chappie3642
@chappie3642 4 жыл бұрын
I'm making one too. (I think I'm going insane please help me)
@ptato3010
@ptato3010 4 жыл бұрын
@@chappie3642 stop For your own sanity
@tla9231
@tla9231 4 жыл бұрын
@@ptato3010 No he has to do it, to become a man.
@ptato3010
@ptato3010 4 жыл бұрын
@@tla9231 He's gonna die if he does! We can't loose another one... Not like this... Not like this...
@tla9231
@tla9231 4 жыл бұрын
@@ptato3010 It's too late, he already did it. Now he either dies or succeeds. It's for the greater good.
@ninjatek2241
@ninjatek2241 4 жыл бұрын
"95% of the time that a novice programmer complains that something is 'terrible to use', it's because they don't know what they're doing." ... "Anyway, pygame is terrible to use." lololol
@iminni3459
@iminni3459 4 жыл бұрын
To be fair could probably be waay wore beginner friendly
@ekremdincel1505
@ekremdincel1505 4 жыл бұрын
Just use pyglet instead of pygame
@ShitpostHeaven
@ShitpostHeaven 4 жыл бұрын
lelelelelelel
@Supreme_Lobster
@Supreme_Lobster 4 жыл бұрын
I don't like Java for exactly that reason lol
@ninjatek2241
@ninjatek2241 4 жыл бұрын
@@ekremdincel1505 What is pyglet? I've never heard of it
@greenmario3011
@greenmario3011 4 жыл бұрын
Imagine still playing Chess when Chess 2 has been out for years
@nextProgram
@nextProgram 4 жыл бұрын
Green Mario True
@noyz-anything
@noyz-anything 4 жыл бұрын
wait where
@greenmario3011
@greenmario3011 4 жыл бұрын
@@noyz-anything en.m.wikipedia.org/wiki/Chess_2:_The_Sequel
@rockman7perez
@rockman7perez 3 жыл бұрын
@@greenmario3011 Wait, are you saying D&D is not the sequel to chess?
@ashleybyrd2015
@ashleybyrd2015 3 жыл бұрын
@@rockman7perez Yea, dungeons and dragons is actually the sequel to snakes and ladders.
@ninjatek2241
@ninjatek2241 4 жыл бұрын
*Sees the thumbnail* Me: This man is a genius.
@ericfleet9602
@ericfleet9602 4 жыл бұрын
Watches the video: Oh... never mind.
@ineedanewytname
@ineedanewytname 4 жыл бұрын
You see this, this content right here? Yeah it’s called quality content. Just saying
@trashamedly2794
@trashamedly2794 4 жыл бұрын
ez dub
@beri4138
@beri4138 4 жыл бұрын
He talked 5 minutes about bullshit that no one cares about and 1 minute about his program, how is this quality??
@ineedanewytname
@ineedanewytname 4 жыл бұрын
Don’t question it :)
@leovaris8738
@leovaris8738 4 жыл бұрын
As a person who has made a real chess engine, I can say that there's million things to add to this. For example AB-pruning, null move, bitboards, proper rules, transposition tables, opening books, uci protocol. And just switch to C++
@joshuascholar3220
@joshuascholar3220 4 жыл бұрын
I gave up in pain at 4 minutes. Did he mention perft?
@olivergraf1360
@olivergraf1360 4 жыл бұрын
@@joshuascholar3220 Oh god I remember that when I programmed an engine and it had so many random tiny errors in the move generation function, for example capturing en passant but then discovering an attack on your own king was somehow possible... Don't ask me...
@knox1392
@knox1392 4 жыл бұрын
okay nerd /s
@MateusSFigueiredo
@MateusSFigueiredo 4 жыл бұрын
Searching null move now
@2kofawsome
@2kofawsome 4 жыл бұрын
When he talked about how he wrote the engine so quick it caused my physical pain considering how bad it is, great content though
@ataud9754
@ataud9754 4 жыл бұрын
This dude: What am I some kind of nerd? Also this dude: *programs a chess engine from scratch *
@shinjukim8576
@shinjukim8576 4 жыл бұрын
When the title says scratch, but he doesn't make it using scratch sad scratch noises
@turniue
@turniue 4 жыл бұрын
Was looking for this comment, someone should use scratch to do this I'll probably end up doing it
@johneaves23
@johneaves23 4 жыл бұрын
It should take about 3 hours to make a decent chess move... but it will be worth it.
@want-diversecontent3887
@want-diversecontent3887 4 жыл бұрын
John Eaves I made a 256 bit integer and it slows down at about 2000
@Despacitoian
@Despacitoian 4 жыл бұрын
Shinju Kim scratch is really bad tbh. It would take like 10 days to actually even make a really bad chess bot
@karai5082
@karai5082 4 жыл бұрын
SCRATCH IS GARBAGE!
@aidanthird
@aidanthird 4 жыл бұрын
that feeling when a chess ad plays before this chess video
@nextProgram
@nextProgram 4 жыл бұрын
🤔
@aidanthird
@aidanthird 4 жыл бұрын
@@nextProgram yes (insert that emoji) indeed
@powerofthec5908
@powerofthec5908 4 жыл бұрын
Google is spying on you lol.
@animationgamer3564
@animationgamer3564 4 жыл бұрын
@@aidanthird I think this vid only has 2 ads in the start and in the end ·-·
@aidanthird
@aidanthird 4 жыл бұрын
@@animationgamer3564 yes and the ad played right before this video
@Jhonxay
@Jhonxay 4 жыл бұрын
Next time make a weird chess AI *IN* Scratch.
@voidpickle5684
@voidpickle5684 4 жыл бұрын
Mad Mew Mew cool,can you make a physics engine(I can’t)
@Larree17
@Larree17 4 жыл бұрын
Angry Pickle? _gestures vaguely at GriffPatch’s tutorial project_ (I think that’s the name)
@voidpickle5684
@voidpickle5684 4 жыл бұрын
Larree I know,I was just wondering how good she/he is
@voidpickle5684
@voidpickle5684 4 жыл бұрын
Mad Mew Mew so you’re not as good as you said
@adrake1
@adrake1 4 жыл бұрын
@Mad Mew Mew Chess is 100% possible in scratch and has been made several times in the last 10 years. Personally, I've made a full Texas Hold'em Poker emulator in it.
@qxt-so3qi
@qxt-so3qi 3 жыл бұрын
When will you upload the next devlog video
@nextProgram
@nextProgram 3 жыл бұрын
Hopefully in the next couple weeks!
@TVSh0rts
@TVSh0rts 4 жыл бұрын
Please nerf the Queen, chess players haven't received any update for hundred years.
@alexfresh8951
@alexfresh8951 4 жыл бұрын
Hahahaha
@nextProgram
@nextProgram 3 жыл бұрын
Disenchantedcard GD Lol
@bearkybearky3694
@bearkybearky3694 4 жыл бұрын
I love how you called the bishop the fancy pawn
@derkach7907
@derkach7907 4 жыл бұрын
chess grandmaster watching those chess games be like:" pathetic"
@beri4138
@beri4138 4 жыл бұрын
I'm not a grandmaster but these games are advanced stupid. Like 3rd stage stupid.
@joshuabaker2833
@joshuabaker2833 4 жыл бұрын
Was listening to Queen and saw this clicked on it straight away
@nextProgram
@nextProgram 4 жыл бұрын
Wow that's saying something
@joshuabaker2833
@joshuabaker2833 4 жыл бұрын
@@nextProgram its is, cant wait for next video
@mateczink1026
@mateczink1026 4 жыл бұрын
W H O A S K E D
@joshuabaker2833
@joshuabaker2833 4 жыл бұрын
@@mateczink1026 not you i was saying it to @nextProgram
@want-diversecontent3887
@want-diversecontent3887 4 жыл бұрын
W H O A S K E D
@BekeroParyin
@BekeroParyin 4 жыл бұрын
This reminds me a lot of a chess engine I made in high school, I went through a lot of the same steps as you did, although mine recognized checkmate by not playing when the evaluation passed the value of the king. It ended up much weaker than I had hoped, but it did beat one of my friends so I was happy. Thank you for your videos!
@lukewagner158
@lukewagner158 4 жыл бұрын
This is so cool! I tried this project a couple weeks ago, but decided to quit since I know barely any python and know nothing about machine learning. Anyway, it’s cool to see someone who made it work.
@Iamveryconfusedabout
@Iamveryconfusedabout 4 жыл бұрын
it's always fun to find a new channel to watch I should know, I'm subscribed to more than 750 of them
@irongolem5539
@irongolem5539 3 жыл бұрын
fun right
@MuddyPuddle
@MuddyPuddle 4 жыл бұрын
Just found this channel a few hours ago and now I've watched all your videos and subscribed. Hope you upload another video soon.
@peschebichsu
@peschebichsu 3 жыл бұрын
Wow I love your video! Interesting and funny too. The fancy pun got me the most xD
@nextProgram
@nextProgram 3 жыл бұрын
Glad you enjoyed it!
@Brendakye2468
@Brendakye2468 4 жыл бұрын
So as someone with a little more experience programming and has even done a lot of work in pygame... Pygame sucks
@Nettakrim
@Nettakrim 4 жыл бұрын
Can confirm!
@powerofthec5908
@powerofthec5908 4 жыл бұрын
Yes
@tacokoneko
@tacokoneko 4 жыл бұрын
lwjgl is better
@Kugelschrei
@Kugelschrei 4 жыл бұрын
It doesn't suck, it really depends on what you are trying to do. Its just a simple drawing library basically, if that's what you need pygame will get you there pretty straight forward. Nothing really "sucks" that works. It's just a matter of when to use it.
@subzeronitro4686
@subzeronitro4686 4 жыл бұрын
I’ve never had a real problem with it
@imnotfuckingusingthisaccou2574
@imnotfuckingusingthisaccou2574 4 жыл бұрын
The thumbnail: “Oh yeah, it’s big brain time”
@ramonpg98
@ramonpg98 3 жыл бұрын
Can't wait to see your next video!! I really love your content and how good it is, it makes my day. Hoping to see you soon over here!
@nextProgram
@nextProgram 3 жыл бұрын
Thank you so much!
@samdietz2673
@samdietz2673 4 жыл бұрын
I recently did an assignment on game trees and AI. I used a minimax algorithm and I related so hard when you said “mentally preparing myself before looking at code”
@swordyboiii260
@swordyboiii260 4 жыл бұрын
Make this ai a minigame in your game, and make it so it gives you a prize for beating it!!!!
@nextProgram
@nextProgram 4 жыл бұрын
Haha cool idea
@ARMcPro
@ARMcPro 4 жыл бұрын
yea some sort of an npc that won't let you pass till you beat him
@brazgazz
@brazgazz 4 жыл бұрын
@@nextProgram haha *_Do it_*
@Corbnorb
@Corbnorb 3 жыл бұрын
When’s the next vid?
@nextProgram
@nextProgram 3 жыл бұрын
In a few weeks hopefully!
@Corbnorb
@Corbnorb 3 жыл бұрын
@@nextProgram ok :)
@doxed64
@doxed64 4 жыл бұрын
It’s always nice to sit back and look at code you have created, and compare a compact algorithm to a class.. I like the patterns in the code c:
@nextProgram
@nextProgram 3 жыл бұрын
True!
@sr-qu9xd
@sr-qu9xd 4 жыл бұрын
I just listen to your 4 last video, that's nice. You make easy explanation if I can say. It is fun to watch your progress in programming your game and you got a great voice to listen. Your game look nice but I hope to see some gameplay with enemy. Keep up the good works!
@nextProgram
@nextProgram 4 жыл бұрын
Thanks for watching!
@echo5172
@echo5172 4 жыл бұрын
“Sorry that was a dumb intro” You LIE!
@ElTovarish
@ElTovarish 4 жыл бұрын
2:51 "oh, BTW, this don't support moves like casting or l'passante... " Me:I think that's ok, just start with the basics and- "or checkmate" Me: Wha..?
@foxer4217
@foxer4217 3 жыл бұрын
This is so impressive it’s insane! I love watching people code, it’s so satisfying.
@nextProgram
@nextProgram 3 жыл бұрын
Thanks :)
@fahd2372
@fahd2372 8 ай бұрын
Normally I don't like videos like these but this one I enjoy :) It's not overly dramatic with the jokes, you explain the issues you faced and sacrifices you had to take overall it's just a really humble video made by a transparent and honest creator. Not like most other youtubers who try to paint themselves under some perfect light. Well done!
@stiky5972
@stiky5972 4 жыл бұрын
"Chess" is going to be *revolutionary!*
@Philyshark7
@Philyshark7 4 жыл бұрын
"The fancy pawn" 😂🤣
@joaquimsartoridesouzacampo301
@joaquimsartoridesouzacampo301 4 жыл бұрын
I didn’t know this channel but it’s awesome . Congratulations man
@jackbuckham7435
@jackbuckham7435 4 жыл бұрын
You are definitely a super underrated KZbinr. You should have triple the amount of subscribers
@MrSpiky
@MrSpiky 4 жыл бұрын
"But then I decided that Python was better to use, because I found a library with an already made chess engine" - nextProgram 2020
@edo6192
@edo6192 4 жыл бұрын
Nah, it was an ok intro
@scottbigbrain3944
@scottbigbrain3944 3 жыл бұрын
Sweet man. Sweet. And I can totally sympathize with creating an environment for your agent taking more time than making the agent itself. Kudos man.
@nextProgram
@nextProgram 3 жыл бұрын
Absolutely!
@nahimccreal
@nahimccreal 3 жыл бұрын
There are so many game devs that are sprouting up and showing how they made their indie games and it's so cool to see. Welcome to the cool game devs table and keep trying new things cause that's how you get better and better :) 👍
@apoorrvs
@apoorrvs 4 жыл бұрын
KZbin's algorithm blessed me with your channel.
@nextProgram
@nextProgram 4 жыл бұрын
Welcome!
@dylanjcondron
@dylanjcondron 4 жыл бұрын
“The horsey” Me: it’s called a knight “Fancy pawn that can’t jump over stuff” That’s called a bishop
@maroonshaded
@maroonshaded 4 жыл бұрын
In my language it's actually called a horse lol
@brazgazz
@brazgazz 4 жыл бұрын
It's called a ponyhorse and bunnyrabbit
@tobiasgorgen7592
@tobiasgorgen7592 4 жыл бұрын
In German it's a jumper. Let that sink in
@Rumpael
@Rumpael 4 жыл бұрын
In Russian, a bishop is an elephant
@shadowkiller9860
@shadowkiller9860 4 жыл бұрын
Hey! Nice video! Most of the chess engines base themselves by a *very* complicated minimax algorithm, have lots of chess openings and fundamentals pre-installed, and have specific processors made just for them. All of this said, there is a new chess AI designed by OpenAI called alphazero, that played against itself for 4 hours, and managed to beat the hell out of all the chess engines. And there is another one, called LelaChess Zero, which is the "indie" version of alphazero, and with 1 year of community training it is already a very skilled chess AI that managed to almost beat Stockfish 8, the best engine out there. Just saying some random stuff lol
@nextProgram
@nextProgram 4 жыл бұрын
Shadow Killer Interesting!
@shadowkiller9860
@shadowkiller9860 4 жыл бұрын
@@nextProgram Keep up with the great work!
@AAA-de6gt
@AAA-de6gt 4 жыл бұрын
It didn't 'almost' beat Stockfish 8, it outright beat the strongest version of Stockfish.
@ErenMortel
@ErenMortel 4 жыл бұрын
this is great cause pogchamps is currently happening and youtube recommended your video to me, and it was good
@nasuhdebaz390
@nasuhdebaz390 4 жыл бұрын
noice thumbnail, noicer video
@nextProgram
@nextProgram 4 жыл бұрын
Appreciate it!
@AJBooker
@AJBooker 4 жыл бұрын
that thumbnail haha love it
@nextProgram
@nextProgram 4 жыл бұрын
Yeah this video has been in development for months haha. I had a lot of time to come up with dumb jokes lol
@philippengemann5497
@philippengemann5497 4 жыл бұрын
That is an amazing video! Thanks for all you work.
@nextProgram
@nextProgram 4 жыл бұрын
Thanks for watching!
@tutmo
@tutmo 4 жыл бұрын
You’re awesome man! Already coming up on 10k subs?! Nice👌
@Akitta
@Akitta 4 жыл бұрын
You know your early when the video doesn't even have 500 views yet.
@ncoll36
@ncoll36 4 жыл бұрын
He's a smaller KZbinr, that's not really uncommon. It's 9hrs later and the video isn't at 3k yet.
@vianelloalessi766
@vianelloalessi766 3 жыл бұрын
where did you go? why you haven't uploaded videos for 4 months?
@nextProgram
@nextProgram 3 жыл бұрын
I'll be back soon!
@vianelloalessi766
@vianelloalessi766 3 жыл бұрын
@@nextProgram thanks
@easternteasers1127
@easternteasers1127 4 жыл бұрын
pls continue to make these kind of videos
@zeFresk
@zeFresk 4 жыл бұрын
As someone who just created a chess engine last week and made a whole program with python-chess, I'm happy seeing I'm not the only one struggling !
@hiddensinix2767
@hiddensinix2767 4 жыл бұрын
Damn this was cool and all man but... what’s a chess?
@nextProgram
@nextProgram 4 жыл бұрын
Lee Doyle Dude i wish i knew
@fqidz
@fqidz 4 жыл бұрын
"i cheched on yahoo and..." *google.com* LIAR
@nextProgram
@nextProgram 4 жыл бұрын
;)
@Zenith_YT
@Zenith_YT 4 жыл бұрын
Cant wait tell next devlog
@nextProgram
@nextProgram 4 жыл бұрын
Soon!
@hw2007
@hw2007 3 жыл бұрын
I love the thumbnail: If about to lose, DONT
@bear4304
@bear4304 3 жыл бұрын
"Now the ai can play a masterful game of chess" *ai plays a5*
@abhirajx1710
@abhirajx1710 2 жыл бұрын
The best part was the thumbnail which could be seen from outside the video
@kyletaylor1151
@kyletaylor1151 4 жыл бұрын
i was expecting it to be like if the ai is about to lose it flips the board or a gust of wind comes along
@EpicVideoGamer7771
@EpicVideoGamer7771 4 жыл бұрын
If you continue this project, you should add a delay before the opponent's move to make it more realistic. Also, when a piece is moved, it should quickly slide across the screen to the chosen square. Nice vid :)
@EpicVideoGamer7771
@EpicVideoGamer7771 4 жыл бұрын
thx for the heart :D
@nextProgram
@nextProgram 4 жыл бұрын
Cool idea!
@koffy_retired
@koffy_retired Жыл бұрын
"The fancy pawn that can move diagonally but not jump over pieces." See now if we all described Bishops like this, Chess would be solved by now.
@pugchamp1795
@pugchamp1795 4 жыл бұрын
nextProgram upload, must watch now
@nextProgram
@nextProgram 4 жыл бұрын
;)
@LeoStaley
@LeoStaley 4 жыл бұрын
Did you see SuckerPinch's video on 30 weird chess algorithms? This feels like a fun companion video to that. I have no doubt that KZbin recommended this video to me because I have watched that one like 5 times. New sub!
@nextProgram
@nextProgram 4 жыл бұрын
Thanks, I'll check it out!
@LeoStaley
@LeoStaley 4 жыл бұрын
@@nextProgram It's delightful and hilarious. SuckerPinch is one of the most amazing programmers on youtube, and you should binge all his videos.
@Jack-rn3rm
@Jack-rn3rm 4 жыл бұрын
such a refreshing channel my man, I love the big programmer channels but they are way too far ahead, you're able to connect with us a whole lot more as you learn along with us Thanks for making these videos, I'm sure your inspiring tonnes of new developers to take up the exact same thing
@Jack-rn3rm
@Jack-rn3rm 4 жыл бұрын
Also, discord link is already broken, not sure if you know that. Would love to join it and talk some time
@nextProgram
@nextProgram 4 жыл бұрын
Jack Hey thanks, I really appreciate it! That’s good to hear. Thanks for telling me about the link, that’s fixed now!
@mateocsaba8801
@mateocsaba8801 4 жыл бұрын
Nice video! I've recently managed to make my first procedural animation program, and I didn't use bones, just code. Maybe you could try something like that, it was fun.
@maximood-tired
@maximood-tired 2 жыл бұрын
thx for insight in chess programms
@flooferscum2718
@flooferscum2718 4 жыл бұрын
I love your vids!keep doing what you do!!!!:)
@nextProgram
@nextProgram 4 жыл бұрын
Hey thanks!
@user-kx5es4kr4x
@user-kx5es4kr4x 4 жыл бұрын
AI In the thumbnail: "IM GONNA LOSE!!!!!!" **tips over chess board**
@jealouscase3634
@jealouscase3634 4 жыл бұрын
Love chess... but also looking forward to the next DevLog :D
@nextProgram
@nextProgram 4 жыл бұрын
Coming soon!
@NonsensexXxX
@NonsensexXxX 4 жыл бұрын
I made a chess AI using alpha beta without the pruning for a term project for an intro to cs class and I had the same experience getting the game to display and all the rules to work including the "fake rules" took the majority of the time where as throwing together the AI that made somewhat reasonable moves took very little time surprisingly. the main issue I had was adding any type of algorithm to my 3000 lines one file shit code was gonna be hell
@jamesr6311
@jamesr6311 4 жыл бұрын
What IDE do you use and what's your color theme, I really like it! Anyway, love your videos, keep at it.
@tankotee9755
@tankotee9755 3 жыл бұрын
Good effort. I'm interested in making my own engine too.
@matejnovosad9152
@matejnovosad9152 4 жыл бұрын
Btw I implemented checking by going through each piece and seeing if any of those attack king(have kings position in their possible moves.) And sometimes your piece is pinned(cant move because it would put your king in check.) This is fairly easy to stop as well. You just "let him" do the move and if your king is in check before blacks turn it is illegal move
@andrasfogarasi5014
@andrasfogarasi5014 4 жыл бұрын
Technically if you only limit the search to when a king is captured your program is a perfect strategy. Assuming of course that stalemates don't happen. Or infinite loops. And we don't include castling or en passant in the game. And the king is worth infinitely many points.
@ishashka
@ishashka 4 жыл бұрын
I tried making a proper chess engine once. Like, with all the actual rules implemented. It was hell
@Skizmo
@Skizmo 3 жыл бұрын
It's been 5 months since the last keeper devlog! Is it so hard to just upload a 1 minute unedited video telling us what is going on?
@anandsuralkar2947
@anandsuralkar2947 4 жыл бұрын
Lol that thumbnail code perfect works everytime
@o-..-
@o-..- 2 ай бұрын
Really good video, i just have a question, what python idle did you use? I use pycharm but this one seems really simple, Thanks and have a great day
@felipe3678
@felipe3678 3 жыл бұрын
your content is amazing bro!
@nextProgram
@nextProgram 3 жыл бұрын
Felipe thanks!
@jstara9125
@jstara9125 4 жыл бұрын
This is the type of inspiration i need in order to not give up on my game. I hate coding and as someone who has no idea what they're typing, I have to decide between the will to live and opening up Unity! Glad to see your hard work payed of for you!
@nextProgram
@nextProgram 3 жыл бұрын
Good luck!
@DragonDyna2ty
@DragonDyna2ty 4 жыл бұрын
You should make a video on how you learned to code and to help other aspiring game developers
@meitorproyects8288
@meitorproyects8288 4 жыл бұрын
There are literally thousands of that videos wtf
@DragonDyna2ty
@DragonDyna2ty 4 жыл бұрын
@@meitorproyects8288 and? Still wanna see what HE did to learn how to code
@0xreflex
@0xreflex 4 жыл бұрын
Bro you are just like code bullet amazing the only thing you need us a small animation which act to speak when you speak
@nextProgram
@nextProgram 4 жыл бұрын
Haha thanks, I love Code Bullet
@0xreflex
@0xreflex 4 жыл бұрын
@@nextProgram yup I also follow him and I made a flappy bird ai in python after getting home idea from his video
@eli_0625
@eli_0625 2 ай бұрын
"I'm going to make this engine proper" *proceeds to not include castling or en passent*
@javierolvera
@javierolvera 4 жыл бұрын
You get 10k subs in 2 weeks.... That proves that your content is amazing
@cosmicpegasis7591
@cosmicpegasis7591 4 жыл бұрын
Congrats mate you doubled again! You're like the code bullet but more polite
@nextProgram
@nextProgram 4 жыл бұрын
Haha that's good
@rebelonionfn
@rebelonionfn 4 жыл бұрын
Where has he gone?(>﹏
@Gualor_
@Gualor_ 4 жыл бұрын
Next time i suggest you use Montecarlo Tree Search, is much more powerful and doesn't require any knoledge of the game to compute an heuristic function. MCTS uses only a large number of random simulation to estimate winning probabilities of board configurations
@liquidportal9082
@liquidportal9082 4 жыл бұрын
Dude, your videos are awesome. I'm sure you will become famous. +1 sub.
@nextProgram
@nextProgram 4 жыл бұрын
Aw thanks!
@ultra.2500
@ultra.2500 4 жыл бұрын
Loving the content keep it up!
@nextProgram
@nextProgram 4 жыл бұрын
Appreciate it!
@dv_xl
@dv_xl 4 жыл бұрын
you can represent a board with a set of 64bit unsigned ints (called a bitboard). imagine the int being laid out like 00000001000 as a matrix across the whole board. A 1 represents a piece being in that position. You can then store different sets of pieces in those (like white pawns), etc which allows move lookups to be done in parallel and cheaply. that's the key optimization here to allow a deeper search depth
@nextProgram
@nextProgram 3 жыл бұрын
:o that’s genius
@bertiemunn129
@bertiemunn129 4 жыл бұрын
I thought this was going to be a weird chess AI in Scratch. now that would be impressive
@protectedmethod9724
@protectedmethod9724 4 жыл бұрын
Use Arena chess to visualize the moves and have it communicate using UCI protocol. Then with Arena you can automatically test your engine against other chess engines, set up positions, time controls, etc.
@aggressivepianonoises813
@aggressivepianonoises813 4 жыл бұрын
Why does the structure and diction of this video make it feel jarringly like it was made as a high school project presentation?
@humanLucifer
@humanLucifer 4 жыл бұрын
one form of machine learning for this would be rather simple, where you basically let the ai determine the value of each move, so how much taking a tower is worth, or how bad it is to lose a knight. additionally you could do the same for strategic positions. this would be a basic version of ai that doesn't actually involve any real neural networks. the only disadvantage of this is that the value of any gamestate is a linear product of it's pieces, so it's completely blind to actual strategies and probably awful at achieving a check mate or late game in general, though it might be quite competent in early game.
@wh1t3h3ll
@wh1t3h3ll 4 жыл бұрын
Awesome vid! Are you planning to make your code open source on GitHub? Would love to take a look, because i'm currently having some trouble with the pruning, and from what I've seen my code is similar to yours :D
@HTWwpzIuqaObMt
@HTWwpzIuqaObMt 2 жыл бұрын
Good vid man. Also its not really a AI since it doesnt use any ml algorithms like neat etc. Its just ur brain that made that alg and applied it. Keep going mate good job
@RazgovorIsDialog
@RazgovorIsDialog 3 жыл бұрын
Have you considered uploading the code you used for everyone to take a look at?
I made an unbeatable Tic Tac Toe AI (Minimax algorithm)
9:19
nextProgram
Рет қаралды 132 М.
Can THIS win Sebastian Lague's Chess challenge?
10:11
Game Tech Explained
Рет қаралды 197 М.
Stupid Barry Find Mellstroy in Escape From Prison Challenge
00:29
Garri Creative
Рет қаралды 20 МЛН
Smart Sigma Kid #funny #sigma #comedy
00:19
CRAZY GREAPA
Рет қаралды 20 МЛН
I made my own chess bot (Part 1)
14:49
Data Time
Рет қаралды 10 М.
How I designed Fruit Ninja
22:58
Luke Muscat
Рет қаралды 6 МЛН
Chess Engines Are Wrong About These Positions
15:05
Chess.com
Рет қаралды 227 М.
I Made A Chess AI But In Only 1 File
17:34
Simply In Dev
Рет қаралды 10 М.
What does a Game Engine actually do?
16:45
Ellie Rasmussen
Рет қаралды 140 М.
0 ELO CHESS BOT!!!!
25:52
GothamChess
Рет қаралды 339 М.
I Made a Neural Network with just Redstone!
17:23
mattbatwings
Рет қаралды 633 М.
Coding Adventure: Chess
29:22
Sebastian Lague
Рет қаралды 3,7 МЛН
Can I Run Youtube Entirely From My Terminal? (No Browser)
15:31
Получилось у Вики?😂 #хабибка
0:14
ХАБИБ
Рет қаралды 4,7 МЛН
Ещё один способ не забеременеть
0:16
Pavlov_family_
Рет қаралды 1,6 МЛН
Забота от брата 😂 #shorts
0:31
Julia Fun
Рет қаралды 4,8 МЛН