Development of playing vs fixed depth and tactical training

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

Development of playing vs fixed depth and tactical training

Postby rigao » 16 Dec 2008, 19:43

I tried to make the subject selfexplaining, but who knows... my english is not good enought.

I want to do two things that i think will be usefull and that i cannot find in other much better software that i own (and which u need to pay)

1.- Playing against an engine at fixed depth:
---------------------------------------------------
I dont know if anybody really tries to play against a computer. Often it is a very annoying thing, because no matter what u try, u always end up loosing. This is why ppl developing engines thought it would be usefull to reduce the skill of the engines.

The easiest way is to simply reduce the ply depth of the search. This is my favourite way, because u keep all the positional knowledge of the engine, but it is not tactically unbeatable.

The main problem arises when u want to play say 3/0 games to practice against a strong oponent, or, in my case, when ur one of those miserable ppl who doesnt have internet at home, so ur only way to play is by playing against the computer.

In either case, u want to play against the engine at a defined time controls to emulate an human opponent. Unfortunately, this is not supported by normal chess software (i wont say it is not supported by winboard because i never played a single game there, but i plan to if i can programe this :)) like fritz, or the newer aquarium.

Not only u cannot have ur clock set to, say 3 min for the whole game, but also the engine moves instantly, what is annoying, and makes u play faster than u would want in other circumstances.

What i want to programe is a mode where u can select the max depth of the engine, while keeping the normal pace of a game: So not only i will have my clock set at 3 min, but also the engine's clock will be set to 3 min, and it will take its time to answer, even if it has to reach depth 1 and uses 1 ms to reach it.

How i want to do it? I dont know enought how winboard works, but i think that this must work w/o much programing: When my special mode of play is set at a specified time control and depth, i run the same rutine as if there were no specified depth to reach. The engine will be sending winboard information about evaluation and depth continuously until it decides what to move (i dont know if it is its decition or winboard decition, but it doesnt matter, the point is that it stops after consuming the time is meant to consume under the time control specified).

I will store the best move sent when the engine reaches the ply specified. Other moves will be ignored.

Possibly i will need to start a new game every move, since the engine will think that the move actually played is the move it selected after a long thought, not the one of a specified depth, but i rather want this to happen than to stop the engine at the specified depth and simply put a delay in the GUI, because i have plans for the research it makes after reaching the fixed depth. I think that it wont damage the performance of winboard to create a new game each move, but i could be wrong...

What i want to do with the rest of the search after playing at depth 1 (say)? I want to store the evaluations of the better search, so i will be able to calculate the accuracy of the moves made on the board supposing that the evaluation of the actual depth search is a perfect evaluation.

Exemple: supose it is my turn to move, while im thinking, the engine is also thinking, so it has an opinion about that position, which is reflected in the evaluation score. Now, i make my move. The last evaluation of the engine is kept as the "true" evaluation of the position before my move. Then, the engine starts pondering the new position. It will reach a final decition about the position in the moment it decides to move. We keep this evaluation also.

The loss of the player in this move, compared to the "perfect play" of the engine is the absolute value of the difference between this two evaluations (indeed it doesnt need to be absolute, so u can improve the engine play by finding moves that lead u to a better position than the moves by the engine, but this is not important at this moment).

This way, we can make a mean of the loss of a player during a game. In theory, this loss will be somehow related to the elo rating. Once we find this relation, we can assess the strength of a player in each game, so we can inform the player about his strength, what i find very interesting when u just can play with ur computer.


2.-Tactical training:
----------------------
I want to make possible in winboard what is possible on chessbase in a certain way, and what is done in CT-Art (Convekta): The GUI puts u a position and ask u for the best move in this position. U must make the move u think is the best as if u were in a normal game, and if it is correct it will tell u so and (maybe) put u another problem. If it is not correct, then the GUI will ask u to input another move.

This will be make by keeping track of the number of problems solved correctly, and the total number of mistakes, etc.

In the web there is Chess Tactic Server to train it, but as i said, i dont have internet.

When this is done, it is possible to have different "bases" of positions rated by elo, so it is possible to rate u as well, as it is done in CTS or CT-Art, and it will be possible to plot ur evolution, which i find usefull, and when i do the problems well, very satisfactory :)




Ok, thats all i want to do at the moment... I dont know why i always write so much, but i wanted to make myself clear, so maybe i can attract the atention of somebody who wants to help me :)

Thx for reading me.
rigao
 
Posts: 63
Joined: 14 Dec 2008, 17:33

Re: Development of playing vs fixed depth and tactical train

Postby H.G.Muller » 17 Dec 2008, 00:16

The first thing you want is probably implemented much more simply by having WinBoard delay an adjustable number of seconds (default: 0 sec) after receiving a move from the engine before processing it.

How is the second thing you want different from WinBoard "training mode"?
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Development of playing vs fixed depth and tactical train

Postby rigao » 17 Dec 2008, 13:12

The first one can be made via delay. It is possible and will work fine. But i think it would be more interesting to make the engine think as far as it can to have a reliable evaluation. Then winboard can tell you how well have you played compared to this reliable evaluation. It is not needed, but i would love it :)

And in the second part, i want winboard to be able to load a "tactic base" that might perfectly be a collection of fen positions and some moves to find.

Winboard then will load the first fen, and ask you for a move. If the move introduced is not the move in the base, then it will tell you that this is not a correct move, and ask you for another move. This will be made until there are no more moves associated to this fen.

Then, winboard will load another position to solve, and the process starts again.

I supose that keeping track of the mistakes made and of the total number of positions solved is not that dificult, so the main problem will be to have a tactic base to load and to ask the user to input a move.
rigao
 
Posts: 63
Joined: 14 Dec 2008, 17:33

Re: Development of playing vs fixed depth and tactical train

Postby rigao » 17 Dec 2008, 19:53

Now that i can build winboard 14 at least, can some1 plz tell me where can i find the instruction when winboard is told to play a new game, and where it sends to the engine (and receive from it) the moves, and some important information i must know to change things there
rigao
 
Posts: 63
Joined: 14 Dec 2008, 17:33

Re: Development of playing vs fixed depth and tactical train

Postby rigao » 18 Dec 2008, 20:39

Muller, u told me that i can use a delay instruction to keep the engine from moving.

Where can i put this instruction? I find the winboard code very confusing, starting with the fact that every file is called .c but is C++, so it usually is .cpp.

Anyways, if u can just tell me where would u put this instruction, i start from there trying to understand what winboard do.

Oh, and another important question:

Which important global variables i must know? Because i saw some of them (i was told when studying C that u MUST NEVER, EVER, use global variables, but well, i supose they make ur life easier if handled correctly) and they seem pretty important. So it would be great if u could explain me what is its use.

As example, i saw, if i remember correctly, two kind of very important variables: one is one that keeps the important information of winboard, like what kind of mode u want, where the windows are, etc. The other keeps track of how the game is going, with its move, scores maybe, etc.

But if u can expand it, i will be trully gratefull.
rigao
 
Posts: 63
Joined: 14 Dec 2008, 17:33

Re: Development of playing vs fixed depth and tactical train

Postby H.G.Muller » 18 Dec 2008, 23:54

WinBoard is written in plain C, not C++.

I have not thought about this much, but a good place to put the delay would be in the routine HandleMachineMove() in backend.c. A sleep call there at the beginning would simulate the machine move coming in later.

Important variables are boards[500][8][8] which is a stack of 500chess boards (one for each move), holding the complete game history. The structure appData holds the option settings, gameState the game state, and the gameInfo structure a lot of info on the current game. structures first and second contain info about the engines.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Re: Development of playing vs fixed depth and tactical train

Postby rigao » 19 Dec 2008, 11:53

I thought that u couldnt declare variables wherever u want in C. I thought this was a feature of C++. And as i see declarations in the middle of procedures, this is why i thought it must be C++. Anyways, as i dont understand half of the code, if i think its c++, then i wont feel so stupid.

I will start to look at handlemachinemove (i already did, had this procedure high in my list of procedures to understand, but hey, its really hard!

If i would the engine to think just to depth 1, where i would put this instruction (i supose it is in some place, but couldnt find it!)? In handlemove too? How it would look like?


Hey, and thanks very much for taking ur time to answer my questions, which im sure are some times very stupid, but i think soon i will be able to handle this by my own, and wont make lose more of ur time :)
rigao
 
Posts: 63
Joined: 14 Dec 2008, 17:33

Re: Development of playing vs fixed depth and tactical train

Postby H.G.Muller » 19 Dec 2008, 21:56

If you want to extract the move from an earlier iteration, you would have to look to the variables programStats and pvInfoList, which store the thinking output the engine sends. (But only the last line; they overwrite each other, so you have to intercept the iteration you want.) If the engine finally plays another move, you might want to use the functions Reset() and FeedMovesToProgram to reset the program to the desired position, or you might simply send an undo command to the program, put it in force more, send the earlier move you extracted, and give it a new go command when it is its turn again. Not all engines support undo, though.
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL


Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 20 guests