Disclaimer: I'm very new to computer science & game programming

I'm having trouble with understanding how to implement a static evaluation function in chess. The logic seems simple like just apply a weight to each piece on the board and subtract the pieces from each side, but its much more complex than that isn't it? You'd have to calculate a method of analyzing the board and each of the MULTIPLE actions that are occurring on the board at the same time (ie. Castling, checking pawns are being lost, if you're in check etc etc).

Is there a relatively simple way of implementing a static evaluation function to a chess board to "see" whats going on at each stage?

Side Note: I understand that you could implement things like Minimax (with $ \alpha - \beta$ pruning) searches onto the trees created via the static evaluation functions, so correct me if I'm wrong but whats going on is that $$ f(Board) = c_1 * (thing 1) + c_2*(thing 2) + \cdots $$ but where do those $ \cdots$ end??? And from there, we get a number which we put in our tree then implement the minimax algorithm, to figure out the best move forward?

Are there any resources for this type of thing that I could possibly read? Thank you.

  • 1
    $\begingroup$ chessprogramming.wikispaces.com is a good resource for this. Try to see whether you can find your answer there and return with a more focused question if you can't. Generally, most chess algorithms use a variant of minimax with a static evaluation function. It is known that this function isn't ideal, but there are multiple tricks involved to make it reasonable. $\endgroup$ – Discrete lizard Feb 20 '18 at 5:51

There are simple ways to do so but it may not be a very good heuristic. For example going off of current piece valuation is very simple but leads to poor aggressive behavior. There are many other things to account for in addition to piece valuation like centrality and pawn structure that when included, is subjectively simple. See https://chessprogramming.wikispaces.com/Evaluation for more notes on evaluation and for general chess programming advice.

Regarding your side note: 'Those things' end based on your heuristic function. Yes you get a board valuation that is used to determine how good a move is, guiding your game tree search.

| cite | improve this answer | |
  • $\begingroup$ A common technique used to improve a pure material evaluation function is to determine which positions are 'quiet' (= they're unlikely to immediately lead to material improvement of either player) and postpone evaluation to only evaluate quiet positions. Of course, this is still insufficient, as the player is completely oblivious to positional advantages. $\endgroup$ – Discrete lizard Feb 20 '18 at 7:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.