Sven Schüle wrote:xmas79 wrote:the simplest thing I could think to improve its performance: pieces pseudo-mobility
What is that? Do you mean: number of pseudo-legal moves of pieces?
Yes

I mean that. Suppose one queen each side and two bishops each side. I count pseudo-legal moves of queen for white and use this number directly as a score, adding it to the material evaluation. So if queen has 13 moves, then score is MATERIAL_VALUE+0.13. Then I evaluate black queen by counting all possible pseudo-legal moves and subtract to the eval and so on.... Very simple (and probabily wrong), but I used to "randomize" search a bit, because without it every move in mid-game looks the same and actually played much worse... I had very simple PST, but I actually dropped them because I know they must be tuned in some way (as everything), and must be done for opening/mid-game/endgame, and I didn't want to do that yet. Pseudo-legal moves are ideal (I think), as each piece assumes a different values at different times during the game (except for king, that's why it never castles). They also let the engine to play a little "aggressive" because a knight that can attack opponent pieces is evaluated better than a knight in a defensive position.... Only funny reasoning here...
xmas79 wrote:"pawn distance to promotion square bonus" to encourage pawn pushing in endgames (but it actually takes that as an advice in the opening LOL, so you see h4 g4 f4 f5 and moves like that

)
I think you should encourage pawn pushing for
passers only, unless you implement much more knowledge about pawn structure (e.g. candidate pawns). Getting this right can already help to keep the pawns in front of the king after castling.
I wanted to simply put something into pawn evaluation. The first thing I thought was that, and that allowed to win some endgame because the engine knows that a pawn near the promotion-rank has a better evaluation, even if it has not the depth to see the promotion.
xmas79 wrote:, as they are very basic things that are really easy to implement.
But these "easy to implement" eval features can already turn your evaluation function into quite a bad one if you don't do them right.
The approach of starting with a technically clean and stable engine and then implementing a decent search first while using only a minimal evaluation function is certainly good, but in that case I suggest that you even reduce your eval to only two or at most three features for a really consistent approach:
- material (possibly including a bishop pair bonus),
- piece-square-table,
- and possibly passed pawn detection (with a rank-dependent bonus as mentioned above).
King PST (the one for the opening/middlegame) can be written in a way that encourages castling, although this will certainly need to be corrected later on when implementing king safety and being faced with the "exceptional" cases where the king is safer in the middle. Other topics for PST include centralization (e.g. knight, pawn, king in endgame), back rank penalties for knights/bishops, or bishops on long diagonals.
I would fully drop everything else in the beginning, like endgame recognition, "piece pseudo mobility", or pawn-push encouragement for non-passers.
Sven
As you said, my intent was to have a bug-free working search framework, and that goal was I think achieved successfully.
I had only a material evaluation function, but I soon recognized that I needed something to go one step further.
Remember my first post about KNB-k endgame? How to test the engine? Forced mates (and consequently endgames) are the most obvious positions...
Once the engine can mate KNB-K after a long time search, how do you go a step further? Add a mating table and let search mate you faster and faster. Then you move to KQK and KRK endgames, and find that you need another table ot give some hint, then you go to KBBK and see if everything is ok, then you try a simple KPK and see that it will promote, but will need some time to discover the promotion, so you add a "push that pawn!" code in the evaluation. Then you start adding some piece here and there, and see how the engine behaves, until you see no progress because every move looks the same... What to do? Run a game or fix that stupid KBP-K drawn endgame that your engine cannot handle at short depths? ---> Basic endgames recognition. Then everything looks ok, it's time to run a game, and it will be lost even before the first move is played on the chessboard, because without a PST or something like that 1.f4 xxx 2.Dh5 (as Henk wrote) are the same move as 1.e4 xxx 2.Nf3... Stuck as before the endgame recognition... You see? How to "shuffle" search withouth crappling completely it out? Without introducing (a lot of) instability? Considering that a piece in the middle of the chessboard is better than one in the corner because it has more "moves", here we go.. a highly dynamic PST based on position, with a simple method. Of course in the endgame every move looks the same.... and far from perfect in the openings.... So this still has problems... But that's another story!
I know there are things that maybe I need to tune (in search), but my eval function was a quick hack, right or wrong.... I think I just tested my search code

... and I need to completely wipe out my eval
Sorry for long posting!
Thank you,
Natale.