How to implement the UCI command "currline".

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

Moderator: Andres Valverde

How to implement the UCI command "currline".

Postby Josu? Forte » 24 Apr 2005, 03:01

Hi,

I would like to implement the UCI command "currline" in my chess engine.
Can someone give a clue on how to implement it? A small piece of code in C language would be appreciated.

By the way, does Arena 1.1 support "currline" command? If so, how to activate it?
Are there any free UCI engines that support such command. If so, please tell me their names.

Thanks in advance for any help.

Regards,
Josu
User avatar
Josu? Forte
 
Posts: 25
Joined: 02 Oct 2004, 23:58
Location: Rio de Janeiro / Brasil

Re: How to implement the UCI command "currline".

Postby Steve Maughan » 24 Apr 2005, 19:16

Josu? Forte wrote:By the way, does Arena 1.1 support "currline" command? If so, how to activate it?
Are there any free UCI engines that support such command. If so, please tell me their names.


Josu?,

Yes my engine Monarch supports "currline" (www.stevemaughan.com). It's really quite easy to implement. Do the following:

1) On entry to AlphaBeta see if you need to Poll the input e.g. If (nodes & 0xffff ==0) then Poll;

2) At the same time see how long it was since you output a CurrLine. If it's more than 0.5 secs then send the current line up to the PV of the AlphaBeta routine.

3) You can ignore the multi-processor aspects of CurrLine assuming that you don't use SMP

Here's Monarch's code:
Code: Select all
void uci_current_line(struct ply_parameters *p)
{
   static char s[1024];
   int i;

   strcpy(s,"info currline");
   for(i=0;i<(*p).ply;i++){
      strcat(s," ");
      strcat(s,move_string(search_parameters[i].current_move));
   }
   send_command(s);   
}
Steve Maughan
 
Posts: 48
Joined: 06 Oct 2004, 17:40
Location: Florida USA

Re: How to implement the UCI command "currline".

Postby Josu? Forte » 24 Apr 2005, 21:47

Hi Andrew,

UCI 2 protocol is unclear to me in many points, as well.
For instance, there is an option called "UCI_EngineAbout" that is not even mentioned in the protocol 2.
In my opinion, it lacks to give good examples on how to implement all the commands.
Most of the UCI commands I have implemented in my engine were taken from the publicly available UCI engines. I thanks their authors.

Before sending my message to the this forum, I tried exactly what you suggested but it does not work.
There must be a trick to implement "currline" command.

Regards,
Josu
User avatar
Josu? Forte
 
Posts: 25
Joined: 02 Oct 2004, 23:58
Location: Rio de Janeiro / Brasil

Here's Shredder Classic's UCI Log

Postby Steve Maughan » 24 Apr 2005, 22:27

Josue,

Here's the UCI log from Shredder Classic using Monarch as the engines. It shows the GUI initializing the engine and sending the "setoption name UCI_ShowCurrLine value true" command. Monarch then simply send the Current Line to the GUI and it is displayed. Hopefully this will help.

Regards,

Steve

Code: Select all
Sun Apr 24 17:19:53 2005:   to Monarch 1.47 (0): uci
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): id name Monarch 1.48
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): id author Steve Maughan
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): option name Hash type spin default 1 min 1 max 128
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): option name Ponder type check default true
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): option name UCI_ShowCurrLine type check default false
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): option name UCI_ShowRefutations type check default false
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): option name UCI_LimitStrength type check default false
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): option name UCI_Elo type spin default 1950 min 1200 max 1950
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): option name Checks in QSearch type check default true
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): option name Repeatable Search type check default false
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): option name Show Strings type check default true
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): option name ETC Depth type spin default 4 min 0 max 100
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): option name IID Depth type spin default 4 min 3 max 100
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): option name Extension to Zero type combo default 2.2 var 1.5 var 1.6 var 1.7 var 1.8 var 1.9 var 2.0 var 2.1 var 2.2 var 2.3 var 2.4 var 2.5 var 2.6 var 2.7 var 2.8 var 2.9 var 3.0 var 3.1 var 3.2 var 3.3 var 3.4 var 3.5 var 3.6 var 3.7 var 3.8 var 3.9 var 4.0 var Infinite
Sun Apr 24 17:19:53 2005: from Monarch 1.47 (0): uciok
Sun Apr 24 17:19:54 2005:   to Monarch 1.47 (0): setoption name Hash value 128
Sun Apr 24 17:19:54 2005:   to Monarch 1.47 (0): isready
Sun Apr 24 17:19:55 2005: from Monarch 1.47 (0): readyok
Sun Apr 24 17:19:55 2005:   to Monarch 1.47 (0): setoption name Ponder value true
Sun Apr 24 17:19:55 2005:   to Monarch 1.47 (0): setoption name UCI_ShowCurrLine value true
Sun Apr 24 17:19:55 2005:   to Monarch 1.47 (0): setoption name UCI_ShowRefutations value false
Sun Apr 24 17:19:55 2005:   to Monarch 1.47 (0): setoption name UCI_LimitStrength value false
Sun Apr 24 17:19:55 2005:   to Monarch 1.47 (0): isready
Sun Apr 24 17:19:55 2005: from Monarch 1.47 (0): readyok
Sun Apr 24 17:20:00 2005:   to Monarch 1.47 (0): ucinewgame
Sun Apr 24 17:20:00 2005:   to Monarch 1.47 (0): isready
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): readyok
Sun Apr 24 17:20:00 2005:   to Monarch 1.47 (0): position startpos
Sun Apr 24 17:20:00 2005:   to Monarch 1.47 (0): go infinite
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 1 seldepth 1
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 1 seldepth 2
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 2 seldepth 2
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 3 seldepth 3
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 3 seldepth 4
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info score cp 25 time 16 depth 3 seldepth 4 nodes 407 pv d2d4 g8f6 g1f3
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 4 seldepth 4
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 4 seldepth 5
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 4 seldepth 6
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 4 seldepth 7
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info score cp 0 time 16 depth 4 seldepth 7 nodes 713 pv d2d4 g8f6 g1f3 d7d5
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 5 seldepth 5
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 5 seldepth 6
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 5 seldepth 7
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 5 seldepth 8
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 5 seldepth 9
Sun Apr 24 17:20:00 2005: from Monarch 1.47 (0): info depth 5 seldepth 10
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 5 seldepth 11
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info score cp 25 time 47 depth 5 seldepth 11 nodes 4947 pv d2d4 g8f6 g1f3 d7d5 b1c3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 6 seldepth 6
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 6 seldepth 7
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 6 seldepth 8
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 6 seldepth 9
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 6 seldepth 10
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 6 seldepth 11
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 6 seldepth 12
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info score cp 0 time 47 depth 6 seldepth 12 nodes 11341 pv d2d4 g8f6 g1f3 d7d5 b1c3 b8c6
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 6 seldepth 13
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 7 seldepth 7
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 7 seldepth 8
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 7 seldepth 9
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 7 seldepth 10
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 7 seldepth 11
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 7 seldepth 12
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 7 seldepth 13
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 7 seldepth 14
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 7 seldepth 15
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info depth 7 seldepth 16
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info score cp 16 time 235 depth 7 seldepth 16 nodes 56952 pv d2d4 g8f6 g1f3 d7d5 b1c3 b8c6 c1e3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info score cp 17 lowerbound time 422 depth 7 seldepth 16 nodes 86084 pv e2e4
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currline e2e4 g8f6 e4e5 c7c5 e5f6 b7b6
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info score cp 20 time 750 depth 7 seldepth 16 nodes 120626 pv e2e4 b8c6 g1f3 g8f6 b1c3 d7d5 f1d3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 120626 nps 160834
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove e2e3 currmovenumber 3 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 120626 nps 160834
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove d2d3 currmovenumber 4 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 120729 nps 160972
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove c2c3 currmovenumber 5 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 120816 nps 161088
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove b2b3 currmovenumber 6 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 120885 nps 161180
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove f2f3 currmovenumber 7 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 120954 nps 161272
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove a2a3 currmovenumber 8 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 121017 nps 161356
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove c2c4 currmovenumber 9 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 121080 nps 161440
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove b1c3 currmovenumber 10 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 121152 nps 161536
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove g1f3 currmovenumber 11 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 121466 nps 111029
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove b2b4 currmovenumber 12 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 122111 nps 111618
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove g2g4 currmovenumber 13 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 122192 nps 111692
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove f2f4 currmovenumber 14 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 122273 nps 111766
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove g2g3 currmovenumber 15 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 122352 nps 111839
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove h2h4 currmovenumber 16 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info nodes 122435 nps 111914
Sun Apr 24 17:20:01 2005: from Monarch 1.47 (0): info currmove h2h3 currmovenumber 17 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info nodes 122516 nps 111989
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info currmove a2a4 currmovenumber 18 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info nodes 122591 nps 94518
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info currmove b1a3 currmovenumber 19 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info nodes 122668 nps 94578
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info currmove g1h3 currmovenumber 20 depth 7 seldepth 16 hashfull 3
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info nodes 122747 nps 94639
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 8
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info currmove e2e4 currmovenumber 1 depth 8 seldepth 8 hashfull 3
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info nodes 122826 nps 94700
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 9
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 10
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 11
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 12
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 13
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 14
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 15
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 16
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 17
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 18
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 19
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info currline e2e4 b8c6 f1c4 g8f6 d1h5 f6h5 c4b5
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info depth 8 seldepth 20
Sun Apr 24 17:20:02 2005: from Monarch 1.47 (0): info score cp 3 time 1735 depth 8 seldepth 20 nodes 196434 pv e2e4 b8c6 b1c3 e7e5 g1e2 g8f6 d2d4 f8d6
Steve Maughan
 
Posts: 48
Joined: 06 Oct 2004, 17:40
Location: Florida USA

Re: How to implement the UCI command "currline".

Postby Josu? Forte » 25 Apr 2005, 00:09

Hi Maughan,

First of all, thank you very much to attend my question in this forum.
Your explanation, the piece of code in C and the Shredder log are exactly what I need. Great!

I download Monarch 1.0 and tried to see how it works showing current line.
Unfortunatly I have no success under Arena 1.1, but in Shredder Classic it works fine.
I noticed something strange in my Arena 1.1. When I tried to configure
the engine analysis output, in style option, the last 4 check boxes (mainlines, mainlines 2nd colour, current line, refutations) were disabled and I could not enable (check) them. Certainly this is the reason I am not able to see the current lines beeing displayed in Monarch when it is running under Arena 1.1. Maybe this is an Arena bug.
Do you know how to enable those check boxes in Arena 1.1?

Regards,
Josu
User avatar
Josu? Forte
 
Posts: 25
Joined: 02 Oct 2004, 23:58
Location: Rio de Janeiro / Brasil

Re: How to implement the UCI command "currline".

Postby Steve Maughan » 25 Apr 2005, 00:53

Josu? Forte wrote:Do you know how to enable those check boxes in Arena 1.1?


No - I thought that Arena did support UCI 2 but as you state the check-boxes are disabled. I use Shredder Classic virtually all of the time - I'd highly recommend it.

I hope you can get it to work!

Regards,

Steve Maughan
Steve Maughan
 
Posts: 48
Joined: 06 Oct 2004, 17:40
Location: Florida USA

Re: How to implement the UCI command "currline".

Postby Ross Boyd » 25 Apr 2005, 01:17

Josue,

I see the same behaviour in Arena 1.1 here. Those last 4 options (mainlines, mainlines 2nd colour, current line, refutations) are checked (but greyed out). I can't change them.

Maybe you could try the Arena forum.

Ross
User avatar
Ross Boyd
 
Posts: 83
Joined: 26 Sep 2004, 23:07
Location: Wollongong, Australia

Re: How to implement the UCI command "currline".

Postby Anonymous » 25 Apr 2005, 21:27

Josu? Forte wrote:For instance, there is an option called "UCI_EngineAbout" that is not even mentioned in the protocol 2.

Josu?, where did you see this option mentioned. Perhaps, my memory is very bad, I cannot remember to ever have seen this option.

Btw. This discussion seems much more suited for "Programming" (if it is at all that welcome at the *Winboard* forum.

Regards,
Dieter
Anonymous
 

Re: How to implement the UCI command "currline".

Postby Volker Pittlik » 25 Apr 2005, 22:32

Dieter B?r?ner wrote:...
Btw. This discussion seems much more suited for "Programming" (if it is at all that welcome at the *Winboard* forum.
...


Please don't keep it personal Dieter:

...This forum is also the place to discuss other chess GUIs, databases, tools, chess in general and other topics....


Regards

Volker
User avatar
Volker Pittlik
 
Posts: 1028
Joined: 24 Sep 2004, 10:14
Location: Murten / Morat, Switzerland

Re: How to implement the UCI command "currline".

Postby Anonymous » 25 Apr 2005, 22:57

Volker Pittlik wrote:
Dieter B?r?ner wrote:...
Btw. This discussion seems much more suited for "Programming" (if it is at all that welcome at the *Winboard* forum.
...


Please don't keep it personal Dieter:

...This forum is also the place to discuss other chess GUIs, databases, tools, chess in general and other topics....



Volker, I cannot understand, what you mean by "please don't keep it personal".

Thanks (really) for the quote from the "readme" (I suppose). I even read it (some time ago), but could not remember it. I had somehow the vague memory from the past, that UCI/Arena/... were not always welcome here (by all posters). I appreciate, if they are. And I really see no reason to discuss it from my side .If my comment was inappropriate, I am sorry. Auf "Deutsch" - Sorry :-) Hatte wirklich nicht vor, was Provozierendes oder Ans??iges zu sagen. Hatte das wirklich nur nebenbei bemerkt.

Gru?,
Dieter
Anonymous
 

Re: How to implement the UCI command "currline".

Postby Roger Brown » 26 Apr 2005, 03:22

Dieter B?r?ner wrote:Volker, I cannot understand, what you mean by "please don't keep it personal".

Thanks (really) for the quote from the "readme" (I suppose). I even read it (some time ago), but could not remember it. I had somehow the vague memory from the past, that UCI/Arena/... were not always welcome here (by all posters). I appreciate, if they are. And I really see no reason to discuss it from my side .If my comment was inappropriate, I am sorry. Auf "Deutsch" - Sorry :-) Hatte wirklich nicht vor, was Provozierendes oder Ans??iges zu sagen. Hatte das wirklich nur nebenbei bemerkt.

Gru?,
Dieter




Hello Dieter,

If I might say a word or two?

I am one of the moderators who are vaguely uncomfortable with Arena bug reports being discussed here mainly because the Arena team has made it known that they would appreciate that all such reports be forwarded to their attention.

It would certainly assist them in developing that really quite lovely gui if they knew about the bug reports since they might not read this forum on a regular basis....

They rest of the technical stuff is certainly better dealt with in the programming forum but speaking for myself, I am certainly more than willing to extend every courtesy to you - one the most talented engine authors, a true gentleman, a scholar, an always helpful and polite person, gifted, knowledgable and downright modest and the inventor of YACE - anything but another chess engine!

May I ask a question?

Dann Corbit and yourself were having a discussion on CCC about Yace being able to play a game against itself internally, within Yace, without a gui. Naturally I am curious as to how that works. Could you explain how to get Yace to do that from the ini file? Is it limited to one game only?

Thanks for your assistance....and for Yace!

Later.
Roger Brown
 
Posts: 346
Joined: 24 Sep 2004, 12:31

Re: How to implement the UCI command "currline".

Postby Josu? Forte » 26 Apr 2005, 04:08

Hi Dieter,

"Dieter wrote:
Josu?, where did you see this option mentioned. Perhaps, my memory is very bad, I cannot remember to ever have seen this option. "

Answering your question about "UCI_EngineAbout", it is not described in the UCI protocol 1 or protocol 2. That is the reason I was complaining. I got this option in a Shredder log.
I implement this option like that:

printf("option name UCI_EngineAbout type string default %s (%s), %s , %s\n", version, release_date, site, email);

It works fine in Arena. You can see the result by openning
Engines / Engine 1 / Configure.
If nothing appears, click on "default" button in the window.

I would like to say that I am very happy with UCI protocol and Arena GUI.
They are a very good tool to help in the development of a chess engine.
I just comment about that because a protocol must be clear enough to be understandable by any chess programmer, from the begginers to the very skilled ones.

Anyway, I got to implement "currline" command in Matheus thanks to the kind support of the chess programmers of this forum and Frank Quisinsky / Sune (Frenzee). Thank you all!

Best regards,
Josu
User avatar
Josu? Forte
 
Posts: 25
Joined: 02 Oct 2004, 23:58
Location: Rio de Janeiro / Brasil

Re: How to implement the UCI command "currline".

Postby Josu? Forte » 26 Apr 2005, 04:34

Hi Ross and Rogger,

Yes, in the meantime I was contacting Arena support to clarify my doubts.

This morning I got two messages, from Frank Quisinsky and Sune Fischer (Frenzee), that definitely answered my questions.

I am attaching the messages just because the informations may be usefull to others.

Hi,

I would like to implement an UCI command called "currline" in
my engine. I have some questions about this subject:

1) Does Arena 1.1 support this feature? If so, how to enable
it in Arena?
2) Which commands should my engine send to Arena to display
the current line it is thinking about? A piece of code in C
language would be appreciated.
3) Can you tell me a couple of free UCI engines that support
this feature so that I can run them in my computer?
Regards,
Josu?

---------------------------------------------------------------------

Hi Stefan, Martin, Sune,

could you look in the second question of Josu?.
I am not able to give a right and good answer.
Topic is UCI II protocol.


Hi Josu?,

1. Arena Support all of the six new UCI II features.
Example: Currline

Load an UCI II compatible engine which support this feature.
I like Frenzee 2.0. Frenzee have for me the perfect UCI II support!

Load Frenzee 2.0 in Arena Chess GUI.
Right Mouse on the analzse windows under Arena.
You can see a new menu system.

Open:
View / Current Line !!

3. You can try it with Yace too, I believe with Monarch
and other UCI compatible engines.

To your questions 2:
I am not a programmer and can not answer of your second
question.

But I send a copy of your mail to Stefan Meyer-Kahlen and
Martin Blume. I am sure one of the programmers can give
you the information.

Thanks for your interest on UCI !!
You will like it !!

Best
Frank

---------------------------------------------------------------

Hi Josue,

I got a mail from Frank about a currline question.
Here is how it is done in Frenzee

To send a line use for instance:

void SearchUpdateStuff() {
if (uci_show_curr_line) {
static char buf[MAXBUF];
int len = 0;
for (uint i=0;i<uci_curr_ply;i++)
len += stack->undo[i].move.PrintUCI(&buf[len]);
printf("info currline %s\n",buf);
}
}

Then call this from inside the search like this:

int search(const int depth,...) {

if (time_to_search_update()) {
uci_curr_ply = depth;
SearchUpdateStuff();
}

So here "uci_curr_ply" is the current ply (or depth) of your search from the root.

It's a bit pseudo code, I hope you can understand it.
Let me know if you can't.

Btw. have you tried reading the CCC-forum?
Usually a good place to ask questions, although sometimes people
can be a bit lazy to answer.

-S.


P.S. By the way Rogger, I completly agree with your words about Dieter.

Best regards,
Josu
User avatar
Josu? Forte
 
Posts: 25
Joined: 02 Oct 2004, 23:58
Location: Rio de Janeiro / Brasil

Re: How to implement the UCI command "currline".

Postby Volker Pittlik » 26 Apr 2005, 09:41

Dieter B?r?ner wrote:...

Volker, I cannot understand, what you mean by "please don't keep it personal"...


Ich wollte geschrieben haben, dass Du es nicht als Angriff verstehen solltest. Meine Wortwahl zu sp?ter Stunde l??t manchmal wohl zu w?nschen ?brig. Ich bitte um Entschuldigung, falls ich da missverst?ndlich war.

Dieter B?r?ner wrote:...I had somehow the vague memory from the past, that UCI/Arena/... were not always welcome here (by all posters). I appreciate, if they are...


I don't have problems with that kind of postings with the exception that clear "Arena-only issues" are better targeted to the Arena support.

Dieter B?r?ner wrote:...Auf "Deutsch" - Sorry :-) Hatte wirklich nicht vor, was Provozierendes oder Ans??iges zu sagen. Hatte das wirklich nur nebenbei bemerkt...


Kein Problem, kam bei mir auch nicht so an.

Beste Gruesse

Volker
User avatar
Volker Pittlik
 
Posts: 1028
Joined: 24 Sep 2004, 10:14
Location: Murten / Morat, Switzerland

Re: How to implement the UCI command "currline".

Postby Anonymous » 26 Apr 2005, 19:08

Josue:
>Answering your question about "UCI_EngineAbout", it is not described in
> the UCI protocol 1 or protocol 2. That is the reason I was complaining.
> I got this option in a Shredder log.

You mean in a log from the Shredder Classic GUI or from the Shredder engine? You (or anybody else) could try, to start the Shredder engine in console mode, and see, how this option is answered. Or use some logging feature (I personally cannot try it at the moment).

You might also have noticed in the newer UCI protocol description (the name UCI 2 was not liked for this) the following phrase:

* if the engine or the GUI receives an unknown command or token it should just ignore it and try to
parse the rest of the string in this line.
Examples: "joho debug on\n" should switch the debug mode on given that joho ist not defined,
"debug joho on\n" will be undefined however.


One intention of this was to exactly allow the situation you describe - some unknown command, that may add some useful functionality for the engine or the GUI (or the combination of engine and GUI). At the same time adding such a new feature should not break any compability. At the time this was discussed, it was also suggested that new commands, that may need "special treatment" by the GUI or the engine will start with UCI... So, actually some old commands that need special treatment, like OwnBook (both, the GUI and the engine needs to know, what is really meant - for other options only the engine needs to know what is meant) are named a bit wrong, and now UCI_OwnBook would be used. But this of course would break compability. IIRC, this was not written down in the document describing the protocol (because you don't really need to know it, to implement either engine or GUI). BTW. this was more or less exactly my suggestion - so blame it on me, if it is bad.


> I implement this option like that:

> printf("option name UCI_EngineAbout type string default %s (%s), %s , %s\n", version, release_date, site, email);

> It works fine in Arena.

Ohh, so my assumption above (Shredder GUI/engine) was wrong. I am too lazy now, to write it again. The information I gave should still be useful. You should ask Martin Blume.

>I just comment about that because a protocol must be clear enough to
> be understandable by any chess programmer, from the begginers to
> the very skilled ones.

I agree. If this is not the case, you might want to adress your comments to SMK and Rudolf Huber. They really want the UCI protocol to be easy (to understand and to implement).

Cheers,
Dieter
Anonymous
 

Re: How to implement the UCI command "currline".

Postby Anonymous » 26 Apr 2005, 19:27

Roger Brown wrote:Dann Corbit and yourself were having a discussion on CCC about Yace being able to play a game against itself internally, within Yace, without a gui. Naturally I am curious as to how that works. Could you explain how to get Yace to do that from the ini file? Is it limited to one game only?


Thanks for the kind words. To use the feature, just type at the Yace prompt:

; 40 moves in one hour. You could also use the WB level command
time 40 3600
setb <FEN>
auto


Of course, you can use another time control. I assume, everything else is already set up (tbldir, hash size, ...)

There seems to be a bug (which I just recognized yesterday), and Yace will not save the PGN. So, I suggest you have logging enabled. At the end of the game, Yace will write a PGN to the log file. So the game will not be lost.

Instead of "setb", you can also use "read_pgn games.pgn [n]", where n is optional. It will read the nth game from the PGN file, and the position will be just after the last move given.

To do it from the ini file - just write those commands at the end of yace.ini. You can also add quit. Yace will not run anymore in a typical GUI setup then. You could also write the commands in some other file, say commands.inp, and start yace with

yace < commands.inp

Or copy your yace.ini to auto_play_one_one_game.ini, add the above commands, and start yace with

yace auto_play_one_game.ini

In that auto_play_one_game.ini, you might want to double the hash size compared to the normal yace.ini, that is probably meant for engine games (where two engines will need to share the RAM). You probably could add more setb/read_pgn commands, to auto_play several positions. But I never tried this. If you want to try it, it might be best to give a line

new

before each such game.

Regards,
Dieter

PS. When this thread was inside "Winboard and related topics", I suggested, that it would better fit to Programming. Now I am answering this inside "Programming" - but it does not fit here, anymore.
Anonymous
 

Re: How to implement the UCI command "currline".

Postby Daniel Mehrmann » 27 Apr 2005, 00:05

The question is what are you doing if nullmoves in the played moves ?

Or just ignore them ?


Josu? Forte wrote:Hi Ross and Rogger,

Yes, in the meantime I was contacting Arena support to clarify my doubts.

This morning I got two messages, from Frank Quisinsky and Sune Fischer (Frenzee), that definitely answered my questions.

I am attaching the messages just because the informations may be usefull to others.

Hi,

I would like to implement an UCI command called "currline" in
my engine. I have some questions about this subject:

1) Does Arena 1.1 support this feature? If so, how to enable
it in Arena?
2) Which commands should my engine send to Arena to display
the current line it is thinking about? A piece of code in C
language would be appreciated.
3) Can you tell me a couple of free UCI engines that support
this feature so that I can run them in my computer?
Regards,
Josu?

---------------------------------------------------------------------

Hi Stefan, Martin, Sune,

could you look in the second question of Josu?.
I am not able to give a right and good answer.
Topic is UCI II protocol.


Hi Josu?,

1. Arena Support all of the six new UCI II features.
Example: Currline

Load an UCI II compatible engine which support this feature.
I like Frenzee 2.0. Frenzee have for me the perfect UCI II support!

Load Frenzee 2.0 in Arena Chess GUI.
Right Mouse on the analzse windows under Arena.
You can see a new menu system.

Open:
View / Current Line !!

3. You can try it with Yace too, I believe with Monarch
and other UCI compatible engines.

To your questions 2:
I am not a programmer and can not answer of your second
question.

But I send a copy of your mail to Stefan Meyer-Kahlen and
Martin Blume. I am sure one of the programmers can give
you the information.

Thanks for your interest on UCI !!
You will like it !!

Best
Frank

---------------------------------------------------------------

Hi Josue,

I got a mail from Frank about a currline question.
Here is how it is done in Frenzee

To send a line use for instance:

void SearchUpdateStuff() {
if (uci_show_curr_line) {
static char buf[MAXBUF];
int len = 0;
for (uint i=0;i<uci_curr_ply;i++)
len += stack->undo[i].move.PrintUCI(&buf[len]);
printf("info currline %s\n",buf);
}
}

Then call this from inside the search like this:

int search(const int depth,...) {

if (time_to_search_update()) {
uci_curr_ply = depth;
SearchUpdateStuff();
}

So here "uci_curr_ply" is the current ply (or depth) of your search from the root.

It's a bit pseudo code, I hope you can understand it.
Let me know if you can't.

Btw. have you tried reading the CCC-forum?
Usually a good place to ask questions, although sometimes people
can be a bit lazy to answer.

-S.


P.S. By the way Rogger, I completly agree with your words about Dieter.

Best regards,
Josu?.
greetings
Daniel
User avatar
Daniel Mehrmann
 
Posts: 127
Joined: 02 Oct 2004, 06:10
Location: Germany

Re: How to implement the UCI command "currline".

Postby Daniel Mehrmann » 27 Apr 2005, 00:22

[quote="Daniel Mehrmann"]The question is what are you doing if nullmoves in the played moves ?

Or just ignore them ?

Otherwise it runs okay:

9523922*1*----------------------------Starte Motor 1 Homer----------------------------
9523922*1*Configured Engine 1 Type: UCI
9524063*1*Engine 1 dir: E:\Homer\stable
9524094*1*Engine 1 commandline: E:\Homer\stable\Homer.exe
9524344<1:Chessprogram Homer
9524344<1:Copyright Daniel Mehrmann 2003-2005
9524344<1:daniel.mehrmann@gmx.de
9524344<1:Version: 0.03
9524344<1:Build: 279
9524344<1:This program is free for personal use
9524344<1:compiled Apr 27 2005 00:21:52
9524344<1:CPU supported: MMX SSE
9524344<1:Reading homer.ini
9524344<1:Hashtable = 32
9524344<1:Pawn value = 100
9524344<1:Knight value = 300
9524344<1:Bishop value = 310
9524344<1:Rook value = 500
9524344<1:Queen value = 900
9524344<1:Max QS depth = 12
9524344<1:Ponder = off
9524344<1:Init hash memory. This could take a while...
9524344<1:info Allocate main hashtable memory, rc = 18750
9524344<1:info Allocate depth hashtable memory, rc = 9375
9524344<1:info Allocate eval hashtable memory, rc = 3125
9524344<1:info Allocate memory for hashtables, rc = 31250
9524485>1:uci
9524532<1:id name Homer 0.03 Build 279
9524532<1:id author Daniel Mehrmann
9524532<1:option name Ponder type check default false
9524594<1:option name Hash type spin min 8 max 512 default 8
9524594<1:option name Pawn type spin default 100 min 50 max 150
9524594<1:option name Knight type spin default 300 min 250 max 350
9524641<1:option name Bishop type spin default 300 min 250 max 350
9524641<1:option name Rook type spin default 500 min 450 max 550
9524641<1:option name Queen type spin default 900 min 850 max 950
9524641<1:option name Max_QS_Depth type spin default 8 min 0 max 16
9524641<1:option name Clear_Hash type button
9524641<1:option name UCI_EngineAbout type string default Homer 0.03 by Daniel Mehrmann, daniel.mehrmann@gmx.de
9524641<1:option name UCI_AnalyseMode type check default false
9524641<1:option name UCI_ShowCurrLine type check default false
9524641<1:uciok
9524844>1:setoption name Bishop value 310
9524844>1:setoption name Hash value 128
9524844>1:setoption name Max_QS_Depth value 12
9524844>1:setoption name UCI_EngineAbout value Homer 0.03 von Daniel Mehrmann, daniel.mehrmann@gmx.de
9524844>1:setoption name UCI_ShowCurrLine value true
9524844>1:isready
9525360<1:info string Bishop value = 310
9525360<1:info string Max QS Depth = 12
9525360<1:info string show current line = 1
9525360<1:readyok
9528985>1:isready
9529000<1:readyok
9529079>1:ucinewgame
9529079>1:isready
9529250<1:readyok
9529297>1:position startpos
9529297>1:go infinite
9529313<1:info score cp 46 depth 1 seldepth 7 nodes 4625 nps 308333 time 15 pv d2d4
9529313<1:info score cp 46 depth 2 seldepth 2 nodes 4645 nps 309666 time 15 pv d2d4 d7d5
9529313<1:info score cp 46 depth 3 seldepth 3 nodes 4665 nps 311000 time 15 pv d2d4 d7d5
9529313<1:info score cp 0 depth 4 seldepth 8 nodes 6955 nps 463666 time 15 pv d2d4 d7d5 g1f3 g8f6
9529344<1:info score cp 31 depth 5 seldepth 12 nodes 22377 nps 476106 time 47 pv e2e4 b8c6 g1f3 d7d5 b1c3
9529469<1:info score cp 14 depth 6 seldepth 13 nodes 81892 nps 524948 time 156 pv e2e4 e7e5 d2d4 e5d4 d1d4 b8c6
9529704<1:info score cp 28 depth 7 seldepth 17 nodes 196080 nps 484148 time 405 pv e2e4 e7e5 g1f3 b8c6 b1c3 f8c5 d2d3
9529891<1:info score cp 30 depth 8 seldepth 20 nodes 279457 nps 485168 time 576 pv e2e4 e7e5 g1f3 d7d5 e4d5 d8d5 b1c3 d5a5
9530079<1:info score cp 30 depth 8 seldepth 20 nodes 370021 nps 474994 time 779 pv e2e4 e7e5 g1f3 d7d5 e4d5 d8d5 b1c3 d5a5
9530844<1:info score cp 37 depth 9 seldepth 20 nodes 725470 nps 470473 time 1542 pv e2e4 e7e6 g1f3 d7d5 e4d5 e6d5 d2d4 d8e7 c1e3 g8f6
9531094<1:info score cp 37 depth 9 seldepth 20 nodes 844321 nps 471161 time 1792 pv e2e4 e7e6 g1f3 d7d5 e4d5 e6d5 d2d4 d8e7 c1e3 g8f6
9532547<1:info score cp 30 depth 10 seldepth 22 nodes 1508134 nps 465329 time 3241 pv e2e4 e7e6 g1f3 d7d5 e4d5 e6d5 f1b5 c8d7 d1e2 f8e7 e1g1 b8c6
9534516<1:info currline d2d4 d7d5 g1f3 e7e5 d4e5 b8c6 b1c3 g8h6 c1h6 c6a5
9534516<1:info depth 10 seldepth 23 nodes 2400256 time 5204 currmove a2a3 currmovenumber 16
9534610<1:info currline a2a3 d7d5 g1f3 e7e5 e2e4 d5e4 d2d4 e4d3 c2d3
9534625<1:info score cp 30 depth 10 seldepth 23 nodes 2447122 nps 461982 time 5297 pv e2e4 e7e6 g1f3 d7d5 e4d5 e6d5 f1b5 c8d7 d1e2 f8e7 e1g1 b8c6
9534625<1:info depth 11 seldepth 11
9535563<1:info depth 11 seldepth 21 nodes 2850816 time 6248 currmove e2e4 currmovenumber 1
9536610<1:info currline e2e4 e7e6 g1f3 g8f6 f1b5 f6e4 d2d3 c7c6 g2g4
9536610<1:info depth 11 seldepth 23 nodes 3325952 time 7292 currmove e2e4 currmovenumber 1
9537657<1:info currline e2e4 e7e5 g1f3 d7d5 e4d5 g8h6 d2d4 g7g6 d1e2
9537657<1:info depth 11 seldepth 23 nodes 3784704 time 8336 currmove e2e4 currmovenumber 1
9538672<1:info currline e2e4 e7e5 g1f3 b8c6 b1c3 g8f6 d2d4 c6d4 f3e5 f8d6 d1d4
9538672<1:info depth 11 seldepth 23 nodes 4210688 time 9349 currmove e2e4 currmovenumber 1
9539688<1:info currline e2e4 e7e5 g1f3 g8f6 f1b5 f6e4 e1g1 b8a6 b5a6 e4g5
9539688<1:info depth 11 seldepth 24 nodes 4628480 time 10361 currmove e2e4 currmovenumber 1
9540204>1:stop
9540250<1:info currline e2e4 e7e5 d2d4 f7f6 d4e5 c7c6
9540266<1:kibitz depth=10/24 score=+0.30 nps=447K pv -> e2e4 e7e6 g1f3 d7d5
9540266<1:bestmove e2e4
greetings
Daniel
User avatar
Daniel Mehrmann
 
Posts: 127
Joined: 02 Oct 2004, 06:10
Location: Germany

Re: How to implement the UCI command "currline".

Postby Anonymous » 27 Apr 2005, 18:36

Daniel Mehrmann wrote:The question is what are you doing if nullmoves in the played moves ?


From engine-interface.txt:

A nullmove from the Engine to the GUI should be sent as 0000.

So for examle

info currline e2e4 e7e5 0000 g8f6

The Shredder GUI displays this as 1.e4 e5 2.-- Nf6
It also works with refutations and PVs. I am not aware of any other place, where this can be used.

In your log: kibitz is no UCI command (neither is it a WB command). You should also send a ponder move, not only the best move (even in analysis or ponder off games - although it won't hardly make a difference then).

Cheers,
Dieter
Anonymous
 

Next

Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 5 guests

cron