What should be the value change if pawns are doubled? I am creating a chess engine and I am creating a heuristic to change the board evaluation if there are doubled pawns. Now, I have no experience in creating engines, so I figured I would ask this site on how much to change it. The values of my pieces are as such:
King - 10,000
Queen - 100
Rook - 50
Bishop - 30
Knight - 30
Pawn - 10
I am thinking that doubled pawns should be -5 points, tripled -10 points, quadrupled -20 points and so on.
Start with whatever and tune it.
That's how chess engine programming works - you start with some number, and then tune it. For example you start with -5, then create another version with -10. You get the two engines to play against each other, and the one that wins more often is the &quot;correct&quot; version that you keep.
Of course as pointed out by other answers, doubled pawns aren't necessarily bad, so the next step is to start incorporating more features that can mitigate the doubled pawn penalty. For example you could say that if you have a pawn on an adjacent file that is defending the more advanced doubled pawn (e.g., a pawn on f3 given doubled pawns on e4 and e3), then remove the doubled pawn penalty. And then the testing process would start again, you take this patch and create a new fork, then get the two versions to play each other and retain the stronger version. And then you could tune, e.g. maybe &quot;remove the doubled pawn penalty&quot; is too strong, perhaps it should be &quot;take only half the doubled pawn penalty&quot;, etc.
On another note, there is no &quot;standard answer&quot; to how large the doubled pawn penalty should be. Different engines will prefer different values - it depends on the rest of your evaluation function &amp; search function. See this article which contains a paragraph about adding tripled pawn penalties to Ethereal:

You might ask- why can't someone just write a better evaluation function? The answer is that people are trying, but it's difficult. Andrew Grant told me that he tried to add a penalty for tripled pawns (because they're obviously terrible!), but for whatever reason the engine became weaker with that penalty. Code for positional subtleties is extremely unlikely to add strength.