WandererXII / lishogi

β˜— lishogi.org: the forever free, adless and open source shogi server forked from lichess.org β˜—
https://lishogi.org
GNU Affero General Public License v3.0
268 stars 41 forks source link

Post-game analysis #363

Closed WandererXII closed 1 year ago

WandererXII commented 3 years ago

As discussed here #69 and in many other places. I believe most of the features are already supported by turning the game into a study, but the biggest problem there seems to me the fact that it's a lot of steps. You need to go to analysis board of the game, create a study of the game and then invite the opponent as a collaborator.

Therefore I suggest that adding another button after the game (next to rematch, analysis board, new opponent). This button will invite the opponent to study the game together. After the opponent accepts, the study will be automatically created.

If there are any features study doesn't have and you think postgame analysis should have, feel free to mention it here.

justremember commented 3 years ago
justremember commented 3 years ago

If one player wants to turn on local/server analysis, the other player must agree. Should be off by default.

WandererXII commented 3 years ago
  • Who owns the study? Is it possible for "joint ownership" of a study? (It might be awkward in the My Studies page if studies are owned by just 1 player, they will only see half the PGA studies). Maybe no one should own the study, and PGA studies have their own tab in https://lishogi.org/study/.

I was also thinking that PGA should have their own tab, it would also become really crowded if you had all your PGA under my studies. Joint ownership isn't really possible without some rewriting and I don't think PGA really needs an owner, if we make it it's own category. Another thing is that these studies might really accumulate over time, not sure whether they should be permanent or if we should expire them in some time by default, let's say 3 months for example.

  • Should this study be publicly linked in the game by default? There might be some merit in allowing spectators to observe the study. In any case, both players can change the visibility settings.

I agree, currently if you start a study from game the link gets posted to chat, we could do that, not sure if that's enough or you meant something more. image

If one player wants to turn on local/server analysis, the other player must agree. Should be off by default.

If you turn on local analysis, it turns it on only on your side, I think that behavior is good.

killerducky commented 3 years ago

Once one player clicks the button, why wait until the opponent accepts to create the study? I think you could create it right away and the message in game chat (and spectator chat) will give the opponent (and spectators) a way to join.

WandererXII commented 3 years ago

Once one player clicks the button, why wait until the opponent accepts to create the study? I think you could create it right away and the message in game chat (and spectator chat) will give the opponent (and spectators) a way to join.

With that I wanted to avoid creating studies that will probably end up not being used. Studies stick around, accumulate and take up space. I would prefer if PGA wouldn't be persistent, but that would be inconsistent with what studies are... So that's not an option. Creating the study only if both players actually want would limit the number of studies and if you just want to look over the game alone, analysis board should suffice. But I'm still not sure if this is the best approach.

killerducky commented 3 years ago

I was thinking of the use case where a player has a friend/teacher spectating so they want to create the study even if the opponent doesn't join. It would be nice if this can be done with the same one click method.

Maybe when you first click it says "waiting for opponent to join", but there is a button that says "create study anyways"? Then if the person only wants to do it if the opponent accepts they can cancel after some time. But with the option to continue if they have a friend/teacher.

Or maybe we can hope most people will understand "Analysis Board" is for self-study, and the new button ("Shared Analysis?") is only for when you expect others to join?

Just brainstorming here. πŸ˜„

justremember commented 3 years ago

Or maybe we can hope most people will understand "Analysis Board" is for self-study, and the new button ("Shared Analysis?") is only for when you expect others to join?

Renaming the "Analysis board" button to "Self-study game" is a good idea, I think. The pga button would be "Study with opponent or someone else" or something similar.

Studies stick around, accumulate and take up space. I would prefer if PGA wouldn't be persistent, but that would be inconsistent with what studies are...

I didnt even think about space... What if PGA studies automatically delete in 3 days unless you "save" them permanently? Then /study will have a separate tab for "Saved PGAs". This is also convenient for users, as when he searches for past PGNs he won't see all the useless cluttered studies, just the saved ones.

If you turn on local analysis, it turns it on only on your side, I think that behavior is good.

It might be rude towards the other player if you start looking at an engine w/o their permission while analysing. Defeats the purpose of PGA imo, because PGA is supposed to be looking back at a game from a human perspective first. Maybe at least a message on chat saying "PlayerA has turned on/off local analysis engine".

WandererXII commented 3 years ago

I was thinking of the use case where a player has a friend/teacher spectating so they want to create the study even if the opponent doesn't join. It would be nice if this can be done with the same one click method.

Thanks for this, that's not something I considered, I will keep that in mind.

Maybe when you first click it says "waiting for opponent to join", but there is a button that says "create study anyways"? Then if the person only wants to do it if the opponent accepts they can cancel after some time. But with the option to continue if they have a friend/teacher.

That's a possibility, but I would like to make it as simple and intuitive as possible. Maybe just show a dialog with two options 'with opponent' and 'alone'?

Or maybe we can hope most people will understand "Analysis Board" is for self-study, and the new button ("Shared Analysis?") is only for when you expect others to join?

Renaming the "Analysis board" button to "Self-study game" is a good idea, I think. The pga button would be "Study with opponent or someone else" or something similar.

'Self-study' seems to imply that it's a study not just analysis board.

Studies stick around, accumulate and take up space. I would prefer if PGA wouldn't be persistent, but that would be inconsistent with what studies are...

I didnt even think about space... What if PGA studies automatically delete in 3 days unless you "save" them permanently? Then /study will have a separate tab for "Saved PGAs". This is also convenient for users, as when he searches for past PGNs he won't see all the useless cluttered studies, just the saved ones.

Yep, that's something I was also thinking. But I'm not sure about this being intuitive - arbitrary expiry date, forcing people to save PGA studies as proper studies if they want to keep them, all this doesn't sound that intuitive.

So as one option I see a simple 'create study' button, that will then ask you whether with opponent or alone. We would keep these studies in a separate category. Maybe I worry a bit too much about the space, if studies got too big, we could get another database server that would handle only studies.

Another option I was thinking about is creating something like synced analysis board, by which I mean keeping everyone (who wants to - off by default perhaps) on the same page, only users that own that analysis board would be able to make the moves that would get synced to everyone, being the owner you could also invite other collaborators. This would mean we wouldn't have large amount of single-use studies. This would be based on the study module, but behave like an analysis board from the outside, so not making it persistent, would be kinda intuitive.

This would also cover the use case, when you want to send someone a link to a board and show them in real time some position, while they see all the moves you make. Right now the only way to do that is to create a study, which seems like an overkill, when I just want to quickly show someone few moves. Some requests for this on lichess - https://lichess.org/forum/lichess-feedback/shared-analysis-board-3, https://lichess.org/forum/lichess-feedback/how-to-invite-several-people-to-a-lichess-analysis-board, https://lichess.org/forum/general-chess-discussion/how-do-i-invite-someone-to-my-analysis-board. Not sure whether that's worth pursuing and some details would still need to be ironed out, just wanted to mention that it's also an option.

justremember commented 3 years ago

Synced analysis board sounds like my idea but with a shorter expiry date and no option to save it permanently :p So what's the difference then?

So as one option I see a simple 'create study' button, that will then ask you whether with opponent or alone. We would keep these studies in a separate category.

The 'alone' option sounds like the feature already implemented in analysis board btw. image

WandererXII commented 3 years ago

Synced analysis board sounds like my idea but with a shorter expiry date and no option to save it permanently :p So what's the difference then?

The difference is that it would just be a feature of the current analysis board. It would look and behave almost exactly like the current analysis board with one difference - everyone is synced.

You could save it permanently just like you can create study from analysis board now - the screenshot you attached. Expiry date could also be whatever, 3 days after last activity for example.

Reason I'm considering this:

I'm not claiming this is the best solution or that this is the way I believe we should go. Just throwing it out here.

So as one option I see a simple 'create study' button, that will then ask you whether with opponent or alone. We would keep these studies in a separate category.

The 'alone' option sounds like the feature already implemented in analysis board btw.

Yep, except maybe it would go to the separate game sections in studies? Studies have all the (or at least all the main) features we want from PGA, it's just that creating it (and then also inviting the opponent) is a lot of steps right now. We want to make it simpler I believe. Going this way is almost nothing more that adding that button to post game screen, automatically inviting the opponent (if that's what the player wants) and filtering these studies from My studies.

justremember commented 3 years ago

Ok I’m surprised this idea wasn’t brought out by anyone (including me). What if we do PGA on the very same board/page the game was played, like in 81dojo? I can imagine coding it would be harder than any other option but the convenience is a huge plus. Though it wouldn’t cover the other use case already mentioned.

Anyway I like the idea of the syncing analysis board cause it’s basically augmenting an existing feature. We could do that for PGA too no? I guess some features from studies will have to be transferred into analysis board though (not all though, cause some won’t be too useful for PGA, like glyphs)

CouchTomato87 commented 2 years ago

Just wanted to bump this up, as this happens to be a recurring reason for why many shogi players still prefer 81dojo

ddugovic commented 2 years ago

I might as well also borrow a suggestion from Lily:

autotranslated chat preset options [text strings both in EN/JP]

such as polite greetings & farewells currently offered on 81Dojo

WandererXII commented 1 year ago

Two approaches:

  1. Post game analysis should happen on the same board the game was played on - no redirects. + Smooth experience - no redirect - Would require a significant rewrite (game doesn't support branching, variations, engine, anything related to study) - Inconsistent - game board and analysis board are different; I expect to see the game exactly how it was played on the game view, not analysis and branching that's harder to make sense of - What happens when both players leave/reload - the game should stay the way it was played, but it's a shame to lose all the analysis info immediately
  2. Add button Analyse with opponent after the game ends next to the other buttons (Rematch, New opponent, ...). This will redirect both players to a shared study-like board with all relevant study features and some features to allow quick rematches, etc.. + Easier to implement + Analysis happening elsewhere than the game means the analysis can stick around, without being immediately deleted and the game view itself is unaffected - Less smooth - would require redirect

Both approaches would require both players to consent to it - the same way rematch starts flashing, you would need to accept the invite to analyse the game together. This avoids the unwanted moving of pieces around when you want to look at the game alone, definitely required for the second approach so you are not redirected when you don't want to.

For analysis with other people than the opponent (for example with a teacher) I would add an option to invite anyone you want to the standard analysis board you can go to even now from a game.

I think it's obvious I'm leaning toward the second option, but I'm open to ideas.

CouchTomato87 commented 1 year ago

I think if the 2nd option is much easier, then that's fine. I think PGA should be consensual anyways, and it sounds like a matter of just both players clicking the button?

Conceptually, say if we were playing in 81dojo, I think one of the players would have to ask "Would you like to go over the game?" And that takes as much effort or more than clicking buttons. In some cases one of the players just starts analyzing on their own unprompted, and that random proactiveness we might miss out on, but whatever.

killerducky commented 1 year ago

For 2nd option I think when a player to clicks "Analyze with opponent" that player should immediately go to the shared study board. The other player stays on the game board, but gets the flashing button (and a message in chat?) and they can choose to join or not. I don't think we should block the analysis if the opponent doesn't want to join, the first player may want to analyze on their own anyways (or with a friend/teacher).

What about observers, would they also see a flashing button to join the analysis? That would be closer to 81dojo model that everything is default public. But lishogi/lichess normally has more privacy by default. Maybe observers click "request to join", and the study owner has to accept?

WandererXII commented 1 year ago

For 2nd option I think when a player to clicks "Analyze with opponent" that player should immediately go to the shared study board. The other player stays on the game board, but gets the flashing button (and a message in chat?) and they can choose to join or not. I don't think we should block the analysis if the opponent doesn't want to join, the first player may want to analyze on their own anyways (or with a friend/teacher).

What about observers, would they also see a flashing button to join the analysis? That would be closer to 81dojo model that everything is default public. But lishogi/lichess normally has more privacy by default. Maybe observers click "request to join", and the study owner has to accept?

Good point, waiting on the opponent would not be the best approach. But with that conceptually I find it unreasonable to have both Analysis board and Analyse with opponent_ buttons, since if the opponent doesn't join the result would be the same.

What about just keeping the one current Analysis board button and making the current analysis board that you get from clicking it after a game synced for everyone by default - same as study. Only the two players that played the game would have permission to make moves that will be recorded, the players could have permission to invite other players as collaborators so they can also make moves - friends and teachers - (not sure). Then there would have to be a simple way to allow players to analyse it on their own - privately. So maybe the two buttons are necessary after all - private analysis board and public analysis board.

Also since most of the time the shared analysis board is not going to be used it's a waste of resources to always initiate it, I would like to figure out a way to do it only if it's actually going to be used - that was why I wanted to wait for the opponent confirmation.

ddugovic commented 1 year ago

I like your suggestion: replicate the 81Dojo "shared PGA" experience by default:

What about just keeping the one current Analysis board button and making the current analysis board that you get from clicking it after a game synced for everyone by default - same as study. Only the two players that played the game would have permission to make moves that will be recorded, the players could have permission to invite other players as collaborators so they can also make moves - friends and teachers - (not sure).

FYI Lichess studies have a "clone" feature in case you want to make private (or shared) second, third, etc. studies. I guess there becomes a question of who "owns" the original study if both players click "Analyze" near the same time, but if there's any need for a tie-break then I'd suggest the player who resigned (or in the case of a draw, who didn't force/offer the draw) owns the original study.

killerducky commented 1 year ago

How about: Click "Shared Analysis", it invites the opponent, and also allows you to invite others (friend/teacher/observers). If at least one other person joins, then it creates the shared analysis. This way you only create it when at least 2 people will join, but you do not block it if the opponent doesn't join.

The invite dialog is also a natural spot to have something like "invite all observers" to easily opt-in to having it be more public.

WandererXII commented 1 year ago

FYI Lichess studies have a "clone" feature in case you want to make private (or shared) second, third, etc. studies. I guess there becomes a question of who "owns" the original study if both players click "Analyze" near the same time, but if there's any need for a tie-break then I'd suggest the player who resigned (or in the case of a draw, who didn't force/offer the draw) owns the original study.

Ideally I would like to avoid forcing players to clone in this case of post game analysis, since it indicates there aren't good defaults, that would satisfy their use case. Ownership of the study couldn't be a race condition like this, either both the players would own it, or no one would own it and the players would be collaborators.

How about: Click "Shared Analysis", it invites the opponent, and also allows you to invite others (friend/teacher/observers). If at least one other person joins, then it creates the shared analysis. This way you only create it when at least 2 people will join, but you do not block it if the opponent doesn't join.

The invite dialog is also a natural spot to have something like "invite all observers" to easily opt-in to having it be more public.

Creating the shared study only after 2 or more players join, would be nice for saving space, but the added complexity is probably not worth it. But something similar to the behavior you are describing is what I'm leaning towards.

WandererXII commented 1 year ago

While looking into possible implementations, I came across more things to consider. Let's define:

Sidenote: I don't really like the inconsistent behavior you get by clicking a game on a profile page:

USE CASES

Use cases I want to support and not break with post game analysis, ordered from most important to least important. I'm looking at this from the point of view, that I just finished a game and I'm sitting in Game view, but obviously for example I can also share a link to an analysis of the game, not just click the Analysis board button in Game view.

  1. Analysing a game on your own - without the opponent or anyone else interrupting.
  2. Viewing your game or game of others as it was played - without too much clutter (too many variations, comments and shapes, currently you might see server analysis).
  3. Analysing games together with the opponent - sharing the same board.
  4. Analysing games with a friend or teacher - not being disturbed by the opponent (unless you invite them too).

Workflows to achieve USE CASES:

Current implementation:

  1. βœ… Clicking Analysis board on Game view
  2. βœ… Clicking Analysis board on Game view
  3. ❌ A lot of steps - not optimal - starting a study from Analysis view
  4. ❌ A lot of steps - not optimal - starting a study from Analysis view

Possible implementations:

A - Add Analyse with opponent button to Game view Redirects to study only after opponent confirms, players have ownership-like permissions. This could either be normal study or game study (more on that later)

  1. βœ… Clicking Analysis board on Game view
  2. βœ… Clicking Analysis board on Game view
  3. βœ… Clicking Analyse with opponent on Game view
  4. ❌ A lot of steps - not optimal - starting a study from Analysis view or Analyse with opponent, then inviting the friend/teacher

+ Study created only when necessary + Studies obtained like this could be permanent - since there wouldn't that many of them - Multiple ways to possible the same result - I might want to analyse the game even if the opponent doesn't, 'should I wait for the opponent to confirm, or just click Analysis board?' is what I might be thinking... Not optimal - Use case #4 can't be satisfied with this, since even if we allow players to invite their own friends/teachers the opponent might interfere

B - Make Analyse view shared by default Players of the game have ownership-like permissions. The default behaviour could be changed with a preference?

  1. ❌ Clicking Analysis board on Game view and disabling sharing
  2. ❌ Clicking Analysis board on Game view, then clearing moves and disabling sharing
  3. βœ… Clicking Analyse view on Game view
  4. ❌ A lot of steps - not optimal - starting a study from Analysis view, then inviting the friend/teacher

+ Not adding more buttons + Only one way to reach some sort of analysis board - Study created even when not necessary - Studies obtained like this wouldn't be permanent - since there would be too many of them - Changes current behaviour - it's different to add a new feature and to change an existing one - Complicates use case #1 and #2. Lichess did temporary local storage, which isn't what we are trying to do here, but they share the fact that even after reload/leaving you can see your old moves/positions. Some backlash: https://lichess.org/forum/lichess-feedback/temporary-move-storage https://github.com/lichess-org/lila/issues/11304 Seems like people mostly didn't like it on /analysis, but it's fine? on what we call Analysis view - Use case #4 can't really be satisfied with this again

C - Add Game study button, clicking it will display a modal box where the user will choose between 'with opponent', 'with friend/teacher' or 'alone', after selecting the player will be immediately redirected to a game study

Game study would behave similarly to study, with one exception - you can't change the mainline. This would make storing the study take less space and make supplying server analysis that might be requested on Analysis board easier, it also makes sense for the game study to preserve the line that was actually played as the mainline.

  1. βœ… Clicking Analysis board on Game view
  2. βœ… Clicking Analysis board on Game view
  3. βœ… Clicking Game study button on Game view and selecting 'with opponent'
  4. βœ… Clicking Game study button on Game view and selecting 'with fiend/teacher'

+ Studies would be permanent + Clicking Game study button is a two step process, while also a disadvantage, it somewhat separates it from what the Analysis board button does - Two ways to reach some sort of analysis board, but see ^, there could also be some short explanation in the modal view - Clicking Game study button is a two step process - More buttons

I'm leaning towards C. Just some ideas and things to consider, of course I'm not saying there aren't other better options, we could maybe somehow mix and match these options, just throwing some ideas here. There are definitely pros and cons I didn't think of or consider.

TLDR; what about C?

killerducky commented 1 year ago

Option C sounds good.

Another use case is 3 and 4 combined -- invite both opponent and friend/teacher/observers. There could be three options: with opponent with friend/teacher public // with opponent and observers

Also consider the use case where the game study is created already, and someone sends a link to a friend using something outside (e.g. Discord). Currently when this happens the users are confused because the friend by default cannot move the pieces or even chat. The owner has to add them.

So if the game analysis is created using the third option (public), the chat can default to public. After all they already indicated desire for mostly public review. Then the friend will at least be able to chat and suggest variations and ask the owner to add them so they can add variations. The more specific "with opponent"//"with friend" options can keep the defaults where public cannot chat.

WandererXII commented 1 year ago

Option C sounds good.

Another use case is 3 and 4 combined -- invite both opponent and friend/teacher/observers. There could be three options: with opponent with friend/teacher public // with opponent and observers

Nice thing about the modal box is that adding more options doesn't complicate the UI that much, so this would be easy to add.

Also consider the use case where the game study is created already, and someone sends a link to a friend using something outside (e.g. Discord). Currently when this happens the users are confused because the friend by default cannot move the pieces or even chat. The owner has to add them.

Hmm, nice use case. Maybe instead of completely public we could have something along the lines of unlisted, where anyone with a link would have permission to make moves. But the study itself wouldn't be listed anywhere as to not get abused. Of course for steamers the link would be visible in the url bar...

So if the game analysis is created using the third option (public), the chat can default to public. After all they already indicated desire for mostly public review. Then the friend will at least be able to chat and suggest variations and ask the owner to add them so they can add variations. The more specific "with opponent"//"with friend" options can keep the defaults where public cannot chat.

That seems reasonable. The chat would follow the ownership of the study.

WandererXII commented 1 year ago

Okay, it's live. I had to make a few changes. I'm sure there is still a lot of things to improve and change, so if you have a specific request please open a new issue.