Take the 2-minute tour ×

I am designing a game of chess and the AI behind it implementing a search tree with alpha-beta pruning. I have a difficulty in designing the evaluation function for the game.

How does one go about designing an evaluation function for ANY sort of game?

share|improve this question

closed as not a real question by jusio, djechlin, Fahim Parkar, evilone, ppeterka Dec 1 '12 at 8:27


smells like homework. usually best to include this in your question lest people frown upon you. also, you have to show that you've given this at least some effort ;) –  Mark Dec 1 '12 at 5:51
add comment

1 Answer

One popular strategy for constructing evaluation functions is as a weighted sum of various factors that are thought to influence the value of a position. For instance, an evaluation function for chess might take the form

c1 * material + c2 * mobility + c3 * king safety + c4 * center control + ...

Such as

f(P) = 200(K-K') + 9(Q-Q') + 5(R-R') + 3(B-B'+N-N') + (P-P') - 0.5(D-D'+S-S'+I-I') + 0.1(M-M') + ...

in which:

K, Q, R, B, N, P are the number of white kings, queens, rooks, bishops, knights and pawns on the board.
D, S, I are doubled, backward and isolated white pawns.
M represents white mobility (measured, say, as the number of legal moves available to White).


share|improve this answer
add comment
