I just found this video from Sebastian Lague (Feb 12, 2021):
Coding Adventure: Chess AI
Chess programming looks so easy!
Coding Adventure: Chess AI
Moderators: hgm, Rebel, chrisw
-
- Posts: 881
- Joined: Sun Dec 27, 2020 2:40 am
- Location: Bremen, Germany
- Full name: Thomas Jahn
Re: Coding Adventure: Chess AI
It is really interesting how one can condense the work of hours into a few minutes of video and it still feels like you're watching someone over the shoulder and don't realize how sped up, cut and 'faked' everything is.
I also tried to document my journey of writing my first engine with a video series on Youtube. And I totally underestimated how much effort it takes to make such effortless seeming videos. I spent many more hours on the videos than on the code I'm showing there.
For example just figuring out the overall narration and then writing it down before you speak it so it's somewhat coherent and fluent and then cut the video to match it and then iterate on all that. I spent 5-10 hours on 15 minutes of video.
Of course this may change with more experience but I know I have gained a lot of newfound respect for content creators on Youtube!
I also tried to document my journey of writing my first engine with a video series on Youtube. And I totally underestimated how much effort it takes to make such effortless seeming videos. I spent many more hours on the videos than on the code I'm showing there.
For example just figuring out the overall narration and then writing it down before you speak it so it's somewhat coherent and fluent and then cut the video to match it and then iterate on all that. I spent 5-10 hours on 15 minutes of video.
Of course this may change with more experience but I know I have gained a lot of newfound respect for content creators on Youtube!
-
- Posts: 7220
- Joined: Mon May 27, 2013 10:31 am
Re: Coding Adventure: Chess AI
My video's did not get more then 100 views. Last video took two years of work.
hi hi hi hi. I mean the work to get user interface running.
Maybe I had better produce digital paintings for I can't paint. So result is the same. Nothing.
hi hi hi hi. I mean the work to get user interface running.
Maybe I had better produce digital paintings for I can't paint. So result is the same. Nothing.
-
- Posts: 866
- Joined: Fri Aug 21, 2020 1:25 am
- Location: Planet Earth, Sol system
- Full name: Michael J Sherwin
Re: Coding Adventure: Chess AI
Unity was used to write this chess app. Therefore C# is the programming language. When I played against the app the quality of the moves seem to be way better than what the source code should produce. I had an easier time playing against SF at 7 ply than against this engine that searches 5 to 7 play and may reach 9 ply in the endgame. The Eval of this engine is not much more than static piece square tables with an adjustment between middlegame and endgame. Maybe there is more but I did not see it.
There is a new programming language called Beef that is compiled C# with extensions that uses LLVM as a backend. It should be trivial to get this engine working as a Winboard or UCI engine using Beef. I want to learn Beef anyway so maybe I'll give it a try.
-
- Posts: 881
- Joined: Sun Dec 27, 2020 2:40 am
- Location: Bremen, Germany
- Full name: Thomas Jahn
Re: Coding Adventure: Chess AI
The interpolation between midgame and endgame is only used for the King. All other types have only a single PST. I think it's a pretty faithful implementation of this:
https://www.chessprogramming.org/Simpli ... n_Function
But there's another interesting tweak to the evaluation for the endgame that is called MopUpEval in the evaluation code and described in the video at this timecode
It would be even more trivial to get the engine working as a UCI engine using C#Mike Sherwin wrote: ↑Wed Feb 17, 2021 9:37 pm It should be trivial to get this engine working as a Winboard or UCI engine using Beef. I want to learn Beef anyway so maybe I'll give it a try.
-
- Posts: 1784
- Joined: Wed Jul 03, 2019 4:42 pm
- Location: Netherlands
- Full name: Marcel Vanthoor
Re: Coding Adventure: Chess AI
IT-person: "It's trivial to get this to work." (<- air of confidence)
Manager: "OK, that's great. Could you fix this before tomorrow, 10:00? Thanks."
IT-person: "... Sure deal." ("I'm so f****...)
Me: "This is gonna take some time... maybe 2-3 days. Friday... thursday, if we're lucky."
Manager: "Hm... not great, but we'll manage in those days. So Friday it is?"
Me: "Sure thing." ("That went well." *whistle*)
- "You didn't tell him how long it would REALLY take, did you?"
- "You got a lot to learn if you want people to think of you as a miracle worker."
*whistle*
-
- Posts: 881
- Joined: Sun Dec 27, 2020 2:40 am
- Location: Bremen, Germany
- Full name: Thomas Jahn
Re: Coding Adventure: Chess AI
And Friday you realize that your estimate was in fact not considering complication X, Y and Z which of course only surfaced after you started working on the task. Right?
-
- Posts: 1784
- Joined: Wed Jul 03, 2019 4:42 pm
- Location: Netherlands
- Full name: Marcel Vanthoor
Re: Coding Adventure: Chess AI
LOL, nope.
"How long is this going to take?"
- "Hm.... about (4 hours) 4 days... if there are no complications."
In time, I have learned to pad time estimates quite generously, because there are ALWAYS complications. (But 4 hours -> 4 days is a bit tongue-in-cheek, obviously.)
-
- Posts: 881
- Joined: Sun Dec 27, 2020 2:40 am
- Location: Bremen, Germany
- Full name: Thomas Jahn
Re: Coding Adventure: Chess AI
Well, that was meant as a purely rethorical statement...
...but after this I couldn't stop wondering how long it would really take.
So, allow me to present to you Fat MinimalChess!
The new MinimalChess gains HUNDREDS of ELO over the previous version of MinimalChess. When do you ever see that kind of improvement in new versions of Stockfish, eh? It also dominates Sargon which only recently (1978) won a computer chess tournament with a score of 5–0.
The following test results will give testament to the claim that Fat MinimalChess is arguably™ the strongest entity that has ever played chess.
Code: Select all
Rank Name Elo +/- Games Score Draw
1 Fat MinimalChess 390 136 73 90.4% 8.2%
2 Sargon 1978 0 74 73 50.0% 15.1%
3 MinimalChess 0.2 -379 136 74 10.1% 6.8%
110 of 150 games finished.
---
In all seriousness: If there's any interest I can clean my hack up a little and put it on github.
-
- Posts: 7220
- Joined: Mon May 27, 2013 10:31 am
Re: Coding Adventure: Chess AI
If your manager would ask to add four more rows to the chess board. How long would it take to get engine running.mvanthoor wrote: ↑Thu Feb 18, 2021 7:36 pmLOL, nope.
"How long is this going to take?"
- "Hm.... about (4 hours) 4 days... if there are no complications."
In time, I have learned to pad time estimates quite generously, because there are ALWAYS complications. (But 4 hours -> 4 days is a bit tongue-in-cheek, obviously.)
Two minutes? For you only have to set number of rows to 12? Or one or two months because that would mean to almost start all over again.
Bitboards only work for 64 bits. Or you have to make it generic. Also have to regenerate suitable magic numbers.