The Fascinating Programming of a Chess Engine

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 มิ.ย. 2024
  • Building my chess computer was really fun and many of the concepts are so elegant. I built it on the side of my studies during the winter of 2020-21. You can check it out on my github in the "sophia" repo.
    Github: github.com/bartekspitza
    Sophia: github.com/bartekspitza/sophia
    Sebastian Lague's Alphabeta video: • Algorithms Explained -...
    Made with Motion Canvas, an incredible library by @aarthificial!
    Music:
    Ballerina - Yehezkel Raz
    Spiral - Yonatan Riklis
    Shimmer - Adrien de la Salle
    Timestamps:
    00:00 Intro
    00:24 Board Representation
    1:38 Evaluating Positions
    3:31 Why Search Is Important
    4:07 Minimax algorithm
    5:44 Pruning the search tree
    6:25 Outro
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 470

  • @dantheok1
    @dantheok1 7 หลายเดือนก่อน +946

    the fact that this channel has 17 subscribers is bewildering, perplexing, and puzzling for me

    • @nameyname1447
      @nameyname1447 7 หลายเดือนก่อน +56

      the fact that this channel has 125 subscribers is bewildering, perplexing, and puzzling for me

    • @galactoman5503
      @galactoman5503 7 หลายเดือนก่อน +37

      the fact that this channel has 212 subscribers is bewildering, perplexing, and puzzling for me

    • @animationgaming8539
      @animationgaming8539 7 หลายเดือนก่อน +27

      the fact that this channel has 217 subscribers is bewildering, perplexing, and puzzling for me.

    • @khytron06
      @khytron06 7 หลายเดือนก่อน +20

      the fact that this channel has 287 subscribers is bewildering, perplexing, and puzzling for me

    • @AverageBishop-
      @AverageBishop- 7 หลายเดือนก่อน +19

      the fact that this channel has 313 subscribers is bewildering, perplexing, and puzzling for me

  • @theluvjain
    @theluvjain 7 หลายเดือนก่อน +408

    As a developer and a lifelong chess lover, this video made me happy! Your pacing was simple, easy to understand and though the ideas were complex, you demonstrated and explained them in a neat and organized fashion. Cheers my friend - looking forward to the next one!

  • @Pi7on
    @Pi7on 7 หลายเดือนก่อน +63

    Damn, I felt like the video had just started, and then boom, it's already over.
    If you keep up the style/quality, you definitely have a future among the greats of video essays on programming/CS

    • @andrewsarroyo
      @andrewsarroyo 6 หลายเดือนก่อน +1

      Yes, this whole video was mesmerizing. I was expecting at least twenty minutes. So good.

    • @Pi7on
      @Pi7on วันที่ผ่านมา

      @@ahmoin freya Holmer, Tsoding, Sebastian Lague, mattkc, no boilerplate, 3blue1brown, fasterthanlime
      And these are just the ones that came to mind first, there are many others

  • @espian6506
    @espian6506 7 หลายเดือนก่อน +161

    I love how walked through implementing the minimax algorithm - the whole explanation felt very natural in the way you explained it, and the animation adding the bits of code was lovely because that's exactly how implementation unfolds. Great work!

    • @Ermude10
      @Ermude10 7 หลายเดือนก่อน

      Fully agree! The code editing animations is great!

  • @Lycro.
    @Lycro. 7 หลายเดือนก่อน +28

    This was a very well made video! I couldn't believe in the amount of subscribers you had because your production is top notch!

    • @artillerybeacon5324
      @artillerybeacon5324 7 หลายเดือนก่อน +3

      A lot of obscure channels with high quality videos have been appearing in my feed, and I'm all for it.

  • @diophantine1598
    @diophantine1598 7 หลายเดือนก่อน +19

    I always enjoy hearing of new ways to apply bitwise operators.

  • @martinzokov
    @martinzokov 7 หลายเดือนก่อน +3

    Dude! Really nice vid. You explain the concept in simple terms without all the unnecessary details. Looking forward to more of that!

  • @Nicolas-sq4fj
    @Nicolas-sq4fj 7 หลายเดือนก่อน +2

    After watching this video, so many "informative" programming related videos seem so over the top edited or cinematic. I don't want a dramatic intro or unnecessarily upbeat music. I want THIS

  • @CalmaxFilm
    @CalmaxFilm 7 หลายเดือนก่อน +11

    This video is ridiculously brillant... This is so clean, well explained, and the purpose is so exciting

  • @nilsfriman1555
    @nilsfriman1555 7 หลายเดือนก่อน +2

    The video was very nice. Calming, informative, and inspiring. I love Sebastians videos too and i definitiely saw some of what i see in his videos in this one.

  • @HansLemurson
    @HansLemurson 7 หลายเดือนก่อน +8

    I give this video a high evaluation score for the youtube algorithm.

    • @BartekSpitza
      @BartekSpitza  7 หลายเดือนก่อน

      haha thanks 😅

  • @toofatforthat3861
    @toofatforthat3861 7 หลายเดือนก่อน

    This is an amazing video! I have no idea about coding, but ur animations and the style of the video made me very invested. It seems to be a very intriguing process in which we developed a need for a chess computer and how incredible and unbeatable they are now.

  • @lakshyachopra_
    @lakshyachopra_ 7 หลายเดือนก่อน

    Such a well curated and informative video! I’m glad to be one of your early subscribers.

  • @Jejkobbb
    @Jejkobbb 7 หลายเดือนก่อน +1

    Incredible visualizations, love this so much

  • @gabrieltellesm
    @gabrieltellesm 7 หลายเดือนก่อน +5

    Very nice video, and it shows that a lot of effort went into it. Congrats!

  • @curlsalot91
    @curlsalot91 7 หลายเดือนก่อน

    man i am half in the video and it's calm to hear you talk, chill to watch and interesting to understand. i like

  • @ahmedAltariqi
    @ahmedAltariqi 5 หลายเดือนก่อน

    I should say your videos are pretty well edited and interesting!
    I'd love to see more videos like these ❤

  • @svxtn
    @svxtn 7 หลายเดือนก่อน +1

    very elegant presentation, quite simplified yet intriguing. excellent video

  • @TheWanderingNeko
    @TheWanderingNeko 7 หลายเดือนก่อน +3

    how do you only have 166 subscribers!? you have made the concept easily understandable and presented it better than channels with 100x-1000x your subs. amazing!!!!

  • @dionito70
    @dionito70 7 หลายเดือนก่อน

    You just got another subscriber. I hope you keep it up with the channel. This video is awesome! Simply explained, to the point and clear. Makes me want to get back into my chess engine, which I abandoned at a time of too much "real work". Thanks!

  • @dhruvmishra1933
    @dhruvmishra1933 7 หลายเดือนก่อน +1

    when i saw the length of the video, i thought to myself "alright what can he really teach me about chess programming in 6 mins lol lemme see" and these 6 mins felt like 1 min and 60 mins at the same time. So much info stuffed so precisely and explaining it in such calm and simplistic manner, kuddos man!🙌

  • @instagramsnapchat
    @instagramsnapchat 7 หลายเดือนก่อน +2

    What a well produced video, your explanations are clear and the visuals really add to them. Fantastic work!

  • @MattMcT
    @MattMcT 2 วันที่ผ่านมา

    Wow! Ok Bartek, just want to say thank you. Not just for the video but for the raw inspiration. I’ve got a learning engine to build, which like your chess engine, needs to be able to strategize on how to best position a learner for further strategic positions. So the challenge is to design the engine to provide the learner with a weighted numerical map of where they might want to head to learn more things. This way a learner can try to grasp the rabbit holes they can possibly traverse, prior to traversing them and strategize as they see fit for themselves. I have to do this in a more 3d type of board, but the principle is the same. So THANK YOU for the nudge I needed to just start building this as an engine. I owe you a beer/coffee/highFive!

  • @timsagichnicht
    @timsagichnicht 3 หลายเดือนก่อน +6

    THIS VIDEO WAS LIKE THIS „!!“ BRILLIANT. As a chess lover and young programmer I found it amazing how you explained and visualized everything. Also the sound effects your voice and your explanation itself. I would love to see a continuation or a deeper analysis

  • @deivorous-3592
    @deivorous-3592 20 วันที่ผ่านมา

    The algorithm has blessed me today with this :') I was quite curious about how chess engines worked, and you explained with amazing clarity. Thank you.

  • @S4veMeBarry101
    @S4veMeBarry101 7 หลายเดือนก่อน

    Phenomenal presentation and wonderfully narrated!

  • @bernardoalves3642
    @bernardoalves3642 7 หลายเดือนก่อน +8

    There are a bunch of small computer science channels out there with really well-made videos that are ready to blow up, and I'm all for it.
    Best of luck, if that's your goal. Lovely video

  • @alaeifR
    @alaeifR 7 หลายเดือนก่อน

    Beautiful graphic and motion design. Aesthetically very pleasing. Well explained.

  • @davidb6477
    @davidb6477 7 หลายเดือนก่อน +41

    I was confused by the King placement evaluation since those values would quickly have the opposite gradation as pieces are traded off. This type of value assumption based on board placement would have to be dynamically evaluated and not taken as a static truth.

    • @crahs8
      @crahs8 7 หลายเดือนก่อน +14

      This is usually solved by having two king placement tables: one for opening/middle game and one for the endgame. One then computes something like a number for "endgame-ness" (might be based on the number of pieces left) that smoothly interpolates between the two tables.

  • @freedomofmusic2112
    @freedomofmusic2112 หลายเดือนก่อน

    your animations are beautiful and smooth! first time I've ever seen a video with more likes than the channel who made it. well done!

  • @fadishadi8855
    @fadishadi8855 29 วันที่ผ่านมา

    your style is sooo good! frustrated to find only 4 videos in your channel

  • @manaskhanger
    @manaskhanger หลายเดือนก่อน

    please continue making such fascinating programming videos brother!

  • @SomeSnowman12
    @SomeSnowman12 7 หลายเดือนก่อน +1

    Wonderful video. I loved how you walked through your processes in making this. Wished it was a bit longer/more in-depth, but that's just a personal preference.

  • @fuzzy-02
    @fuzzy-02 7 หลายเดือนก่อน +5

    This is just amazing.
    I was fascinated most by how the board conveniently fit into an int64 and how from there everything just rolled as mathematics. Matrix multiplication in particular.

    • @Rexvideowow
      @Rexvideowow 6 หลายเดือนก่อน +1

      Friendly reminder that certain kinds of matrix multiplications have become faster with AI recently finding a new method, a mathematician taking that to the next level, and then AI improving it once more.

  • @yelnurkean9298
    @yelnurkean9298 7 หลายเดือนก่อน

    i am impressed by the video editing. It was really good!

  • @dhruvinvekariya975
    @dhruvinvekariya975 7 หลายเดือนก่อน

    It is out of my mind that channel less than 1k subs has this insane presentation
    Kudos🔥✌

  • @SpaghettiMonster0144
    @SpaghettiMonster0144 7 หลายเดือนก่อน

    the fact that this channel has only 1.5k subscribers is bewildering, perplexing, and puzzling for me

  • @brettbuchanan1878
    @brettbuchanan1878 7 หลายเดือนก่อน

    I wish this video was much, much longer. Great content

  • @nikolajnguyen4273
    @nikolajnguyen4273 7 หลายเดือนก่อน

    Hi, very Nice combination of clear explanation and beautiful animations, The whole video is very professionally made. I am subbing and hopes to see more like this! 😊

  • @setu_s24
    @setu_s24 6 หลายเดือนก่อน

    Wohhh, one of the best videos I have ever watched on TH-cam.

  • @ThinkWithGames
    @ThinkWithGames 7 หลายเดือนก่อน

    Awesome video! Satisfying animations, and great explanations!

  • @Realharshagarwal
    @Realharshagarwal 7 หลายเดือนก่อน

    It feels so good to see this underappreciated video first being a developer and a chess fan.

  • @A71098
    @A71098 7 หลายเดือนก่อน +3

    underrated channel

  • @mike87364
    @mike87364 3 วันที่ผ่านมา

    This is beautifully done

  • @marcolarthur
    @marcolarthur 7 หลายเดือนก่อน

    Excelent quality here, congrats!!

  • @robbasgaming7044
    @robbasgaming7044 7 หลายเดือนก่อน +1

    Beautiful video

  • @el_crego
    @el_crego 6 หลายเดือนก่อน +1

    Really nicely produced video 👍 recently created chess in c++ and have been interested in engines, I realised how inefficient an array would be and had no idea about this method, I’d been using fen notation. Also, Well deserved channel growth 🎉 👏

  • @saru4L
    @saru4L 7 หลายเดือนก่อน +1

    Subscribed! This intro to chess engine development was very interesting, and I loved how you implemented the minimax algorithm into it. Maybe next time you could use genetic algorithm for the engine, using optimized material as heuristics?

  • @mxtafsa
    @mxtafsa 6 หลายเดือนก่อน

    Amazing video, really enjoyed it

  • @edouardcourty4267
    @edouardcourty4267 7 หลายเดือนก่อน

    This was such a good explanation, thank you

  • @Pabocheoreom
    @Pabocheoreom 7 หลายเดือนก่อน +2

    Informative video, really enjoyed it! Keep it up

  • @maestroeragon
    @maestroeragon 7 หลายเดือนก่อน

    very nice to watch and well done video, thanks for the great work!

  • @findmehere
    @findmehere 7 หลายเดือนก่อน

    this was very well demonstrated

  • @YassineSABRI00
    @YassineSABRI00 7 หลายเดือนก่อน

    Just found your channel man and I can assure you, you have a beautiful interessting content,... 2 videos now and more to come.. keep the great work man :D - a word from a stranger java developer

  • @superuser8636
    @superuser8636 7 หลายเดือนก่อน

    The fact this channel has only 4.27k subs is bewildering, perplexing, and puzzling for me

  • @L-Coder
    @L-Coder 7 หลายเดือนก่อน

    The fact that this channel has 1.62 k subscribers is bewildering, puzzling and perplexing for me😊

  • @STS232323
    @STS232323 7 หลายเดือนก่อน

    This is so well explained and interesting!

  • @Spyaboo
    @Spyaboo 7 หลายเดือนก่อน +2

    Best explanation and visualisation I've seen so far for bitboards, keep up the good work :)

  • @dhruvgarg722
    @dhruvgarg722 7 หลายเดือนก่อน

    this was awesome man

  • @applemirer3937
    @applemirer3937 7 หลายเดือนก่อน

    Wow, I hadn't heard this song before. I love your taste in music.

  • @amosky5105
    @amosky5105 7 หลายเดือนก่อน

    incredible work ! loved this video

  • @2ndTony
    @2ndTony 7 หลายเดือนก่อน

    Great video! Love the way you explain

  • @al3xj
    @al3xj 7 หลายเดือนก่อน

    great share - interesting to hear the thought process - this thought process then can be applied to other different challenges, like optimising traffic in a unique environment, and so on

  • @FrixAnims
    @FrixAnims 7 หลายเดือนก่อน

    Great video! I love how you presented this topic specifically. Im subbing looking for more :)

  • @wsandst
    @wsandst 7 หลายเดือนก่อน +1

    Really great video! I'd love to see another one explaining some more advanced concepts, such as move sorting, QSearch or transposition tables. And good shout-out to the chess programming wiki, what would chess programmers do without it? It's also one of the best references for obscure assembly instructions (pext, I'm looking at you!)

  • @kabilasudhan8315
    @kabilasudhan8315 7 หลายเดือนก่อน

    I always wondered how the chess engine works evaluating the positional advantage and material advantage! This gives some insight. 😌

  • @axe5341
    @axe5341 7 หลายเดือนก่อน

    incredible video. thank you

  • @casualuser5527
    @casualuser5527 7 หลายเดือนก่อน

    Great video. I want an hour long sequel.

  • @philipsuskin6843
    @philipsuskin6843 7 หลายเดือนก่อน

    What a beautiful video. Keep it up!

  • @jacokyle0160
    @jacokyle0160 7 หลายเดือนก่อน +4

    man if this video was 10 hours long I would certainly watch it all 😂

  • @kakashi5951
    @kakashi5951 7 หลายเดือนก่อน

    Great video ! Wish for more videos about chess programming

  • @pedrohjleite
    @pedrohjleite 7 หลายเดือนก่อน

    Amazing content man, keep it up

  • @Avighna
    @Avighna 7 หลายเดือนก่อน

    Well made video, good job!

  • @EcsMurphy
    @EcsMurphy 7 หลายเดือนก่อน

    This was excellent. Subscribed ❤

  • @dungeonrobot
    @dungeonrobot 7 หลายเดือนก่อน

    Fantastic video! Hope you manage to get the subscribers and views you deserve!

  • @coolestclipsontheinternet
    @coolestclipsontheinternet 7 หลายเดือนก่อน

    The best video I've watched today

  • @mankifg
    @mankifg 7 หลายเดือนก่อน

    good quality video like Sebastian Lague's chess adventure, +1 subscriber

  • @thornels
    @thornels 4 หลายเดือนก่อน

    Reminds me of the Sebastian Lague video, great content :D

  • @Maheep_Infinity
    @Maheep_Infinity 7 หลายเดือนก่อน

    U deserve more appreciation ❤🎉😊

  • @OmarMoBadr
    @OmarMoBadr 7 หลายเดือนก่อน +4

    Great video thank you, I thought you would show a demo at the end of the video, but anyway keep up the excellent work.

  • @jonbarnesjr.1523
    @jonbarnesjr.1523 7 หลายเดือนก่อน

    awesome video man

  • @sisyfos101
    @sisyfos101 7 หลายเดือนก่อน

    Honestly the most enjoyable programming experience I’ve ever had!

  • @majestra6740
    @majestra6740 7 หลายเดือนก่อน

    Nice Video! I am already into chess and I'm starting to learn to code. I definitely got inspired to have this as a future project!

    • @BartekSpitza
      @BartekSpitza  7 หลายเดือนก่อน +1

      Highly recommend!

  • @panilyau
    @panilyau 11 วันที่ผ่านมา

    Amazing video!

  • @elifriedman317
    @elifriedman317 7 หลายเดือนก่อน

    Great succinct video!

  • @lucaschitolina7156
    @lucaschitolina7156 7 หลายเดือนก่อน

    Awesome video!

  • @vKxrey
    @vKxrey 7 หลายเดือนก่อน

    Fantastic Video!

  • @hoteltrivago9504
    @hoteltrivago9504 22 วันที่ผ่านมา

    absolute peach of a video. coding asmr

  • @AnthonySettergren
    @AnthonySettergren 7 หลายเดือนก่อน

    I'm sitting here patiently waiting for a part 2. I need to see how it plays against you at various depths.

  • @stevenstone307
    @stevenstone307 4 หลายเดือนก่อน

    Fantastic video

  • @oro5421
    @oro5421 7 หลายเดือนก่อน

    My prediction is that this channel is really going to blow up

  • @presente9501
    @presente9501 7 หลายเดือนก่อน +4

    Great video! It was in a style somewhat similar to Sebastian but with his personality. It would be interesting to see the game 2048 being dissected by the expectimax algorithm or monte carlo.

    • @BartekSpitza
      @BartekSpitza  7 หลายเดือนก่อน +1

      Indeed.. 2048 is a fun game!

  • @joshuasonnen5982
    @joshuasonnen5982 7 หลายเดือนก่อน

    Phenomenal video 🎉❤

  • @ShikharSrivastavaOfficial
    @ShikharSrivastavaOfficial 7 หลายเดือนก่อน

    This video inspired me to make my own chess engine now! Thanks!

  • @ward648
    @ward648 7 หลายเดือนก่อน

    I'd love to see how the chess engine performs with different components enabled and different search depths. I've been thinking about getting into chess programming for a while, I wanted to see if I could make an engine that plays at a low-elo but making more human-ish mistakes, like forgetting about king safety, a distant bishop, en-passant or being over-biased towards captures or giving checks etc. It would be a really neat tool to help players learn and improve

  • @kishanparmar4010
    @kishanparmar4010 6 หลายเดือนก่อน

    As someone who plays chess as well as studied minimax and such algos in computer science, i always find this topic interesting

  • @assassin_un2890
    @assassin_un2890 วันที่ผ่านมา

    Very nice explaaanation video and Also Music Thanks

  • @noggintube
    @noggintube 7 หลายเดือนก่อน +1

    I had a ZX81 in the mid-80s and had a chess game on it that was only 1k in memory. It always amazed me how they managed to programme a chess game into such a tiny amount of memory. Modern programmers could probably learn a lot from those tiny memory constraints.

  • @sanjaykrish8719
    @sanjaykrish8719 7 หลายเดือนก่อน

    Thanku for sharing ur insights on it. I like how u break down

  • @gandalfjackson1546
    @gandalfjackson1546 7 หลายเดือนก่อน +9

    As a CS graduate, I love seeing the concepts we learned applied to real world things like chess.
    Fascinating stuff