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

Player statistics overhaul #604

Open
12 tasks
hburn7 opened this issue Feb 21, 2025 · 5 comments
Open
12 tasks

Player statistics overhaul #604

hburn7 opened this issue Feb 21, 2025 · 5 comments
Labels
area:stats epic Feature that requires significant effort to implement project:API Items related to the API project

Comments

@hburn7
Copy link
Collaborator

hburn7 commented Feb 21, 2025

Feature Name

Overview

Update various DTOs related to player dashboard stats.

Dependencies

None.

Notes

To accurately test this, a local copy of statistics will be needed. To obtain this, you must do the following:

  • Clone the otr-processor repo and set it up
  • Setup the DataWorkerService appsettings configuration
  • In the DataWorkerService config, disable OsuTrack and Osu under "Players" and enable "Tournaments"
  • Run the script under scripts/sql/dev/accept-all-pre.sql
  • Let the DataWorkerService run until all tournaments have a ProcessingStatus of 4.
  • Stop the data worker, then run the otr-processor, it should generate ratings and stats for each verified tournament.
  • Run the DataWorkerService again until all tournaments have a ProcessingStatus of 5.

Tasks

  • Rename PlayerStatsDTO to PlayerDashboardStatsDTO
  • Remove the Ruleset field from this type and instead rely on the PlayerCompactDTO.DefaultRuleset field.
  • In PlayerFrequencyDTO, remove all fields except Frequency and replace the removed fields with a PlayerCompactDTO representing the teammate or opponent.
  • Rename PlayerFrequencyDTO to TeammateOpponentFrequencyDTO
  • Change PlayerRatingChartDTO to store an IEnumerable<PlayerRatingChartDataPointDTO> (instead of the current implementation of a nested enumerable). We will remove all API-side logic which groups these items by the date they occurred and let the caller process this.
  • Remove PlayerRatingChartDataPointDTO
  • If it does not exist, create a MatchCompactDTO which contains basic information about a match (no navigations).
  • Replace the int? MatchId field on RatingAdjustmentDTO with a new MatchCompactDTO? Match field.
  • Remove PlayerModStatsDTO and replace with a collection of ModStatsDTO (defined below) which is a dynamically populated list containing stats for any mods which a player has played in matches in our system.
  • Add a Mods field to ModStatsDTO to indicate which mod it belongs to.
  • Rename ModStatsDTO to PlayerModStatsDTO and document to reflect that this DTO should only be used to represent a player's mod stats rather than overall stats for the mod.
  • Rename PlayerRatingStatsDTO to SimplePlayerStatsDTO or similar -- there is nothing about rating in this DTO, it's simply the static header displaying global rank and rating progress within the current tier.
@hburn7 hburn7 added area:stats epic Feature that requires significant effort to implement project:API Items related to the API project labels Feb 21, 2025
@github-project-automation github-project-automation bot moved this to Backlog in otr-beta-v2 Feb 21, 2025
@hburn7 hburn7 moved this from Backlog to Ready in otr-beta-v2 Feb 21, 2025
@myssto
Copy link
Contributor

myssto commented Feb 21, 2025

Rename PlayerStatsDTO to PlayerDashboardStatsDTO

why? If anything it should stay the same or change to just PlayerDTO

Rename PlayerFrequencyDTO to TeammateOpponentFrequencyDTO

feels unnecessary

Rename PlayerRatingChartDataPointDTO to PlayerRatingAdjustmentDTO

Super convoluted to name it like this especially with the proposed inheritance. A rating adjustment is a player rating adjustment, and there are no other variations so why would we add the modifier? The rating chart is constructed from a list of rating adjustments. In my opinion, just keep it simple and add a list of rating adjustments to the DTO. Pretty sure we don't need any additional info here that is specific to the chart

@hburn7
Copy link
Collaborator Author

hburn7 commented Feb 21, 2025

  1. The main idea behind refining the naming here is so that we can use PlayerStatsDTO later. I imagine one day we have a site-wide player statistics page with various "overall" stats about players in general.
  2. Fair.
  3. The chart UI should definitely display the name of the match at a minimum, that's the main reason why they're separate right now from what I can remember.

@myssto
Copy link
Contributor

myssto commented Feb 21, 2025

The chart UI should definitely display the name of the match at a minimum, that's the main reason why they're separate right now from what I can remember.

Adding a MatchCompactDTO to the existing rating adjustment DTO makes the most sense? Mirror the entity

@hburn7
Copy link
Collaborator Author

hburn7 commented Feb 21, 2025

I suppose so yeah.

@hburn7
Copy link
Collaborator Author

hburn7 commented Feb 21, 2025

Changed as follows:

- [ ] Remove `PlayerRatingChartDataPointDTO`
- [ ] If it does not exist, create a `MatchCompactDTO` which contains basic information about a match (no navigations).
- [ ] Replace the `int? MatchId` field on `RatingAdjustmentDTO` with a new `MatchCompactDTO? Match` field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:stats epic Feature that requires significant effort to implement project:API Items related to the API project
Projects
Status: Ready
Development

No branches or pull requests

2 participants