- Blind mode tutorial
lichess.org
Donate

Termination tag usage in studies

I'm trying to make a study and am trying to set the termination field in such way that the game correctly shows that one side resigned. This however is not working and the last time someone has asked this question[1] has answers that are either outdated or simply don't work (setting Termination field to "Normal" or "Resign" doesn't do anything for me)

[1] https://lichess.org/forum/general-chess-discussion/how-do-i-make-it-say-that-one-side-resigned

I'm trying to make a study and am trying to set the termination field in such way that the game correctly shows that one side resigned. This however is not working and the last time someone has asked this question[1] has answers that are either outdated or simply don't work (setting Termination field to "Normal" or "Resign" doesn't do anything for me) [1] https://lichess.org/forum/general-chess-discussion/how-do-i-make-it-say-that-one-side-resigned

@thibault @ornicar please could give advice on this? I have the same problem: "Normal" (as PGN export from a game ending in resignation shows) and "Resign", "Resigns", "White resigns" etc don't work. I also tried making the change and refreshing the page, but it doesn't correctly show the "White resigns" along with "Black is victorious".

It's not clear or documented what needs to be entered into the termination field of a study chapter, to get the move list to display the resignation. Is that a ticket that could be added please? I'd be happy to submit a PR myself, I dug around in gitlab but couldn't find the relevant code :(

Thanks in advance!

@thibault @ornicar please could give advice on this? I have the same problem: "Normal" (as PGN export from a game ending in resignation shows) and "Resign", "Resigns", "White resigns" etc don't work. I also tried making the change and refreshing the page, but it doesn't correctly show the "White resigns" along with "Black is victorious". It's not clear or documented what needs to be entered into the termination field of a study chapter, to get the move list to display the resignation. Is that a ticket that could be added please? I'd be happy to submit a PR myself, I dug around in gitlab but couldn't find the relevant code :( Thanks in advance!

The list of tag's appears to be here.

https://github.com/lichess-org/lila/blob/9204a337492c1be4b7b8dabd68941d8934439cbc/modules/study/src/main/PgnTags.scala#L30

And the study pgn import around here :
https://github.com/lichess-org/lila/blob/9204a337492c1be4b7b8dabd68941d8934439cbc/modules/study/src/main/PgnImport.scala#L47

If not the right files, at least I expect the relevant code to be in /study. Study's are big and complex, so not the easiest to navigate

There has been recent refactoring of study code, I am not familiar enough with study to know how this worked before. But, I suppose it's possible that at some point the behavior has changed.

The list of tag's appears to be here. https://github.com/lichess-org/lila/blob/9204a337492c1be4b7b8dabd68941d8934439cbc/modules/study/src/main/PgnTags.scala#L30 And the study pgn import around here : https://github.com/lichess-org/lila/blob/9204a337492c1be4b7b8dabd68941d8934439cbc/modules/study/src/main/PgnImport.scala#L47 If not the right files, at least I expect the relevant code to be in /study. Study's are big and complex, so not the easiest to navigate There has been recent refactoring of study code, I am not familiar enough with study to know how this worked before. But, I suppose it's possible that at some point the behavior has changed.

Hey @TBest, thanks for taking the time to reply! I'm glad we had similar ideas because I'd been looking around lila/.../study too! :)

Unfortunately the tags enumeration you've linked is the tag types (one of which being termination), rather than any clarification of the valid values for the termination tag.

My scala isn't particularly strong so apologies if I've misunderstood, but the pgnImport.scala looks like it's parsing a given PGN to build a study.

I did try reverse engineering it by exporting the PGN from a match where it ended with resignation- this gave result "1-0" and termination "Normal". I also noted that the end of the moves includes a marker that the player resigns, eg "{ Black resigns. }".

However, I tested by creating the shorted PGN I thought made sense:
[Result "1-0"]
[Termination "Normal"]

  1. d4 1-0
    ...and adding this to lichess' import game page - lichess parses and infers that black resigned! So I'm not 100% sure why it can't understand when I play out the study.

I tried exporting an annotated study to PGN, manually adding the "{ Black resigns. }" at the end, and creating a new study, but this still fails to display with the proper UI - instead it just adds as an annotation.

I know it's not a huge deal, but it would be nice to get this working properly!

Hey @TBest, thanks for taking the time to reply! I'm glad we had similar ideas because I'd been looking around `lila/.../study` too! :) Unfortunately the tags enumeration you've linked is the tag types (one of which being termination), rather than any clarification of the valid values for the termination tag. My scala isn't particularly strong so apologies if I've misunderstood, but the pgnImport.scala looks like it's parsing a given PGN to build a study. I did try reverse engineering it by exporting the PGN from a match where it ended with resignation- this gave result "1-0" and termination "Normal". I also noted that the end of the moves includes a marker that the player resigns, eg "{ Black resigns. }". However, I tested by creating the shorted PGN I thought made sense: [Result "1-0"] [Termination "Normal"] 1. d4 1-0 ...and adding this to lichess' import game page - lichess parses and infers that black resigned! So I'm not 100% sure why it can't understand when I play out the study. I tried exporting an annotated study to PGN, manually adding the "{ Black resigns. }" at the end, and creating a new study, but this still fails to display with the proper UI - instead it just adds as an annotation. I know it's not a huge deal, but it would be nice to get this working properly!

I recommend joining lichess discord and asking for advice there : https://discord.gg/lichess a dev would probably be able to give better advice

I recommend joining lichess discord and asking for advice there : https://discord.gg/lichess a dev would probably be able to give better advice

When we resign a game the result of the pgn is written normal but in the game notation you see resign. Does your pgn look like that for your study? @Iceybin

[Event "Game tag test, Casual Correspondence game"]
[Site "https://lichess.org/RF5TGP6k"]
[Date "2023.06.15"]
[White "Toscani"]
[Black "lichess AI level 1"]
[Result "0-1"]
[UTCDate "2023.06.15"]
[UTCTime "12:15:23"]
[WhiteElo "1836"]
[BlackElo "?"]
[Variant "Standard"]
[TimeControl "-"]
[ECO "C42"]
[Opening "Russian Game: Damiano Variation"]
[Termination "Normal"]
[Annotator "lichess.org"]

  1. e4 e5 2. Nf3 Nf6 3. Nxe5 Nxe4 { C42 Russian Game: Damiano Variation } 4. Qe2 d5 5. d3 Ng5 6. Nc6+ Qe7 7. Nxe7 Bxe7 8. Qxe7+ Kxe7 9. Be2 Kf6 { White resigns. } 0-1

https://opensource.apple.com/source/Chess/Chess-109.0.3/Documentation/PGN-Standard.txt.auto.html
See the section article: 8.1.1.7 about the result tags ... 0-1 ; 1-0 ; ½-½ ; *

When we resign a game the result of the pgn is written normal but in the game notation you see resign. Does your pgn look like that for your study? @Iceybin [Event "Game tag test, Casual Correspondence game"] [Site "https://lichess.org/RF5TGP6k"] [Date "2023.06.15"] [White "Toscani"] [Black "lichess AI level 1"] [Result "0-1"] [UTCDate "2023.06.15"] [UTCTime "12:15:23"] [WhiteElo "1836"] [BlackElo "?"] [Variant "Standard"] [TimeControl "-"] [ECO "C42"] [Opening "Russian Game: Damiano Variation"] [Termination "Normal"] [Annotator "lichess.org"] 1. e4 e5 2. Nf3 Nf6 3. Nxe5 Nxe4 { C42 Russian Game: Damiano Variation } 4. Qe2 d5 5. d3 Ng5 6. Nc6+ Qe7 7. Nxe7 Bxe7 8. Qxe7+ Kxe7 9. Be2 Kf6 { White resigns. } 0-1 https://opensource.apple.com/source/Chess/Chess-109.0.3/Documentation/PGN-Standard.txt.auto.html See the section article: 8.1.1.7 about the result tags ... 0-1 ; 1-0 ; ½-½ ; *

I think it's a clash between Lichess' use of { } for annotations, as well as PGN's use of "{ White resigns. }" specifically for resignation.

For example, using lichess.org/paste (Tools > Import game), you can paste the following minimal PGN and it correctly reads with " Black resigned - White is victorious". But pasting the same into a study doesn't work, you just get "White is victorious". Sample PGN:
[Result "1-0"]
[Termination "Normal"]

  1. d4 1-0

Additionally, I tested by exporting a study to PGN, then creating a new study and pasting it in, adding the termination string "{ White resigns. }" manually. This adds "White resigns." as if it's a comment added to the study by the user, rather than displaying the "Black resigned - White is victorious" as it should.

I would also expect that using the UI to add termination should allow specifying how the game ended when it's not clear from the board's position, eg clock, resignation, draw by agreement etc.

I think it's a clash between Lichess' use of { } for annotations, as well as PGN's use of "{ White resigns. }" specifically for resignation. For example, using lichess.org/paste (Tools > Import game), you can paste the following minimal PGN and it correctly reads with " Black resigned - White is victorious". But pasting the same into a study doesn't work, you just get "White is victorious". Sample PGN: [Result "1-0"] [Termination "Normal"] 1. d4 1-0 Additionally, I tested by exporting a study to PGN, then creating a new study and pasting it in, adding the termination string "{ White resigns. }" manually. This adds "White resigns." as if it's a comment added to the study by the user, rather than displaying the "Black resigned - White is victorious" as it should. I would also expect that using the UI to add termination should allow specifying how the game ended when it's not clear from the board's position, eg clock, resignation, draw by agreement etc.

This topic has been archived and can no longer be replied to.