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

feat(multiset): start double-writing to game_achievement_sets #2662

Conversation

wescopeland
Copy link
Member

@wescopeland wescopeland commented Aug 31, 2024

This PR introduces some foundational work required to support multiple achievement sets per game.

Abstract

We aim to allow players to simultaneously pursue multiple achievement sets within a single game session. This initiative addresses the existing limitation of being confined to a single achievement set per ROM hash.

Multiset functionality is predicated on several key considerations that underpin the system's design and user interaction with achievement sets. From the user perspective, there will be four types of sets: Core, Bonus, Specialty, and Exclusive.

  • Core and Bonus Sets. Bonus sets are designed to directly complement and supplement Core sets. When a user loads a ROM hash for a Core set, we aim to allow them to unlock achievements from Bonus sets too. This can be considered a "core to subset" relationship.
  • Specialty Sets. Unlike Bonus sets, Specialty sets will continue to require loading a unique hash. However, players will be permitted to earn achievements from the Core set and any applicable Bonus sets simultaneously when the Specialty set hash is loaded. This can be considered a "subset to core" relationship.
  • Exclusive Sets. Exclusive sets must be played in isolation. Like Specialty sets, Exclusive sets require loading a unique hash. Players are NOT permitted to earn achievements from the Core set or Bonus sets when an Exclusive set hash is loaded.

The large majority of sets will likely either be Core or Bonus.


This PR adds a sync script and double writes to game_achievement_sets, achievement_sets, and achievement_set_achievements.

Every set is currently identified as being a Core set, just like how production functionally works today.

To sync your database, run the following command:

sail artisan ra:sync:game-achievement-sets 1 # sync game ID 1
sail artisan ra:sync:game-achievement-sets # sync all games

After the sync command has executed, you should be able to observe that the values in game_achievement_sets, achievement_sets, and achievement_set_achievements are correct.

Next steps:

  • In the Connect API, send achievement data to clients using game_sets.
  • On game pages, use game_sets to render the achievement list.
  • Attach leaderboards to sets rather than games.
  • After feat(settings): migrate from legacy PHP to React #2624, add a new user setting for global subset opt-in/out.
  • Add a new table to record local subset opt-in/out overrides.
  • Build tooling allowing developers to specify set kinds for any game with the string "[Subset -" in the title.
  • Build tooling allowing developers to specify hash compatibility for each set.

@wescopeland wescopeland requested a review from a team August 31, 2024 23:37
@wescopeland wescopeland added the deployment/command Includes an Artisan command that needs to be run before/during deployment label Sep 12, 2024
@wescopeland wescopeland merged commit 4405737 into RetroAchievements:master Sep 16, 2024
6 checks passed
@wescopeland wescopeland deleted the game-achievement-sets-double-writes branch September 16, 2024 21:05
@RetroAchievements RetroAchievements locked as resolved and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
deployment/command Includes an Artisan command that needs to be run before/during deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants