This was really cool we had a lot of the same ideas. One piece of advice I could give is to make pawn values not by the total amount of moves, but by whether or not they have a friendly pawn diagonally or horizontal to them. Pawn structure is very important in chess.
Yup, actually after the video I found many good concepts being discussed in "Chess Programming Wiki", anyway that is a lot of information, maybe I will challenge myself to make a better AI in the future, idk :P
@@TextGuy Mine is just about done, I'll send you the GitHub link so you can check it out if you want! Please do, I'm very proud of it. It plays very similarly to yours, opening with e3 and then bringing the queen out followed by the Bishop, but mine has way better pawn structure as I explained, and never makes a mistake (unless such a mistake goes beyond its depth and is unpreventable when it is finally perceived). Also, I noticed some odd behavior at 5:32, unless it is looking only 2 moves ahead, it should have actually taken the bishop with its rook, because the queen protecting it is "overloaded." Meaning your AI would have been trading one rook for both a bishop and a knight, so that move is +1 in its favor. I obsessed over bugs like this with mine. Though from what I can tell, we both have like the best homebrew chess AIs on YT lol (well mines not on YT but its better than others that are). Other peoples' sucked and they didn't even notice or just didn't admit it. Like, CodeBullet's chess AI was a buggy mess that couldn't even beat a monkey.
@@tristunalekzander5608 @Tristun Alekzander that would be great to see yours, I recently have some other project to do, making chess AI are quite time comsuming, especially when I need to explain the concept in video. I recently dont have that much time to make a video about a more advance chess AI. I think the reason why that odd move is occurs is because my bad evaluation function that consider every pm(possible moves) as 0.5f , so... Black Knight = 3 + (3pm * 0.5f) Black Bishop = 3 + (4pm * 0.5f) White Rook = 5 + (9pm * 0.5f) So it negates the value of both piece. B = 4.5 + 5 W = 9.5 also after the queen move he gain 4 more pm. Which make the result actually a -2. I've a concept of decreasing the value of pm according to piece left on board to avoid this kind of situation where pm is more valuable than capturing piece. Thanks for your appreciation, there's is actually not much people did chess AI on YT, most of them just did the minimax then gave up. There's actually bunch of stuff that could be implement though.
because it would take too long to explain the codes, and it's my first chess project it is not the best way of making chess AI, maybe I would make a pseudo-code example for tutorials :)
I've tried to make a tutorial, but since making a Chess AI required intermediate knowledge of coding, so it's hard to make a tutorial than just talking about the algorithm I used, here's a video explaining the algorithm in my video. czcams.com/video/l-hh51ncgDI/video.html ... and there's a wiki that include everything of Chess AI too here. www.chessprogramming.org/Main_Page
because I've never consider the move generation to stop after someone lost, so it will still choose the move that would lead to a best advantage after 3 turn, even that both kings are captured.
@@TextGuy In a match against chess.com. White is your red and black is your white.. but when u played first matches it was white = white and red = black and the queen and king are in a wrong position in this situation. White king has to be always on a black square. Blacks should be on e8 on a white square.
Its a fun experiment but you clearly need to know chess and how every piece can move AND capture, you clearly dont know much about chess if you think king has more lets say points than all of the chess pieces combined, in order to make that ai work you need to consider everything for it, including the fact that pawns can do a move called en passant
dude. you switched up king and queen... white King always starts at black square e1. Maybe first learn the rules exactly before doing something like this...
It's quite fascinating, I was rooting for an underdog AI to win against the popular AI.
might wanna make a more advance AI in future,hopefully i could figure out a method to beat them.
Please tutorial. Waiting for it
continue waiting
Nice, excited to see your next video!
thanks , stay tuned :)
Please make a tutorial! Great video!
still researching to build a MORE PERFECT AI ,thanks for watching btw :)
he didn't make a tutorial
Wow nice ai
thanks
Loved it and waiting to see more
It's fun indeed and funny
Keep it up
Thanks you , will try to make more videos 👌
Yo thats amazing work ❤
Some people promote to a knight rather than a queen because it may lead to checkmate
In some rare cases it's better to promote to a rook or to a bishop to prevent stalemate
This was really cool we had a lot of the same ideas. One piece of advice I could give is to make pawn values not by the total amount of moves, but by whether or not they have a friendly pawn diagonally or horizontal to them. Pawn structure is very important in chess.
Yup, actually after the video I found many good concepts being discussed in "Chess Programming Wiki", anyway that is a lot of information, maybe I will challenge myself to make a better AI in the future, idk :P
@@TextGuy Mine is just about done, I'll send you the GitHub link so you can check it out if you want! Please do, I'm very proud of it. It plays very similarly to yours, opening with e3 and then bringing the queen out followed by the Bishop, but mine has way better pawn structure as I explained, and never makes a mistake (unless such a mistake goes beyond its depth and is unpreventable when it is finally perceived).
Also, I noticed some odd behavior at 5:32, unless it is looking only 2 moves ahead, it should have actually taken the bishop with its rook, because the queen protecting it is "overloaded." Meaning your AI would have been trading one rook for both a bishop and a knight, so that move is +1 in its favor. I obsessed over bugs like this with mine.
Though from what I can tell, we both have like the best homebrew chess AIs on YT lol (well mines not on YT but its better than others that are). Other peoples' sucked and they didn't even notice or just didn't admit it. Like, CodeBullet's chess AI was a buggy mess that couldn't even beat a monkey.
@@tristunalekzander5608
@Tristun Alekzander that would be great to see yours, I recently have some other project to do, making chess AI are quite time comsuming, especially when I need to explain the concept in video. I recently dont have that much time to make a video about a more advance chess AI.
I think the reason why that odd move is occurs is because my bad evaluation function that consider every pm(possible moves) as 0.5f , so...
Black Knight = 3 + (3pm * 0.5f)
Black Bishop = 3 + (4pm * 0.5f)
White Rook = 5 + (9pm * 0.5f)
So it negates the value of both piece.
B = 4.5 + 5
W = 9.5
also after the queen move he gain 4 more pm. Which make the result actually a -2.
I've a concept of decreasing the value of pm according to piece left on board to avoid this kind of situation where pm is more valuable than capturing piece.
Thanks for your appreciation, there's is actually not much people did chess AI on YT, most of them just did the minimax then gave up. There's actually bunch of stuff that could be implement though.
You coded the king and queen on the wrong squares and now my brain hurts
unless.... orange was white and white was blackXD
You made a great video, I would love it if you explain your algorithm with the code!
because it would take too long to explain the codes, and it's my first chess project it is not the best way of making chess AI, maybe I would make a pseudo-code example for tutorials :)
Id like a tutorial about it
I can't access the URLs in the description, could you send me the appropriate links?
It’s a good video, very informative
glad that you liked it! :)
Make tutorial pls.Nice video
good video,please make more videos!
thanks ,still researching for some interesting project,stay tuned :)
"yo i got my pawn to ur base , give me a pawn"
- Einstein
Still waiting for the tutorial...
Yes I want to know
White queen starts on a light square. :(
It would be better if it was a tutorial
T H E R E T A R D M O V E
i felt that
Are there still any plans for a tutorial o chess ai? :D
Can u do a tutorial for this even if it's not perfect? I have a project using this and idk how to implement...it would be a good start for me
I've tried to make a tutorial, but since making a Chess AI required intermediate knowledge of coding, so it's hard to make a tutorial than just talking about the algorithm I used, here's a video explaining the algorithm in my video.
czcams.com/video/l-hh51ncgDI/video.html
...
and there's a wiki that include everything of Chess AI too here.
www.chessprogramming.org/Main_Page
Tutorial please
Quite unexpected that the ai, giving such high value to its kind would sacrifice it to capture yours And a piece. Would not have thought of that
because I've never consider the move generation to stop after someone lost, so it will still choose the move that would lead to a best advantage after 3 turn, even that both kings are captured.
@@TextGuy fair enough. Probably that is why Id not think of that. Because we humans, with out fleshy human brain implicitly expect the game to end
I just want to know how to implement alpha beta pruning, I’ve figured out minimax by myself, but I just can’t do pruning
I think i might do a explaination video soon , since there's some people wants to know.
So no tutorial?
Why the Queen and King are placed wrongly... :D
it's because I want to test my AI with chess.com, and their Queen and King are placed like that D:
@@TextGuy In a match against chess.com. White is your red and black is your white.. but when u played first matches it was white = white and red = black and the queen and king are in a wrong position in this situation. White king has to be always on a black square. Blacks should be on e8 on a white square.
Yeah, he made red as white and white as black
Its a fun experiment but you clearly need to know chess and how every piece can move AND capture, you clearly dont know much about chess if you think king has more lets say points than all of the chess pieces combined, in order to make that ai work you need to consider everything for it, including the fact that pawns can do a move called en passant
dude. you switched up king and queen... white King always starts at black square e1. Maybe first learn the rules exactly before doing something like this...
2:54 pawns cant attack like that, they can only move on the vetrical axis and can only attack on a diagnal
Yeah, and en passant