Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1410961 Posts in 69598 Topics- by 58584 Members - Latest Member: spaghettisoftware

October 14, 2024, 07:18:02 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsMinimalChess - a simple C# chess engine & making-of video series
Pages: [1]
Print
Author Topic: MinimalChess - a simple C# chess engine & making-of video series  (Read 11015 times)
lithander
Level 3
***


View Profile WWW
« on: December 31, 2020, 08:36:53 AM »

I've started to develop an open source chess engine. Yes, I know there are too many chess engines already, even great and very powerful open source engines like Stockfish.

But I made this project's goal not about achieving maximum playing strength but rather seek the best compromise between code complexity and playing strength. That's why it's called minimal chess. It's written in C# which makes it both cross platform and also easy to use it together with Unity. >>> Github Repository

I try to document the development process with a series of videos on Youtube. So far I learned more about video editing than chess and I've also spent more time on editing then coding. Currently I'm editing the 3rd episode which will be about legal move generation.





« Last Edit: December 31, 2020, 04:26:15 PM by lithander » Logged

lithander
Level 3
***


View Profile WWW
« Reply #1 on: January 04, 2021, 05:02:28 AM »

I've added the 3rd video to the playlist. (https://www.youtube.com/playlist?list=PL6vJSkTaZuBtTokp8-gnTsP39GCaRS3du) This one is about legal move generation. For every given boardstate I want to be able to find all the move the active players can play. This is not as trivial as it seems because in chess you can't make a move if it would put (or leave) your own King in check. So each candidate move needs to be tested against that condition, too.

This, and the naive approach makes my move generator quite a bit slower than established engines. But it makes the code also more readable, I think. I'll try to minimize code complexity up to the point where I've got all components of a chess-engine in place.

If anybody's been watching my videos and wants a guided tour through the move generator logic let me know and I'll make a video about that. Otherwise the next topic will be eval&search.
« Last Edit: January 04, 2021, 05:12:09 AM by lithander » Logged

lithander
Level 3
***


View Profile WWW
« Reply #2 on: January 05, 2021, 07:09:52 AM »

Added a rudimentary AI to the engine today so it doesn't play moves randomly anymore. Now I could try to improve the search or the eval and both areas are risky in the way that bugs and inefficiencies are not really obvious by just playing a few moves against the AI manually. So I'll need to figure out how to automate the testing process and make sure new iterations of the engine really, objectively gain strength.

No new video yet. The lack of an audience is rather demotivating so I'll put it off for a while...
Logged

lithander
Level 3
***


View Profile WWW
« Reply #3 on: March 09, 2021, 05:12:26 AM »

Didn't update this for a while now but that doesn't mean the project is dead.

I've released two versions by now that are completely viable chess engines. Just that they aren't very strong.

Version 0.2 plays at a little above 1000 ELO.
Version 0.3 plays is probably 500 ELO points stronger.

https://github.com/lithander/MinimalChessEngine

Turns out chess programming is actually quite fun. You have clear defined goals and metrics at hand to measure your progress and each new feature is an interesting gamble: Will it's usefulness outweigh it's performance cost? Will the engine get strong from it? How much?

Programming a chess engine is almost like playing a puzzle game. I like to solve toy programming problems in Zachtronics' games and this is not too far off, either! Wink
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic