Recommended readings to write a good evaluation function?

Discussion of chess software programming and technical issues.

Moderator: Ras

BrianNeal
Posts: 8
Joined: Sat Dec 26, 2020 5:58 pm
Full name: Brian Neal

Recommended readings to write a good evaluation function?

Post by BrianNeal »

I have a really simple evaluation function (material + pst + basic pawn structure) which I tune the Texel's way and I would like to improve it significantly.
Since I'm not a chess player, which books/web sites/whatever do you suggest to study? (besides the CPW of course)
User avatar
xr_a_y
Posts: 1872
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Recommended readings to write a good evaluation function?

Post by xr_a_y »

From Xiphos author :

"This project is inspired by Garry Kasparov's "Deep Thinking: Where Machine Intelligence Ends and Human Creativity Begins." This fantastic book has evoked my childhood passion, computer chess. I was wondering how hard it could be to develop an engine strong enough to surpass the legendary Deep Blue, so I gave it a try."

https://github.com/milostatarevic/xiphos

Maybe some good inputs, I don't know.
Harald
Posts: 318
Joined: Thu Mar 09, 2006 1:07 am

Re: Recommended readings to write a good evaluation function?

Post by Harald »

Why do you say besides CPW when there are still lots of good evaluation functions that you don't have yet?
CPW is good. There are the first simple evaluation features. You can start here:
https://www.chessprogramming.org/Evaluation
with Basic Evaluation Features. Examples:
https://www.chessprogramming.org/CPW-Engine_eval

Try some Google searches with keywords: chess evaluation or scoring.
Follow links to beginners chess knowledge and blogs about chess topics.
Try to find some evaluations for all basic topics like pawn structure, passers, mobility, king safety, ...

At the other end of complexity is this:
http://www.winboardengines.de/doc/Littl ... endium.pdf
This is either scaring or give you work for years.
There are hundreds of evaluation suggestions. But you have to implement them yourself.
First implement frequent features that are easy to implement, can be calculated fast and give many points.
The exact score of each feature may be discussed. And feature scores depend on other implemented features.
Not all ideas there are accepted by all people. Some players may disagree with some features.

Writing an own evaluation function can be fun and frustrating at the same time.
User avatar
maksimKorzh
Posts: 775
Joined: Sat Sep 08, 2018 5:37 pm
Location: Ukraine
Full name: Maksim Korzh

Re: Recommended readings to write a good evaluation function?

Post by maksimKorzh »

BrianNeal wrote: Thu Jan 14, 2021 6:41 pm I have a really simple evaluation function (material + pst + basic pawn structure) which I tune the Texel's way and I would like to improve it significantly.
Since I'm not a chess player, which books/web sites/whatever do you suggest to study? (besides the CPW of course)
Did you check up stockfish evaluation guide?
It has JS implementation of SF classical eval:
https://hxim.github.io/Stockfish-Evaluation-Guide/
Dann Corbit
Posts: 12808
Joined: Wed Mar 08, 2006 8:57 pm
Location: Redmond, WA USA

Re: Recommended readings to write a good evaluation function?

Post by Dann Corbit »

Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.
BrianNeal
Posts: 8
Joined: Sat Dec 26, 2020 5:58 pm
Full name: Brian Neal

Re: Recommended readings to write a good evaluation function?

Post by BrianNeal »

Thanks for all the answers, now I've a lot of stuff to study :D
User avatar
mvanthoor
Posts: 1784
Joined: Wed Jul 03, 2019 4:42 pm
Location: Netherlands
Full name: Marcel Vanthoor

Re: Recommended readings to write a good evaluation function?

Post by mvanthoor »

Personally I'm writing my (first) evaluation function on the basis of my own chess knowledge.

This means that, as long as Rustic thinks to about the same depth as I do (+/- 8 moves), it plays almost exactly the moves I would have played myself. When I'm now playing a game against my own engine, it's eerily feels like as if I'm playing a game against myself from both sides. The only things Rustic does that I don't, is go after any material advantage, and it doesn't put any value on things like the bishop pair because that's not coded yet.

The more features I put in the evaluation, the closer Rustic will play like I do; until it gains a transposition table. Then it'll start to out-think me with regard to search depth. Positionally, it'll be about equal to myself because of the evaluation function, but tactically, it'll be stronger as it thinks deeper.
Author of Rustic, an engine written in Rust.
Releases | Code | Docs | Progress | CCRL