Player Games Database and Metrics Updates
This update includes a DB migration that adds a new column to the player_games tabled named achievements_unlocked_softcore. This column will be used to track a player's softcore unlocks for a game, which will eventually be utilized by the Achievement Distribution graph to more accurately represent hardcore vs. softcore unlock distribution.
The PR also includes changes to the UpdatePlayerGameMetrics action in order to populate this new column, as well as the UpdatePlayerGameMetrics command to allow for batch processing of the player_games table. In order to update the softcore unlocks for all players, the following command would need to be run with no parameters:
php artisan ra:platform:player:update-game-metrics
Due to the volume of rows in the player_games table in production, this could take a while to run. Running it against 25000 rows locally took about 10 minutes.
Finally, a new Platform test has been added to validate the changes made related to this PR.
If this PR is approved and merged, #2466 will need to be updated to accommodate the changes to the player_games table.
Why is this necessary? player_games already has achievements_unlocked and achievements_unlocked_hardcore. To get the softcore count just subtract the two:
SELECT achievements_unlocked,
achievements_unlocked_hardcore,
achievements_unlocked - achievements_unlocked_hardcore AS achievements_unlocked_softcore
FROM player_games
...
I agree, subtracting them in a SQL select should be all that is needed, and was what I attempted in my original PR (#2466) but there were performance concerns. Especially once the player count for a game reaches large numbers.
This update would make the SQL used for the distribution selection equivalently performant to the existing selection.