Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show division in replays when available #3042

Merged
merged 11 commits into from
Mar 22, 2024
Merged

Show division in replays when available #3042

merged 11 commits into from
Mar 22, 2024

Conversation

BlackYps
Copy link
Collaborator

@BlackYps BlackYps commented Oct 21, 2023

WIP
grafik

@codecov
Copy link

codecov bot commented Oct 22, 2023

Codecov Report

Attention: Patch coverage is 67.16418% with 44 lines in your changes are missing coverage. Please review.

Project coverage is 58.84%. Comparing base (618ba92) to head (fb2576a).

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #3042      +/-   ##
=============================================
+ Coverage      58.72%   58.84%   +0.12%     
- Complexity      3956     3982      +26     
=============================================
  Files            573      576       +3     
  Lines          19164    19284     +120     
  Branches        1014     1018       +4     
=============================================
+ Hits           11254    11348      +94     
- Misses          7421     7442      +21     
- Partials         489      494       +5     
Files Coverage Δ
.../java/com/faforever/client/api/FafApiAccessor.java 90.18% <100.00%> (+0.06%) ⬆️
...a/com/faforever/client/domain/api/GameOutcome.java 100.00% <100.00%> (ø)
...m/faforever/client/domain/api/GamePlayerStats.java 66.66% <ø> (ø)
...aforever/client/domain/api/LeagueScoreJournal.java 100.00% <100.00%> (ø)
.../java/com/faforever/client/replay/DisplayType.java 100.00% <100.00%> (ø)
...a/com/faforever/client/mapstruct/ReplayMapper.java 52.17% <0.00%> (ø)
...ava/com/faforever/client/replay/ReplayService.java 77.92% <0.00%> (-1.80%) ⬇️
...om/faforever/client/game/PlayerCardController.java 63.12% <76.00%> (+7.28%) ⬆️
...aforever/client/replay/ReplayDetailController.java 77.51% <82.50%> (+3.27%) ⬆️
.../com/faforever/client/game/TeamCardController.java 64.65% <52.00%> (-5.94%) ⬇️

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 618ba92...fb2576a. Read the comment docs.

@BlackYps
Copy link
Collaborator Author

BlackYps commented Oct 23, 2023

The core functionality is there, but it is still a bit rough around the edges.
There is a slight delay because we have to fetch the division info from the api, so at the moment it behaves a bit ugly visually.
I appreciate input how this could be solved better.
Similarly the team title still displays (0) because I didn't manage to properly set the teamrating to null to trigger the removal of the rating display alltogether.
Edit: Fixed, but I don't know if the way I did it is good style

@BlackYps BlackYps force-pushed the league-score branch 2 times, most recently from 8dcec1f to d5de031 Compare November 27, 2023 21:26
@BlackYps BlackYps marked this pull request as ready for review November 27, 2023 21:30
@Sheikah45
Copy link
Member

@BlackYps were you ever going to get back to this?

There have also been a few changes to the underlying objects as an FYI.

@BlackYps
Copy link
Collaborator Author

BlackYps commented Mar 5, 2024

I don't plan to abandon this, on the other hand I am really not motivated to do the refactoring that is required here.
So I guess the honest answer is, I really don't know...

@Sheikah45
Copy link
Member

Then I might just close this in a week and it can be reopened when you revisit it.

@BlackYps
Copy link
Collaborator Author

BlackYps commented Mar 8, 2024

I'm picking this up again

@BlackYps BlackYps force-pushed the league-score branch 2 times, most recently from 3c401bd to fa3c779 Compare March 8, 2024 22:54
@BlackYps
Copy link
Collaborator Author

BlackYps commented Mar 8, 2024

The population of the values of the controllers and the displaying of these values are now nicely decoupled. There is one issue though. In a matchmaker game the people that don't have a division still display the rating and the team rating is displayed as well. The problem is that the player cards without a division don't know about the presence of divisions in different player cards. We need some way to check if we found any league stats for the replay (the api call) and then disable rating display for the whole thing somehow

@Sheikah45
Copy link
Member

For displaying the whole thing you can just have a display type enum that has a property in the player card. Then you can set that property appropriately to display either rating or league. Could even just bind it to some property in the parent.

@BlackYps
Copy link
Collaborator Author

BlackYps commented Mar 9, 2024

I guess a boolean would even be enough, something like gameHasLeagueScore. I don't have to differentiate multiple states, just this binary decision

@Sheikah45
Copy link
Member

Yeah I was just thinking of an enum to make it clearer what it signifies. Since hasLeagueScore doesn't imply as much that ratings won't be shown.

Where as something like display type would make that clearer.

@BlackYps
Copy link
Collaborator Author

BlackYps commented Mar 9, 2024

yeah, I can see that.

@Sheikah45
Copy link
Member

Was testing this out and one thing that stuck out as a little bit odd to me. Why do we require pressing the show game result to show the game outcome on the team card. Maybe we should just display it always on load?

@BlackYps
Copy link
Collaborator Author

I think this kind as introduced to make it possible to watch a game without being spoiled on which side wins

@Sheikah45
Copy link
Member

Sure but now you can also play directly from the search result page

@BlackYps
Copy link
Collaborator Author

Hmm, that's true. Maybe we should discuss this with more users to better understand how they use this button at the moment. It's definitely an interesting suggestion, but imo it is unrelated to this PR

@Sheikah45
Copy link
Member

What is the status of this?

@BlackYps
Copy link
Collaborator Author

From my pov it is ready

Copy link
Member

@Sheikah45 Sheikah45 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only consequential thing I see is a race condition between populateTeamContainers and loading the league score results.

@BlackYps
Copy link
Collaborator Author

Can I do something about that race condition?

@Sheikah45
Copy link
Member

You could make sure that you don't try to load the league data until after the team containers are populated

@BlackYps
Copy link
Collaborator Author

I think I first need to understand the race condition a little better. As I see it we run the risk that the league info is applied to the old teamcardcontrollers, so they get cleared right after and new controllers for the new replay get added in populateTeamsContainer if this happens after the application of the league info.
Is this the correct one, or did you have a different race condition in mind?
And why is createTeamCardControllers called asyncronously? I do not immediately see any operation in that method that would make this necessary.

@Sheikah45
Copy link
Member

They are created asynchronously so they don't block the application thread and cause the ui to freeze. And to cure the race condition you would just load the league info after create team controllers is called or make it apart of create team controllers

Copy link
Member

@Sheikah45 Sheikah45 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was an issue with the team card controllers being added twice but I fixed it.

@Sheikah45 Sheikah45 merged commit 6823740 into develop Mar 22, 2024
5 checks passed
@Sheikah45 Sheikah45 deleted the league-score branch March 22, 2024 21:15
@RoraRaven
Copy link

Showing division is nice, but was it necessary to remove the rating change? It means you need to check your profile after every match and keep a spreadsheet if you want to track changes rather than it being plainly displayed in the replays.

@BlackYps
Copy link
Collaborator Author

BlackYps commented May 6, 2024

Yes, the divisions are supposed to replace the rating. The rating system is considered to be part of the backend, it's not necessary to show it to the user when the division system exists

@RoraRaven
Copy link

Are we going to get transparency in how divisions are calculated? Currently divisions are more or less meaningless, every other system (ingame player lists, lobby entry requirements, matchmaking, game quality rating) works on rating.

Divisions are really large and imprecise, you could win 15 games in a row and see no change. Even systems that obfuscate Elo / MMR (eg LoL) show points to measure how far up or down you are inside a division.

@BlackYps
Copy link
Collaborator Author

BlackYps commented May 7, 2024

What exactly is the problem you are having? I'm trying to und erstand it so I can hopefully address it in my answer.
And did you have a look at the leaderboard tab? Your comment gives me the impression that you didn't, because you can see points there and it's not possible to win 15 games in a row without changing divisions, because each division is only 10 points big.

@RoraRaven
Copy link

I wasn't aware about the Leaderboards or Score system at all. I was under the impression that division was based on rating (e.g. Gold V being 800 - 900).

This does answer my questions.

I still don't understand why you would hide information from the player, even if you consider rating to be back-end, but that's your prerogative.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants