A State Value Function (SVF) is a mathematical function that assigns a value to each state that a game exists in.
The SVF takes any game state as an input and returns as output the value of that state, usually from an individual player’s point of view.
How the state is modelled varies from game to game, but in board games, the state is the board state.
In Chess, the board state is defined as the position of all the pieces on the board, and whose turn it is.
There are many different State Value Functions that one could choose for chess, but the one that chess.com uses is to map the board state to the probability that the current player will win the game (assuming that they play reasonably well in future!)
We have a live demo from Valloch Gaming of this SVF adjusting in real-time during a real chess game below. Keep an eye on the line on the left!
The concept of State Value Functions is especially useful when programming NPC AI, but we’ll cover that another time!