ChessLive!

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

ChessLive!

Post by hgm »

I have been polishing my ChessLive! viewer a little bit: themove list can now be printed in SAN rather than long-algebraic, and it now can display the latest PV of both engines (transferred in separate files). For a demo see http://hgm.nubati.net/viewer/chess.html (with static PVs, as there is no game running there).

This makes it a good time for publishing the syntax:

Code: Select all

Syntax of move ChessLive! move file:

Game ::= WhitePlayer ";" BlackPlayer ";" MoveList

MoveList ::= MoveSpec ";" MoveList
         ::= MoveSpec
         ::= ResultSpec

ResultSpec ::= Result ";" Text

Result ::= "+"
       ::= "="
       ::= "-"

MoveSpec ::= Move
         ::= Move "/" Depth "/" Score "/" Time
         ::= Move "/" Depth "/" Score "/" Time "/" SANtag

Move ::= MoveStep
     ::= MoveStep ":" Move

MoveStep ::= FromSpec ":" Square

FromSpec ::= Square
         ::= PieceID

Square &#58;&#58;= <lower-case letter> <number>

PieceID &#58;&#58;= <lower-case letter>

Depth &#58;&#58;= <number>

Score &#58;&#58;= <signed number>

Time &#58;&#58;= <number>

SANtag &#58;&#58;= <text not containing ; or / >

WhitePlayer &#58;&#58;= Text

BlackPlayer &#58;&#58;= Text

Text &#58;&#58;= <text not containing ;>

SEMANTICS

Depth is the depth in ply. Score is the score in centi-Pawn.
Time is the time remaining on the clock of the side that moved after the move.
The Result is only present in a finished game; the Text after it can specify the
reason &#40;e.g. "3-fold repetition"),and will be printed in braces &#123;&#125; at the end
of the move list. The "+" "=" "-" indicate win, draw, loss from white point of view.

A MoveStep signifies either a move or a drop. If the first part is a PieceID it
puts a piece of that type on the square mentioned as second part ('drop'). 
If the first part indicates a square, that square is cleared after its contents
is copied to the square mentioned in the second part &#40;this applies even to empty
squares!) There are no other effects than this; MoveSteps never have side effects,
and desired side effects in castling, e.p. capture and promotion will have to be
expicitly specified as additional MoveSteps.

The SANtag is a text to be prefixed to the to-square of the first MoveStep of
the move, before printing it in the move list. SANtags "O-O" and "O-O-O" are
recognized as special cases, and not combined with the to-square. E.g. if the
Move is "f3&#58;e5", the SANtag could be "Nx"to cause prinitng of "Nxe5".

IDIOM

King-side castling&#58; "e1&#58;g1&#58;h1&#58;f1"
Promotion to Queen&#58; "g7&#58;g8&#58;q&#58;g8"
e.p.capture bxc5&#58;   "b5&#58;c6&#58;b5&#58;c5"

Note that Chess960 castlings can be tricky, but can be done by dropping a
Rook in the second leg in cases where the King MoveStep obliterated the Rook.
bhlangonijr
Posts: 482
Joined: Thu Oct 16, 2008 4:23 am
Location: Milky Way

Re: ChessLive!

Post by bhlangonijr »

hgm wrote:I have been polishing my ChessLive! viewer a little bit: themove list can now be printed in SAN rather than long-algebraic, and it now can display the latest PV of both engines (transferred in separate files). For a demo see http://hgm.nubati.net/viewer/chess.html (with static PVs, as there is no game running there).

This makes it a good time for publishing the syntax:

Code: Select all

Syntax of move ChessLive! move file&#58;

Game &#58;&#58;= WhitePlayer ";" BlackPlayer ";" MoveList

MoveList &#58;&#58;= MoveSpec ";" MoveList
         &#58;&#58;= MoveSpec
         &#58;&#58;= ResultSpec

ResultSpec &#58;&#58;= Result ";" Text

Result &#58;&#58;= "+"
       &#58;&#58;= "="
       &#58;&#58;= "-"

MoveSpec &#58;&#58;= Move
         &#58;&#58;= Move "/" Depth "/" Score "/" Time
         &#58;&#58;= Move "/" Depth "/" Score "/" Time "/" SANtag

Move &#58;&#58;= MoveStep
     &#58;&#58;= MoveStep "&#58;" Move

MoveStep &#58;&#58;= FromSpec "&#58;" Square

FromSpec &#58;&#58;= Square
         &#58;&#58;= PieceID

Square &#58;&#58;= <lower-case letter> <number>

PieceID &#58;&#58;= <lower-case letter>

Depth &#58;&#58;= <number>

Score &#58;&#58;= <signed number>

Time &#58;&#58;= <number>

SANtag &#58;&#58;= <text not containing ; or / >

WhitePlayer &#58;&#58;= Text

BlackPlayer &#58;&#58;= Text

Text &#58;&#58;= <text not containing ;>

SEMANTICS

Depth is the depth in ply. Score is the score in centi-Pawn.
Time is the time remaining on the clock of the side that moved after the move.
The Result is only present in a finished game; the Text after it can specify the
reason &#40;e.g. "3-fold repetition"),and will be printed in braces &#123;&#125; at the end
of the move list. The "+" "=" "-" indicate win, draw, loss from white point of view.

A MoveStep signifies either a move or a drop. If the first part is a PieceID it
puts a piece of that type on the square mentioned as second part ('drop'). 
If the first part indicates a square, that square is cleared after its contents
is copied to the square mentioned in the second part &#40;this applies even to empty
squares!) There are no other effects than this; MoveSteps never have side effects,
and desired side effects in castling, e.p. capture and promotion will have to be
expicitly specified as additional MoveSteps.

The SANtag is a text to be prefixed to the to-square of the first MoveStep of
the move, before printing it in the move list. SANtags "O-O" and "O-O-O" are
recognized as special cases, and not combined with the to-square. E.g. if the
Move is "f3&#58;e5", the SANtag could be "Nx"to cause prinitng of "Nxe5".

IDIOM

King-side castling&#58; "e1&#58;g1&#58;h1&#58;f1"
Promotion to Queen&#58; "g7&#58;g8&#58;q&#58;g8"
e.p.capture bxc5&#58;   "b5&#58;c6&#58;b5&#58;c5"

Note that Chess960 castlings can be tricky, but can be done by dropping a
Rook in the second leg in cases where the King MoveStep obliterated the Rook.
Hello HG. Nice!

Can your explain a bit more how does one implement the broadcast of a chess game using your spec (or how do you recommend it)? server and client side...
Does the client keep pooling the files on the server? Or do you use some protocol to establish the communication with the server and receive the data?

Thanks,
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: ChessLive!

Post by hgm »

Indeed, the client keeps polling, until the game finishes (i.e. contains a Result at the end of the MoveList). I usually let it do that every 10 sec, which works OK upto 5-min games. Of course a user could adapt that to his needs. The format of the gamefile is quite compact, so reloading it completely isnottoomuch of a burden.

There are basically two ways to set it up: broadcasting from the PCwhere you play the games, or use anexternal server. I have been using the first method. For that I have installed a general purpose HTTP server (the free Abyss Server), which basically makes my PC a website. In one of the directories that is visible from the outside I then put all the viewer files (the html, the avaScript .js file, style files, the gif piece images), and the viewer will look for the file with moves (moves.txt, unless you modified that) in the same folder.

So I instruct WinBoard to make the file there, by running it with the additional option /serverMoves="C:\Abyss Server\htdocs\chess\moves.txt". (Assuming the viewer page is C:\Abyss Server\htdocs\chess\chess.html.) That is all, really. WinBoard will update the moves.txt file after every move of the game, and if the polling reveals new moves, the viewer plays them before it starts polling again.

The alternative is to host the viewer on another machine as where you run the games, and upload the moves.txt file (and the wmoves.txt and bmoves.txt that hold the latest PVs) to the server by some kind of ftp watchdog, or just periodically with a script.
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

ChessLive! (now broadcasting)

Post by hgm »

I am now broadcasting some real games directly from my Chess PC:

http://80.100.28.169/chess/chess.html

I changed the format of PV display a little, to not disturb the page layout when the PVs get too long. The new viewer can be downloaded from

http://hgm.nubati.net/ChessLive.zip .

The WinBoard version that flushed the game in theSAN-supporting format and PVs live, under control of the /serverMoves option can bedownloaded from

http://hgm.nubati.net/WinBoard-TM.zip .
User avatar
hgm
Posts: 27787
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

ChessLive! now with chat server

Post by hgm »

The ChessLive! viewer now comes with a primitive chat server, enabling people watching the game to communicate with each other through and added CGI script. After choosing an alias, they can type one-liners that everyone then will get to see in the chat area of the viewer page. (The server keeps the last 10 lines.)

To see it in action: http://80.100.28.169/chess/chess.html

On request, the viewer now also has buttons to control the auto-play: after refresh (or first load of the page) auto-playing the current game will commence at 1 move/sec until you catch up. But you can now pause that with the ">" button, and then step move by move using that same button. A ">>" button can be used to resume the auto-play, and ">|" brings you instantly to the current position.

The download package is accordingly updated.
Harald
Posts: 317
Joined: Thu Mar 09, 2006 1:07 am

Re: ChessLive!

Post by Harald »

Hi: Some chat lines:

[HLTester] Test line 1
[HLTester] Very nice and works fine.
[HLTester] Standings table is not wide enough.
[HLTester] Chat window does not resize with browser window.
[Anonymous991] Trying message without alias.
[HLTester] Strange timing of Ayito move 79-81 vs Rotor
[HLTester] yiwhat are you waiting for Finish him up!
[HLTester] Do I have clumsy Fingers?
[HLTester] No, chat input eats chars.
[HLTester] Ayito what are you waiting for?

(Empty lines removed)

Harald