stockpanda
- 11 Devlogs
- 8 Total hours
open source chess engine
open source chess engine
implemented phase-based evaluation!
essentially, the engine changes based on the phase of the game (opening, middlegame, endgame). for example, you want to have your king active in the endgame but safe in the opening. thats what this change does!
implemented endgame tablebases!
essentially, chess is solved with 7 pieces or fewer. so instead of trying to calculate the perfect move in a complicated position, we can just look it up in a precomputed database of all positions with 7 pieces or fewer. this is a huge boost for endgame play, and also lets the engine play perfectly in those positions instead of relying on heuristics. the syzygy tablebases are the standard in the chess programming community, so i used them!
implemented an opening book!
essentially, for common openings, the engine has a file of the best moves in those common positions. this makes it a lot better (and faster) at the opening stage.
implementing it was pretty difficult because of some issues with the book file, but it eventually worked!
implemented transition tables!
essentially, transition tables cache evaluations to reuse if the position is achieved through a different set of moves (transposition).
implemented quiessence search!
basically, the engine keeps searching until the position becomes stable. for example, lets say the user can trade queens on move 5. it would see that and think that line is winning, but fails to see past move 5 where the opponent can recapture the queen. this 5-depth barrier is known as the horizon effect!
creating logo for stockpanda! it looks pretty cool to me, ngl. made in Figma. pretty simple but straight to the point. modeled after stockfish logo
added iterative deepening!
essentially, it has a max thinking time and thinks as much as possible in that time. this makes it way faster!
added alpha-beta pruning! basically, if a branch in the tree is already bad, then my engine stops looking at the line (ex: blunders queen on move one, no need to look at that line).
only 26 lines changed, but it was difficult to implement and i kept facing errors.
basic minimax algorithm implemented with piece values and piece square tables to make it decently accurate
created the board and legal move logic!
took notes on chess engine design and created a course of action