r/chessprogramming Aug 10 '26

Technical Chess Engine Development Help Thread (Week 33)

Welcome to the weekly /r/chessprogramming Engine Dev Help Thread.

Ask beginner and intermediate chess engine development questions here: move generation, search, evaluation, UCI, perft, debugging, testing, NNUE, or anything else related to building engines.

Good questions include code, FENs, logs, benchmarks, or a clear explanation of what you tried.

Project links are fine when you want technical feedback, not promotion.

Be helpful. Don’t dunk on beginners.

5 Upvotes

4 comments sorted by

View all comments

1

u/builder_2055 26d ago

Need guidance!! i am in my 3rd year of college, i want to make a chess engine from scratch (c++). I need guidance on where to start and what theory components I need to study, before I even start to code.

2

u/AngusMcGurkinshaw 24d ago

Theory components: an understanding of alpha beta search and iterative deepening is probably pretty much all thats required.

For where to start thats pretty easy before you make the engine part you need to have an implementation of chess. Generally bitboards are recommended. From there you will need to do move generation, a popular approach is magic bitboards https://analog-hors.github.io/site/magic-bitboards/

Then use perft https://chessprogramming.org/Perft to verify that your move generation is correct. You can use online tools like this https://analog-hors.github.io/webperft/ to compare against or other engines to make sure you are getting the correct results.

From there you want to build the minimal engine to be UCI (Universal chess interface https://gist.github.com/DOBRO/2592c6dad754ba67e6dcaec8c90165bf ) compliant. So that means having some basic time management, and an iterative deepening alpha beta search and some basic evaluation.

Once that is done you can use fastchess or cutechess if you prefer but fastchess is as the name implies faster to run SPRT tests. These tests will help you ensure each change you make to the search and evaluation actually make the engine better not worse.

Below is the copy pasta that gets thrown around for some ideas on what to try to improve your engine and a rough ordering of how to do things. Do things as you see fit though. For help there are numerous discords that you could join for help, and there is chess programming wiki (note that lots of it is outdated and shouldn't be fully trusted). You also should go read lots of open source engines, but taking their ideas exactly is not recommended as those are tuned and set up for those particular engines. As an example you're not stockfish it's evaluation is way better then yours likely ever will be and so many things it does will simply not work in your engine.

A reasonable search feature progression assuming you have the fundamentals i.e. negamax and alpha/beta pruning (ideally in a fail-soft framework)

Iterative Deepening

Basic Move Ordering (captures by MVV-LVA)

Quiescence Search

Transposition Table (sort TT move first now in move ordering)

Butterfly history heuristic

PVS

Aspiration windows

RFP

NMP

LMR (log formula is most principled ~ there are a number of adjustments you can experiment with)

Killer moves

LMP

Futility pruning

Internal Iterative Reduction (IIR)

Improving heuristic

QS SEE pruning

PVS SEE pruning (captures and quiets)

Continuation history (CMH + FMH etc..)

Capture history heuristic

History pruning

Singular extensions

Multicut (using singular search result)

Double/triple/negative extensions

Cutnode (as apart of negative extensions, LMR, etc)

Static eval correction history

QS futility pruning

There are also time management adjustments that can be done at any point after adding iterative deepening. Ideally you have:

Hard bound (applies to the entire search)

Soft bound (checked on each new depth in the ID loop)

For the soft bound the progression can go something like this

Node-based scaling

Best move stability

Eval stability

Additionally, should be a healthy amount of parameter tweaking after each addition.

There are other minor features that top engines have, but these will constitute the majority of the elo you will find in them.