"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
@@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".
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 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...
@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.
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..?
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.
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!
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”
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!
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.
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
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.
Last year's best chess engine (Stockfish) isn't programmed by machine learning. People only know that a machine learning AI crushed Stockfish at some point, but don't know that Stockfish reclaimed its title the year after.
@@Marhathor No bro, shannon number is lower bound of possible games played(wikipedia), shannon couldn't be wrong, he initiated AI research with his information theory.
Well, that's no one's fault. I really sympathize with what you're going through. My experiences in Python aren't with chess, but that's the same as my experiences in Python.
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.
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.
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
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
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!
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
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 :)
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
When the first demonstration literally has illegal moves almost immediately and you can't even win. Well this should be fun. Very cool trying to make your own chess engine though
my friend literally introduced me to Shogi (Japanese chess where you can place any piece you capture) a day ago and said i should make a shogi/custom chess engine in unity, perfect timing
I had the same process making my own engine in processing because I wanted to make potatos play chess, and I thought that, by making my own engine, I could optimize it for communication with an arduino (reading the potato's voltage) and also de the potato move selection algorithm. It took me three months to make a fully fledged, relatively polished, engine. It took me two days to make the potatos play lol.
I am not at all surprised that the board took you a long time compared to the logic behind it. I was once working in unity to make a game that needed a similar board and spent at a week futzing with it to make it handle all kinds of layering issues and click detection. The (prototype for the) game itself took 3 days.
This video took like 70 hours to make :)
😳 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!
Very big oof size
Good job!
Can u do a face reveal after 10k subs
#youtubeputallthisdudesvideosinrecommendedsohegetslotsofnewsubsbecauseheisawsomeandmakesamazingcontent that is hard to read
Ahh, the programmer's paradox: That which seems the simplest takes the longest and that which seems the hardest takes a minute.
clavesi very true
That's probably because computers are extremely good at what we are bad at, but extremely bad at what we are good at
"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
how dfq does that make any sense
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.
"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
To be fair could probably be waay wore beginner friendly
Just use pyglet instead of pygame
lelelelelelel
I don't like Java for exactly that reason lol
@@ekrem_dincel What is pyglet? I've never heard of it
“I made my own engine.”
You poor soul.
I'm making one too.
(I think I'm going insane please help me)
@@chappie3642 stop
For your own sanity
@@ptato3010 No he has to do it, to become a man.
@@tla9231 He's gonna die if he does! We can't loose another one... Not like this... Not like this...
@@ptato3010 It's too late, he already did it. Now he either dies or succeeds. It's for the greater good.
Great video! That little game you made called “chess” could definitely take off.
Yeah I think it has some potential haha
@@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".
@@nextProgram I sense sarcasm
CheSs is AlrEadY a gAmE yoU stUpId
Not The boi r/wooosh
*if(aboutToLose):*
*dont()*
The best code in existence, just don't forget your functions.
@@barrrakudam Functions/Variables do not have spaces, try using underscores. (_)
@@someone58932
if(aboutToWin):
do()
@@clonefighter1996 better
Fun fact, dont( ) is a recursive function 🤣
@@asteroidX yes
Imagine still playing Chess when Chess 2 has been out for years
Green Mario True
wait where
@@noyz-anything en.m.wikipedia.org/wiki/Chess_2:_The_Sequel
@@greenmario3011 Wait, are you saying D&D is not the sequel to chess?
@@rockman7perez Yea, dungeons and dragons is actually the sequel to snakes and ladders.
*Sees the thumbnail*
Me: This man is a genius.
Watches the video: Oh... never mind.
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++
I gave up in pain at 4 minutes. Did he mention perft?
@@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...
okay nerd
/s
Searching null move now
When he talked about how he wrote the engine so quick it caused my physical pain considering how bad it is, great content though
You see this, this content right here? Yeah it’s called quality content. Just saying
ez dub
He talked 5 minutes about bullshit that no one cares about and 1 minute about his program, how is this quality??
Don’t question it :)
When the title says scratch, but he doesn't make it using scratch
sad scratch noises
Was looking for this comment, someone should use scratch to do this
I'll probably end up doing it
It should take about 3 hours to make a decent chess move... but it will be worth it.
John Eaves
I made a 256 bit integer and it slows down at about 2000
Shinju Kim scratch is really bad tbh. It would take like 10 days to actually even make a really bad chess bot
SCRATCH IS GARBAGE!
This dude: What am I some kind of nerd?
Also this dude: *programs a chess engine from scratch *
that feeling when a chess ad plays before this chess video
🤔
@@nextProgram yes (insert that emoji) indeed
Google is spying on you lol.
@@aidanthird I think this vid only has 2 ads in the start and in the end ·-·
@@animationgamer3564 yes and the ad played right before this video
Next time make a weird chess AI *IN* Scratch.
Mad Mew Mew cool,can you make a physics engine(I can’t)
Angry Pickle? _gestures vaguely at GriffPatch’s tutorial project_ (I think that’s the name)
Larree I know,I was just wondering how good she/he is
Mad Mew Mew so you’re not as good as you said
@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.
Please nerf the Queen, chess players haven't received any update for hundred years.
Hahahaha
Disenchantedcard GD Lol
I love the thumbnail: If about to lose, DONT
I love how you called the bishop the fancy pawn
chess grandmaster watching those chess games be like:" pathetic"
I'm not a grandmaster but these games are advanced stupid. Like 3rd stage stupid.
Was listening to Queen and saw this clicked on it straight away
Wow that's saying something
@@nextProgram its is, cant wait for next video
W
H
O
A
S
K
E
D
@@buzihalom63 not you i was saying it to @nextProgram
W
H
O
A
S
K
E
D
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..?
The thumbnail: “Oh yeah, it’s big brain time”
When will you upload the next devlog video
Hopefully in the next couple weeks!
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.
“Sorry that was a dumb intro”
You LIE!
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!
2:43 the AI can play chess -- 1. A5
"But then I decided that Python was better to use, because I found a library with an already made chess engine"
- nextProgram 2020
"Now the ai can play a masterful game of chess"
*ai plays a5*
Nah, it was an ok intro
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”
"Chess" is going to be *revolutionary!*
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!
Make this ai a minigame in your game, and make it so it gives you a prize for beating it!!!!
Haha cool idea
yea some sort of an npc that won't let you pass till you beat him
@@nextProgram haha *_Do it_*
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 !
"The fancy pawn" 😂🤣
AI In the thumbnail: "IM GONNA LOSE!!!!!!" **tips over chess board**
So as someone with a little more experience programming and has even done a lot of work in pygame... Pygame sucks
Can confirm!
Yes
lwjgl is better
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.
I’ve never had a real problem with it
"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.
it's always fun to find a new channel to watch
I should know, I'm subscribed to more than 750 of them
fun right
me: sees title
i can make it MORE unbeatable
in fact...
it's not even playable
*error messages increase*
this isnt the tic tac toe video
um i dont watch this channel so I havent seen it but i mean how it says
if(aboutToLose):
dont()
thats what i mean by unbeatable
RUclips's algorithm blessed me with your channel.
Welcome!
The best part was the thumbnail which could be seen from outside the video
noice thumbnail, noicer video
Appreciate it!
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
When’s the next vid?
In a few weeks hopefully!
@@nextProgram ok :)
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.
where did you go? why you haven't uploaded videos for 4 months?
I'll be back soon!
@@nextProgram thanks
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.
Absolutely!
“The horsey”
Me: it’s called a knight
“Fancy pawn that can’t jump over stuff”
That’s called a bishop
In my language it's actually called a horse lol
It's called a ponyhorse and bunnyrabbit
In German it's a jumper. Let that sink in
In Russian, a bishop is an elephant
Wow I love your video! Interesting and funny too. The fancy pun got me the most xD
Glad you enjoyed it!
that thumbnail haha love it
Yeah this video has been in development for months haha. I had a lot of time to come up with dumb jokes lol
"Programming graphics is the worst thing ever"
*Laughs in processing*
You know your early when the video doesn't even have 500 views yet.
He's a smaller RUclipsr, that's not really uncommon. It's 9hrs later and the video isn't at 3k yet.
nextProgram upload, must watch now
;)
"i cheched on yahoo and..."
*google.com*
LIAR
;)
Last year's best chess engine (Stockfish) isn't programmed by machine learning. People only know that a machine learning AI crushed Stockfish at some point, but don't know that Stockfish reclaimed its title the year after.
Damn this was cool and all man but... what’s a chess?
Lee Doyle Dude i wish i knew
I tried making a proper chess engine once. Like, with all the actual rules implemented. It was hell
This is so impressive it’s insane! I love watching people code, it’s so satisfying.
Thanks :)
"Oh this engine doesnt support castling, en passant, or checkmates. None of those fake chess moves." I died laughing at the checkmate part.
😅
Right when it got to That part I found this comment when scrolling lol
Lol that thumbnail code perfect works everytime
"The Shannon Number" - named after the person who couldn't figure out you can make an infinite amount of moves in a chess game.
Its about games not moves :/
Like I say, a chess game can be infinite.
It's not synonymous with the amount of possible setups.
@@Marhathor because game can be infinite it doesnt mean there isnt finite amount of games played
Now you're just misinterpreting what I'm saying. That's not what the number's supposed to represent.
@@Marhathor No bro, shannon number is lower bound of possible games played(wikipedia), shannon couldn't be wrong, he initiated AI research with his information theory.
Well, that's no one's fault. I really sympathize with what you're going through. My experiences in Python aren't with chess, but that's the same as my experiences in Python.
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.
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.
your content is amazing bro!
Felipe thanks!
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
Shadow Killer Interesting!
@@nextProgram Keep up with the great work!
It didn't 'almost' beat Stockfish 8, it outright beat the strongest version of Stockfish.
You are definitely a super underrated RUclipsr. You should have triple the amount of subscribers
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
pls continue to make these kind of videos
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!
Thank you so much!
Here you go calling all these pieces horses and fancy pawns, if you learnt from GM Hikaru you'd call them all juicers and call it a day
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!
Thanks for watching!
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
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 :)
thx for the heart :D
Cool idea!
"We've doubled again and now we have 7k" *checks subscribers a week later, has doubled again*
*checks back 21 weeks later, has almost 15 million*
nextProgram: Has a series on indie game development
also nextProgram: Dies programming chess
This was honestly harder lol
@@nextProgram Could've used Unity for it, too, especially since the AI code was so simple 😄
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
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
:o that’s genius
When the first demonstration literally has illegal moves almost immediately and you can't even win. Well this should be fun. Very cool trying to make your own chess engine though
I thought this was going to be a weird chess AI in Scratch. now that would be impressive
i thought he was playing the london system at the start!
I read this as "I made a weird cheese AI from scratch" and honestly I think this should be a thing
Yeah same
"I'm going to make this engine proper"
*proceeds to not include castling or en passent*
or CHECKMATE, he didn't even make chess lol
The code in the thumbnail is genius
i love how he says "yeah my subs have doubled AGAIN" and in a week his subs double
Best moment at 3:04
White: Check
Program: Imma move my pawn
White: ok
“It needs to go fast so I’ll use Java” said no C++ developer EVER!! 😂
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?
Bro you are just like code bullet amazing the only thing you need us a small animation which act to speak when you speak
Haha thanks, I love Code Bullet
@@nextProgram yup I also follow him and I made a flappy bird ai in python after getting home idea from his video
my friend literally introduced me to Shogi (Japanese chess where you can place any piece you capture) a day ago and said i should make a shogi/custom chess engine in unity, perfect timing
Cool!
4:16 the king can be taken without
All Needs Assemble
Why does the structure and diction of this video make it feel jarringly like it was made as a high school project presentation?
I didn’t know this channel but it’s awesome . Congratulations man
I had the same process making my own engine in processing because I wanted to make potatos play chess, and I thought that, by making my own engine, I could optimize it for communication with an arduino (reading the potato's voltage) and also de the potato move selection algorithm.
It took me three months to make a fully fledged, relatively polished, engine. It took me two days to make the potatos play lol.
Getting called a bot in videogames vs chess
I am not at all surprised that the board took you a long time compared to the logic behind it. I was once working in unity to make a game that needed a similar board and spent at a week futzing with it to make it handle all kinds of layering issues and click detection. The (prototype for the) game itself took 3 days.
I like thumbnail of the video saying: if about to lose - don't
this is great cause pogchamps is currently happening and youtube recommended your video to me, and it was good
So I *just* started learning Python, so when I was the thumbnail, I was ecstatic.