Live broadcast of engine pv

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

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

Re: Live broadcast of engine pv

Post by hgm »

Rebel wrote:Basically what is needed are 2 text files.

main.txt - with the (current) main variation.
current.txt - with current depth|move under consideration.

And the life of web developers suddenly is a lot more pleasant.
But this info is sent by all engines to the GUI. If the GUI doesn't give you an opportunity to capture it from some debug log, you could simply run the engine through an adapter that monitors the communication stream, and saves the relevant info on the files you mention.
mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Re: Live broadcast of engine pv

Post by mjlef »

hgm wrote:When I broadcast an event, I usually want to show an update of the PV several times per move. (Unless perhaps when it are bullet games.) So embedding it in the PGN is not the way to do it.

I developed a broadcasting server as a server-side CGI script, which allows a broadcasting server to deposit game or PV data on the server through http GET requests. A program on the server examines the GUI <-> engine traffic to select the moves and PVs, to upload these by this method.

The viewer web page can then download the game and PV data through other GET requests to the same server (e.g. by long polling), to provide live reporting of any change.
Sure you can embed it in the PV. Comments can be any length, and the PGN file can be updated as often as is needed.

I would like to take a look at your system, assuming it is public domain.

Mark
User avatar
Rebel
Posts: 6994
Joined: Thu Aug 18, 2011 12:04 pm

Re: Live broadcast of engine pv

Post by Rebel »

Got it to work.

http://rebel13.nl/pgn4web/live1.html

Currently for version 241 only and the hopping needs a fix, point is, it is doable and quite easily.

Basically you can put anything in the file, even tell random jokes to entertain the audience in case the game is in a boring stage.
User avatar
Graham Banks
Posts: 41454
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Live broadcast of engine pv

Post by Graham Banks »

Nice!
Any chance of clocks being added?
gbanksnz at gmail.com
tttony
Posts: 268
Joined: Sun Apr 24, 2011 12:33 am

Re: Live broadcast of engine pv

Post by tttony »

All right, now I see how it works, I thougth that it sends the match info from your pc to the web, but it just send the png file from Arena via FTP

One of the options it's what Ed Schroder said, watch the arena.debug file, you can build an API like:

http://www.chess.x10host.com/api/send/info/{INFO}

INFO can be sent as json, but this may slow the server with many users connected
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Live broadcast of engine pv

Post by Ferdy »

tttony wrote:All right, now I see how it works, I thougth that it sends the match info from your pc to the web, but it just send the png file from Arena via FTP

One of the options it's what Ed Schroder said, watch the arena.debug file, you can build an API like:

http://www.chess.x10host.com/api/send/info/{INFO}

INFO can be sent as json, but this may slow the server with many users connected
I am using ChessGUI, it has TLCV file with logs from the engines this can be used to extract pv from engines.
My free hosting at x10 would not allow me to run server scripts like nodejs and python/cgi so I cannot process anything on the server. I hope to change server in heroku, and try to experiment it there.
User avatar
Kotlov
Posts: 266
Joined: Fri Jul 10, 2015 9:23 pm
Location: Russia

Re: Live broadcast of engine pv

Post by Kotlov »

Graham Banks wrote:Nice!
Any chance of clocks being added?
It would be nice for CCRL to show the same way (on the web, without soft).
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Live broadcast of engine pv

Post by Ferdy »

Rebel wrote:Got it to work.

http://rebel13.nl/pgn4web/live1.html

Currently for version 241 only and the hopping needs a fix, point is, it is doable and quite easily.

Basically you can put anything in the file, even tell random jokes to entertain the audience in case the game is in a boring stage.
I am using chrome and it seems like the live pv is not consistent, after forced refresh it would show the pv before the move is made on the board but later, the pv is no longer updated. If you forced to refresh again, the live pv will show up and on later moves the live pv is no longer updated again. So I need to press the refresh button every time I wanted to see the live pv displayed.
User avatar
Graham Banks
Posts: 41454
Joined: Sun Feb 26, 2006 10:52 am
Location: Auckland, NZ

Re: Live broadcast of engine pv

Post by Graham Banks »

Kotlov wrote:
Graham Banks wrote:Nice!
Any chance of clocks being added?
It would be nice for CCRL to show the same way (on the web, without soft).
Of course.
gbanksnz at gmail.com
User avatar
Rebel
Posts: 6994
Joined: Thu Aug 18, 2011 12:04 pm

Re: Live broadcast of engine pv

Post by Rebel »

Graham Banks wrote:Nice!
Any chance of clocks being added?
Only if ChessGui has PGN clock support, Arena hasn't. From the PGN4WEB documentation:

Code: Select all

Clock information as provided by the DGT chessboards in PGN move comments, such as &#123;&#91;%clk 1&#58;59&#58;59&#93;&#125;, and in the PGN header, such as &#91;WhiteClock "2&#58;00&#58;00"&#93;, &#91;BlackClock "2&#58;00&#58;00"&#93; and &#91;Clock "W/1&#58;59&#58;59"&#93; is displayed in the following sections&#58;

  <div id="GameWhiteClock"></div>
  <div id="GameBlackClock"></div>