Skip to content

Planning

Since this was my time making a project that relied on knowledge of efficient programming, not to mention the added complexity of chess, I had to plan out the project in detail before starting to code.

Research

I spent multiple days researching and learning about the technologies and tools that would be used in this project. This included understanding the basics of chess engine functionality and understanding reinforcement learning concepts. To research, I used the following resources, and can not recommend them enough:

Reinforcement Learning Resources

MiniMax and Chess Engines Resources

Ideas Explored and Implemented

Furthermore, throughout the research phase, I explored various ideas and techniques that could be implemented in the chess engine and added them here:

  • [x] Board Implementation
  • [x] Opening Tablebase
    • [x] Format the opening book into JSON so that you can write more elegant code
  • [x] Evaluation
    • [x] NNUE (read the stockfish code)
    • [x] Incremental Updates (to make code more efficient)
      • Instead of recalculating the entire evaluation from scratch for each position, maintain incremental evaluation values.
      • This would mean having a evaluation variable that you update rather than recalculating. This means custom move and unmakemove functions that work on top of the originals
      • When a move is made, only update the parts of the evaluation that have changed.
      • LAST STAGE EVALUATION
    • [x] Piece Values
    • [x] Piece Square Tables
      • [x] Separate for middle and endgame (king, pawns)
    • [x] Quiescence search
    • [ ] King safety?
    • [ ] Pawn structure?
    • [ ] Mopup valuations?
      • Simply, if the game is in endgame, push the opponent king towards the edge of the board, and your king towards the opponent.
    • [x] Passed pawns (bitboards? protected past pawns?)
      • [ ] Isolated pawns as well
    • [ ] Null move pruning
    • [x] Coding Adventure: Chess Move ordering; attacked square pruning
  • [x] MiniMax
    • [ ] Search Extension? (i.e. looking deeper when the opponent is in check? Either pawn on the verge of promotion? Mb other ideas?)
    • [x] Multi-threading
  • [x] Alpha-Beta pruning
    • [x] Arrange better moves first?
  • [x] Variable Depth
    • [ ] Middle game: 10
    • [ ] End game: 20
    • [x] Iterative Deepening
  • [ ] Hexaly??? (Hexaly Optimizer)

Sprints

The project was divided into multiple sprints, each focusing on a specific aspect of the chess engine. Each sprint had its own set of goals and deliverables. The approximate time spent and the goals for each sprint are detailed in their respective devlog entries.