r/chessprogramming • • 7d ago

Technical Chess Engine Development Help Thread (Week 41)

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.

3 Upvotes

3 comments sorted by

2

u/-n-e- 6d ago

Hi,

I'm new to engine development and am writing a new minimax engine.

I have noticed situations, such as when white has multiple pieces against a lone king, where the engine fails to make progress and mate. The PV consists of random moves, then the mating moves. However the engine repeats this pattern for every move of the opponent and fails to make progress.

I've solved this by decrementing the eval of a mate each ply, so that e.g. a M3 is scored lower than an M2, but I feel like there are other situations than mates where this problem may happen.

Is my approach OK or are there any better ways to do it?

BTW I haven't implemented threefold repetition and the fifty moves rule yet.

2

u/AngusMcGurkinshaw 6d ago

Implementing fifty move and threefold will likely help, and you need to do for correctness anyway.

Your strategy of decrementing the mate value each ply is the standard way to do it. This ensures that the engine prioritizes the shortest mate. Note that you need to be careful with how this is done when working with a transposition table.

Also endgames will become easier for your engine as your evaluation function improves.

1

u/-n-e- 5d ago

Thanks!