please give me your tips or opinions about this :)

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

please give me your tips or opinions about this :)

Postby pimidrez » 01 Apr 2013, 22:55

Hi all, some time ago I've been trying to program an engine that plays a decent game of chess, but I did not succeed. At some point in the game my engine always makes a bad move, very bad.

My engine only plays at a depth 3 with quiescence search, for now
I faced with engines configured to play only depth 1, so my engine can win. But he never manages to win a game.
Even when I play against him, he loses.

So here I am now remaking its evaluation function. trying to go very slowly in every detail to get to play a decent game.

And here is where I need your opinions and help.

For now I'm just considering the material balance board, PSQ tables (extracted from other engines) and some king safety ..

Material:
Rook = 500
Queen = 950
Knight = 325
Bishop = 325
Pawn = 100

some recommendations or tips for a more stable game and avoid bad moves?

respuestas en español serán agradecidas ;)
pimidrez
 
Posts: 46
Joined: 31 May 2008, 20:47

Re: please give me your tips or opinions about this :)

Postby H.G.Muller » 02 Apr 2013, 08:21

A 3-ply search should easily win against a 1-ply search, so you can be sure you have a search bug. Changing the evaluation cannot fix that, you will have to debug the search.

The procedure is:
*) find a position in which the engine makes a 'very bad move' reproducibly.
*) put a print statement directly after the recursive call to Search, to print on a file:

plyNumber:depth move score bestScore {alpha, beta}

where depth alpha and beta are the arguments in the call to Search for this node, plyNumber is how far you are from the root, move is the move it just searched and score its score. For a 3-ply search this should not create an unmanagebly large file yet. (If it would, you would have to put an if() statement in front of it to print more selectively. Perhaps you should start doing that anyway, with if(plyNr < 2) to first only ply info in the root, and then try if(plyNr < 3) to also print the root's daughter nodes, etc.)

From this tree dump you should be able to figure out where the search goes wrong.
User avatar
H.G.Muller
 
Posts: 3224
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: please give me your tips or opinions about this :)

Postby pimidrez » 02 Apr 2013, 18:04

Thanks Muller!

exactly as you say, I found a bug in my movement generator when checking if it was in check with the knight.
now plays more decently, and already won a game against another engine set to ply 1 ...

I'm counting the movements of each piece:
Reina = 1 centipawn
Bishop = 1 Centipawn
Rook = 1 centipawn
Knight = 4 centipawn

These values ​​are within the average? I'm not sure about the Bishop and the Rook
pimidrez
 
Posts: 46
Joined: 31 May 2008, 20:47

Re: please give me your tips or opinions about this :)

Postby Diaz » 10 Apr 2013, 15:58

Hi there

I guess that if you found a bug in your move generator, before attempting anything else you should get pretty sure this part of the code is bug-free.

As probably you already know, the "key word" for testing your move generator is "perft":
http://chessprogramming.wikispaces.com/Perft+Results

Best

E Diaz
Diaz
 
Posts: 4
Joined: 19 Mar 2013, 16:31

Re: please give me your tips or opinions about this :)

Postby pimidrez » 11 Apr 2013, 02:23

Thanks diaz, I didn't know about "perft"!!
pimidrez
 
Posts: 46
Joined: 31 May 2008, 20:47

Re: please give me your tips or opinions about this :)

Postby Diaz » 11 Apr 2013, 08:11

By the way, talking about perft, don't limit yourself to the initial position.

Maybe these links can be useful to you:
http://talkchess.com/forum/viewtopic.php?t=42463
http://talkchess.com/forum/viewtopic.php?t=40917
Diaz
 
Posts: 4
Joined: 19 Mar 2013, 16:31


Return to Programming and Technical Discussions

Who is online

Users browsing this forum: Google [Bot] and 4 guests