How to post chess games

General discussion about computer chess...
pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: How to post chess games

Post by pgn4web » Thu May 19, 2016 10:27 am

Rebel wrote:Paolo, maybe you can help me with the last glitch before I make the applet public. If you go to 1 of the 4 live channels then you will notice that often (usually with draws) the script refuses to go to the next game.
Not sure if I understand the problem, however pgn4web by default stops polling the live games file once all games are finished. Makes sense for a real life tournament, with one round per day and several games in parallel. For a computer demo you might want to change the behaviour to continue polling the live games file endlessly. This is easily done, but requires a more recent version of pgn4web than the one you are using. With the latest pgn4web, changing

Code: Select all

SetLiveBroadcast(0.01, false, false, false, false); 
to

Code: Select all

SetLiveBroadcast(0.01, false, false, false, true); 
will have this effect. However the clients will NEVER stop polling your server. Since I'm looking at this line, setting the first parameter to 0.01 does not make any sense. Do you really need to check for new moves every 0.6 seconds? It might work as well with just an handful of clients, but if your audience is growing this might not be a wise choice. For real live games I suggest to keep the default value of 1. I suspect you'll disagree with this and I wont argue with that, but I had to warn you.

Also, there's another way to solve the problem: instead of setting the 5th parameter to true, you could add a dummy live game at the end of the pgn file, ensuring that the clients will keep polling for new data; this has the advantage that, once the event is over you stop adding the dummy live game and the clients will stop bothering your server. As a dummy live game, it's enough to add at the bottom of the pgn file this line:

Code: Select all

[Result "*"] *

pgn4web
Posts: 97
Joined: Mon Jun 14, 2010 10:26 pm

Re: How to post chess games

Post by pgn4web » Thu May 19, 2016 2:50 pm

Saw your latest version on http://rebel13.nl/pgn4web/live1.html

I noticed you have move infos in the format

Code: Select all

22. Bd4 {+0.28/14 6}
I assume, first number is eval, then some depth info.
If you are interested, it's not too complex to add a graph to your page to plot these values, similarly to what the TCEC page shows.
You just need some very simple javascript code to parse the data into javascript arrays, then you feed those arrays into a javascript graph library like this one from google: https://developers.google.com/chart/

Bigbishop
Posts: 1
Joined: Wed Apr 19, 2017 3:28 pm
Real Name: Lloyd Robin

Re: How to post chess games

Post by Bigbishop » Mon May 29, 2017 6:24 am

Good day, i have some questions? do you love playing chess?
pls reply i just want to know.

paulo101977
Posts: 2
Joined: Sat Jun 20, 2020 8:52 pm
Real Name: Paulo Galdino
Contact:

Re: How to post chess games

Post by paulo101977 » Mon Jul 13, 2020 7:10 pm

Jeremy Bernstein wrote:
Wed Jun 09, 2010 4:46 pm
OpenChess has implemented a JavaScript-based software (pgn4web) to display chess games and positions within the forum body. Using them is easy: it works just like other BBCode markup.

Code: Select all

[fen]1r3rk1/p3pp1p/6p1/3pqb2/Q7/4P1P1/P4PBP/2RR2K1 b - - 0 19[/fen]
looks like this:
1r3rk1/p3pp1p/6p1/3pqb2/Q7/4P1P1/P4PBP/2RR2K1 b - - 0 19

and

Code: Select all

[pgn]
[Event "Miscellaneous Game"]
[Site "?"]
[Date "1620.??.??"]
[EventDate "?"]
[Round "12"]
[Result "0-1"]
[White "NN"]
[Black "Gioachino Greco"]
[ECO "C50"]
[WhiteElo "?"]
[BlackElo "?"]
[PlyCount "26"]

1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.O-O Nf6 5.Re1 O-O 6.c3 Qe7 7.d4
exd4 8.e5 Ng4 9.cxd4 Nxd4 10.Nxd4 Qh4 11.Nf3 Qxf2+ 12.Kh1 Qg1+
13.Nxg1 Nf2# 0-1
[/pgn]
will display
[Event "Miscellaneous Game"]
[Site "?"]
[Date "1620.??.??"]
[EventDate "?"]
[Round "12"]
[Result "0-1"]
[White "NN"]
[Black "Gioachino Greco"]
[ECO "C50"]
[WhiteElo "?"]
[BlackElo "?"]
[PlyCount "26"]

1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.O-O Nf6 5.Re1 O-O 6.c3 Qe7 7.d4
exd4 8.e5 Ng4 9.cxd4 Nxd4 10.Nxd4 Qh4 11.Nf3 Qxf2+ 12.Kh1 Qg1+
13.Nxg1 Nf2# 0-1

(you can also skip all of the info in []s above, e.g.

Code: Select all

[pgn]1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.O-O Nf6 5.Re1 O-O 6.c3 Qe7 7.d4
exd4 8.e5 Ng4 9.cxd4 Nxd4 10.Nxd4 Qh4 11.Nf3 Qxf2+ 12.Kh1 Qg1+
13.Nxg1 Nf2#[/pgn]
if you don't want all of the headers...)

1.e4 e5 2.Nf3 Nc6 3.Bc4 Bc5 4.O-O Nf6 5.Re1 O-O 6.c3 Qe7 7.d4
exd4 8.e5 Ng4 9.cxd4 Nxd4 10.Nxd4 Qh4 11.Nf3 Qxf2+ 12.Kh1 Qg1+
13.Nxg1 Nf2#

This is all in progress. Appearance will probably change a bit over time, but the basic functionality is all there.

Jeremy
I can't see the chessboard rendered by html / browser.

If I try 4R3/pp3r2/2p4k/4B3/4P3/7b/P7/5rRK w - - 0 1 nothing happens

jujuop
Posts: 1
Joined: Wed Feb 16, 2022 4:18 pm
Real Name: Corsaire Julien

Re: How to post chess games

Post by jujuop » Wed Feb 16, 2022 4:25 pm

hi bigbishop, for me I love chess since I was little, it's a real passion

kylyp
Posts: 3
Joined: Tue May 31, 2022 7:59 am
Real Name: Beau Goyder

Re: How to post chess games

Post by kylyp » Tue May 31, 2022 7:59 am


Post Reply