Adding Clock Times to PGN Notation

Get your specific HIARCS/Junior support questions answered here as well as up-to-the-minute news!

Moderators: Watchman, Mark Uniacke, mrudolf

paul_galbraith
Member
Posts: 2
Joined: Fri Nov 04, 2022 12:05 am

Adding Clock Times to PGN Notation

Post by paul_galbraith »

I'm looking for a tool that will allow entering player clock times into PGN game records. ChessX and, I believe, Fritz can do this but it doesn't look like something that Hiarcs Chess Explorer can do. I only just purchased this so maybe I'm missing the functionality somehow, can any confirm this for me? Or maybe suggest another tool that can do this? Thanks!!

Paul
KLc
Member
Posts: 242
Joined: Sat Jun 27, 2020 3:40 pm

Re: Adding Clock Times to PGN Notation

Post by KLc »

Something like [%clk 1:05:23] in the comments for a move should work. There's no special display for this though.

See also http://www.enpassant.dk/chess/palview/enhancedpgn.htm Section 3.2.6. Similarly, one can provide an evaluation score, but again there's no special display for this (unfortunately).
User avatar
mrudolf
HCE Developer
Posts: 987
Joined: Thu Dec 17, 2020 4:44 pm

Re: Adding Clock Times to PGN Notation

Post by mrudolf »

KLc wrote: Sun Nov 13, 2022 4:07 pm Something like [%clk 1:05:23] in the comments for a move should work. There's no special display for this though.

See also http://www.enpassant.dk/chess/palview/enhancedpgn.htm Section 3.2.6. Similarly, one can provide an evaluation score, but again there's no special display for this (unfortunately).
It will be displayed as 1:05:23 (without %clk), what kind of special display do you mean?

Also, 1.2 will allow you to optionally save clocks for played games and engine matches.
KLc
Member
Posts: 242
Joined: Sat Jun 27, 2020 3:40 pm

Re: Adding Clock Times to PGN Notation

Post by KLc »

mrudolf wrote: Sun Nov 13, 2022 7:15 pm It will be displayed as 1:05:23 (without %clk), what kind of special display do you mean?
Ah, perfect, I was incorrect then. Does this work for %eval as well? (By special display I meant that at least the "tag" disappears).
User avatar
mrudolf
HCE Developer
Posts: 987
Joined: Thu Dec 17, 2020 4:44 pm

Re: Adding Clock Times to PGN Notation

Post by mrudolf »

KLc wrote: Mon Nov 14, 2022 8:42 pm Ah, perfect, I was incorrect then. Does this work for %eval as well? (By special display I meant that at least the "tag" disappears).
Yes, we try to format all special commands (although of course there is no one standard specification for all of them, so we may miss something less popular).
bcalmac
Member
Posts: 45
Joined: Fri May 13, 2022 11:06 pm

Re: Adding Clock Times to PGN Notation

Post by bcalmac »

I also wanted to provide some feedback regarding clock times, this is something I ran into when working with games from chess.com or Lichess.

1. Given that there's no official standard, chess.com and lichess uses different notations for storing clock times. Considering how popular the sites are, it would be nice to support both.

2. Displaying the clock times as comments is incredibly distracting when you also have game comments. What chess.com and lichess do to address that is hide the clock information from the notation and display the remaining time for the current move next to the board. This is a much better user experience in my opinion. What do other people think?
User avatar
mrudolf
HCE Developer
Posts: 987
Joined: Thu Dec 17, 2020 4:44 pm

Re: Adding Clock Times to PGN Notation

Post by mrudolf »

bcalmac wrote: Fri Nov 18, 2022 7:41 pm I also wanted to provide some feedback regarding clock times, this is something I ran into when working with games from chess.com or Lichess.

1. Given that there's no official standard, chess.com and lichess uses different notations for storing clock times. Considering how popular the sites are, it would be nice to support both.

2. Displaying the clock times as comments is incredibly distracting when you also have game comments. What chess.com and lichess do to address that is hide the clock information from the notation and display the remaining time for the current move next to the board. This is a much better user experience in my opinion. What do other people think?
If there is some format which is not supported by HCE, please describe it (best way is to paste PGN here), so that we can add support for it. We try hard to support each syntax, unless it is so broken that it risks breaking something else.
bcalmac
Member
Posts: 45
Joined: Fri May 13, 2022 11:06 pm

Re: Adding Clock Times to PGN Notation

Post by bcalmac »

This is the chess.com format which is ignored:

Code: Select all

[Event "Live Chess"]
[Site "Chess.com"]
[Date "2022.11.06"]
[Round "?"]
[White "HeartOfStone"]
[Black "petianedeva"]
[Result "1-0"]
[ECO "D20"]
[WhiteElo "1192"]
[BlackElo "1031"]
[TimeControl "300+5"]
[EndTime "23:31:47 PST"]
[Termination "HeartOfStone won on time"]

1. d4 {[%timestamp 1]} 1... d5 {[%timestamp 41]} 2. c4 {[%timestamp 24]} 2...
dxc4 {[%timestamp 136]} 3. Nc3 {[%timestamp 62]} 3... Bf5 {[%timestamp 174]} 4.
e4 {[%timestamp 161]} 4... Bg6 {[%timestamp 132]} 5. Bxc4 {[%timestamp 33]} 5...
e6 {[%timestamp 53]} 6. Qb3 {[%timestamp 285]} 6... b6 {[%timestamp 228]} 7. Nf3
{[%timestamp 54]} 7... a5 {[%timestamp 229]} 8. O-O {[%timestamp 50]} 8... Bb4
{[%timestamp 191]} 9. d5 {[%timestamp 79]} 9... Bxe4 {[%timestamp 596]} 10. Nxe4
{[%timestamp 117]} 10... exd5 {[%timestamp 92]} 11. Bxd5 {[%timestamp 24]} 11...
c6 {[%timestamp 51]} 12. Bxf7+ {[%timestamp 26]} 12... Kf8 {[%timestamp 1520]}
13. Bg5 {[%timestamp 135]} 13... Qe7 {[%timestamp 101]} 14. Bxe7+ {[%timestamp
57]} 1-0
and this is lichess.org, displayed as comments:

Code: Select all

[Event "Rated Classical game"]
[Site "https://lichess.org/x2cOLx0h"]
[Date "2022.10.30"]
[White "HeartOfStone"]
[Black "davidthepawn"]
[Result "1/2-1/2"]
[WhiteElo "1860"]
[BlackElo "1855"]
[TimeControl "2700+45"]
[Termination "Normal"]
[UTCDate "2022.10.30"]
[UTCTime "17:55:59"]
[Variant "Standard"]
[ECO "D45"]
[Opening "Semi-Slav Defense: Normal Variation"]
[Annotator "https://lichess.org/@/HeartOfStone"]

1. d4 { [%clk 0:45:00] } 1... d5 { [%clk 0:45:00] } 2. c4 { [%clk 0:45:40] } 2... c6 { [%clk 0:45:41] } 3. Nc3 { [%clk 0:46:20] } 3... Nf6 { [%clk 0:46:21] } 4. e3 { [%clk 0:47:00] } 4... e6 { [%clk 0:46:58] } 5. Nf3 { [%clk 0:47:40] } 5... Nbd7 { [%clk 0:47:25] } 6. Be2 { [%clk 0:48:19] } 6... dxc4 { [%clk 0:48:01] } 7. a4 { [%clk 0:49:01] } 7... Bd6 { [%clk 0:47:08] } 8. Bxc4 { [%clk 0:49:23] } (8. Nd2 O-O 9. Nxc4 Bc7 10. b3 e5 11. Ba3 Re8 12. O-O exd4 13. Qxd4) 8... O-O { [%clk 0:46:21] } 9. O-O { [%clk 0:49:38] } 9... e5 { [%clk 0:46:07] } 10. Re1 { [%clk 0:44:01] } (10. a5 b6 11. d5 { [%cal Gd5a8] } 11... c5 { [%cal Gc3b5,Ga5a6,Ge3e4] }) 10... exd4 { [%clk 0:44:09] } 11. exd4 { [%clk 0:44:18] } 11... Nb6 { [%clk 0:40:21] } 12. Bb3 { [%clk 0:43:28] } 12... Bg4 { [%clk 0:38:36] } 13. Qd3 { [%clk 0:42:39] } 13... Re8 { [%clk 0:36:38] } 14. Bg5 { [%clk 0:43:02] } 14... Nbd7 { [%clk 0:33:43] } 15. Bc2 { [%clk 0:38:57] } 15... Rxe1+ { [%clk 0:30:48] } 16. Rxe1 { [%clk 0:39:37] } 16... Nf8 { [%clk 0:28:07] } 17. Ne5 { [%clk 0:36:13] } 17... Be6 { [%csl Gh4][%cal Gd3g3,Gg3h4,Gg5f6] [%clk 0:26:05] } 18. Ne4 { [%clk 0:35:19] } (18. Qg3 $13) 18... Be7 { [%csl Bf6][%cal Re4c5,Re7c5,Be7f6] [%clk 0:26:47] } 19. Be3?! { [%clk 0:33:05] } (19. Bxf6 Bxf6 20. Nc5 $13 { [%csl Gb7,Ge6][%cal Gc5b7,Gc5e6] }) 19... Nxe4 { [%clk 0:25:20] } 20. Qxe4 { [%clk 0:33:43] } 20... Qd5 { [%clk 0:23:06] } 21. Bd2 { [%clk 0:26:20] } 21... Qxe4 { [%clk 0:23:11] } 22. Bxe4 { [%clk 0:27:01] } 22... Rd8 { [%clk 0:21:27] } 23. Bc3 { [%clk 0:27:23] } 23... Bf6 { [%clk 0:21:06] } 24. f4 { [%clk 0:27:24] } 24... Bb3 { [%clk 0:18:41] } 25. a5 { [%clk 0:27:40] } 25... a6 { [%clk 0:19:02] } 26. Bf5? { [%clk 0:26:08] } (26. f5! $13 Re8 (26... Nd7 27. Nxd7 Rxd7 28. Bxc6 $18 { [%cal Ge1e8] })  (26... h6)) 26... Ne6 { [%clk 0:18:14] } 27. Bxe6 { [%clk 0:22:39] } 27... Bxe6 { [%clk 0:18:59] } 28. b4 { [%clk 0:21:50] } 28... Kf8 { [%clk 0:18:08] } 29. Kf2 { [%clk 0:22:18] } 29... Be7 { [%clk 0:17:10] } 30. Ke3 { [%clk 0:20:31] } 30... Bd5 { [%clk 0:17:14] } 31. g4 { [%clk 0:20:38] } 31... f6 { [%clk 0:16:59] } 32. Nd3 { [%clk 0:20:48] } 32... Bd6 { [%clk 0:17:29] } 33. Kf2 { [%clk 0:20:32] } 33... Bc4 { [%clk 0:16:23] } 34. Nb2 { [%clk 0:21:13] } (34. Nc5 Bxf4 35. Nxb7 Re8 36. Rxe8+ Kxe8 37. h3 { [%cal Gb7c5,Gf2f3,Rc4a6] }) 34... Bb5 { [%clk 0:16:45] } 35. Kf3 { [%clk 0:20:42] } 35... Re8 { [%clk 0:16:48] } 36. h4 { [%clk 0:19:38] } 36... Bc7 { [%clk 0:16:43] } 37. Rxe8+ { [%clk 0:15:28] } 37... Kxe8 { [%clk 0:17:28] } 38. Nd1 { [%clk 0:15:53] } 38... b6 { [%clk 0:17:58] } 39. Ne3 { [%clk 0:16:15] } 39... bxa5 { [%clk 0:18:01] } 40. bxa5 { [%clk 0:16:56] } 40... Kf7 { [%clk 0:16:39] } 41. f5 { [%clk 0:16:09] } (41. Bb4 g6 42. Ke4 Be2 43. f5 $10) 41... g6 { [%clk 0:16:34] } 42. Bb4 { [%clk 0:14:17] } 42... Bd3 { [%clk 0:16:11] } 43. fxg6+ { [%clk 0:10:55] } 43... hxg6 { [%clk 0:16:48] } 44. d5 { [%clk 0:11:35] } 44... cxd5 { [%clk 0:14:55] } 45. Nxd5 { [%clk 0:12:14] } 45... Be5 { [%clk 0:15:24] } 46. Bc3 { [%clk 0:10:06] } 46... Bxc3 { [%clk 0:13:50] } 47. Nxc3 { [%clk 0:10:41] } 47... Bc4 { [%clk 0:12:57] } 48. Ke4 { [%clk 0:09:21] } 48... Ke6 { [%clk 0:12:00] } 49. h5 { [%clk 0:07:48] } (49. Kd4 { [%cal Gc4a2,Gc4g8,Rc3e4,Re4c5] } 49... Bf1 50. Ne4 Be2 51. g5 fxg5 52. hxg5 $10) 49... gxh5 { [%clk 0:08:06] } 50. gxh5 { [%clk 0:08:28] } 50... f5+ { [%clk 0:08:39] } 51. Kf4 { [%clk 0:08:32] } 51... Kf6 { [%clk 0:08:49] } 52. h6 { [%clk 0:08:39] } (52. Na4 Be2 53. Nc5 Bxh5 54. Nxa6 Be2 { [%cal Ga5a6] }) 52... Bg8 { [%clk 0:07:13] } 53. Na4 { [%clk 0:08:53] } 53... Kg6 { [%clk 0:05:29] } 54. Nc5 { [%clk 0:09:32] } 54... Bc4 { [%clk 0:06:00] } 55. h7 { [%clk 0:10:03] } 55... Kxh7 { [%clk 0:06:16] } 56. Kxf5 { [%clk 0:10:46] } 56... Kg7 { [%clk 0:06:50] } 57. Ke5 { [%clk 0:11:27] } 57... Kf7 { [%clk 0:07:16] } 58. Kd6 { [%clk 0:12:07] } 58... Bb5 { [%clk 0:06:21] } 59. Nb7 { [%clk 0:12:34] } 59... Ke8 { [%clk 0:05:29] } 60. Kc7 { [%clk 0:13:01] } 60... Ke7 { [%clk 0:05:43] } 61. Nd6 { [%clk 0:13:10] } 61... Bd7 { [%clk 0:04:58] } 62. Ne4 { [%clk 0:12:58] } 62... Bb5 { [%clk 0:05:03] } 63. Nc5 { 1/2-1/2 The game is a draw. } { [%clk 0:05:31] } 1/2-1/2


oddg
Member
Posts: 109
Joined: Mon Oct 04, 2021 6:31 pm
Location: Vadsø, Norway

Re: Adding Clock Times to PGN Notation

Post by oddg »

bcalmac wrote: Sun Nov 27, 2022 6:17 pm This is the chess.com format which is ignored:
You are getting the game from the wrong place. Either get it the same way from the analysis board or put it in the library and get it there.
bcalmac
Member
Posts: 45
Joined: Fri May 13, 2022 11:06 pm

Re: Adding Clock Times to PGN Notation

Post by bcalmac »

I see. I get the timestamp-style PGN from the game page and there's a clk-style PGN from the analysis page, which is what you were referring to. That's quite inconsistent on their side, but that's not your problem. So, are you implying that the clk-stle is more or less a standard and chess.com should use that everywhere?

Also, more importantly, how about the suggestion to not display the time as comments but rather next to the board as in a real game? Is that something you might consider for your product roadmap?
oddg
Member
Posts: 109
Joined: Mon Oct 04, 2021 6:31 pm
Location: Vadsø, Norway

Re: Adding Clock Times to PGN Notation

Post by oddg »

Personally, I think it's best to do it like in Lichess study and Fritz. Show the clock for each player when you go through the game. The second best is what Chessbase do, show it as an special comment apart from the normal comment so you can adjust the clock where you want. I guess the latest is meant for people (like me) that note the clock-time on the score-sheet while playing and make it easy to add this to the game.
For Hiarcs which already have the possibility to show the clock, it should be shown like in Lichess study and Fritz. But first, it have to find a way to save the time to the database that don't need a rewrite of the database format. Probably with handling special comment like [%clk x.xx.xx] would be the easiest. Then show the clock for game played in Hiarcs while viewing the game afterwards. Then it should be easy to apply pgn import with clock-time.
User avatar
mrudolf
HCE Developer
Posts: 987
Joined: Thu Dec 17, 2020 4:44 pm

Re: Adding Clock Times to PGN Notation

Post by mrudolf »

I've never seen %timestamp before. Is this chess.com specific or has anyone seen that elsewhere?
oddg
Member
Posts: 109
Joined: Mon Oct 04, 2021 6:31 pm
Location: Vadsø, Norway

Re: Adding Clock Times to PGN Notation

Post by oddg »

mrudolf wrote: Thu Dec 01, 2022 10:37 am I've never seen %timestamp before. Is this chess.com specific or has anyone seen that elsewhere?
It is only one (or a few) place in chess.com. Other places their use [%clk. I guess is was added as a placeholder and never fixed. Nothing to worry about. They will most probably fix it on their site when they get enough feedback. What you can encounter from most pgn is what was agreed on in: https://www.enpassant.dk/chess/palview/enhancedpgn.htm
User avatar
mrudolf
HCE Developer
Posts: 987
Joined: Thu Dec 17, 2020 4:44 pm

Re: Adding Clock Times to PGN Notation

Post by mrudolf »

oddg wrote: Thu Dec 01, 2022 1:27 pm It is only one (or a few) place in chess.com. Other places their use [%clk. I guess is was added as a placeholder and never fixed. Nothing to worry about. They will most probably fix it on their site when they get enough feedback. What you can encounter from most pgn is what was agreed on in: https://www.enpassant.dk/chess/palview/enhancedpgn.htm
If it is not that popular, I'd rather not add it. Such special cases sometimes cause side-effects and are quite time-consuming to maintain. We already have a few such cases, mostly to handle engines breaking UCI standard.
bcalmac
Member
Posts: 45
Joined: Fri May 13, 2022 11:06 pm

Re: Adding Clock Times to PGN Notation

Post by bcalmac »

@mrudolf, how about the suggestion to not display the time as comments but rather next to the board as in a real game? Is that something you might consider for your product roadmap?
Post Reply