lichess.org
Donate

Meaning of advantage...

Can you help me out?
If we check the analysis at the end of the game, we see a step-by-step chart illustrating a so-called "advantage" value being between -10 and 10 depending on white or black has a better position.
How is that advantage value calculated?
Material, position of pieces (e.g. a knight on a weak e6 is much more valuable than a knight on a1) and king safety.
The advantage is supposed to be roughly equivalent to the number in pawns.
Basically the formulas are:
King = infinte
Queen = 9 Pawns
Rook = 5 pawns
Bishop & Knight = 3 pawns
Pawn = 1 pawn

But the advantage given by stockfish also includes things like which pieces are attacked, is the position good or bad, Is the rook on an open file or closed etc.

The actual code to calculate this advantage is very long, nearly 800 lines.
If the computer says [+1.00] it means white has an advantage as big as 1 pawn extra. This do not mean that he is 1 pawn ahead, but that his position is stronger. If the advantage is over [+0.90] or under [-0.90] it is probobly winning. (+ is white, - black. 0.00 = equal)
Thanks guys, I supposed something similar that the value is a combination of material and position. I thought the concrete algorithm is too complex and won't be shared. :)
Well, it is very complex, but you can still look at it, because Stockfish is open source.

github.com/mcostalba/Stockfish/blob/master/src/evaluate.cpp

There are some other cpp files that are relevant, like material.cpp and endgame.cpp, but most of it is in evaluate.cpp.

Do keep in mind that the score is not the evaluation function applied to the current position, but to the position it calculates will be reached with best play some moves down the road.

If you want to tackle that source code, best wishes on the journey! :)
I'm a programmer so I might have some clue how to understand the logic. :)

This topic has been archived and can no longer be replied to.