-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Introduce infrastructure for tracking past games #42731
Merged
ZhilkinSerg
merged 9 commits into
CleverRaven:master
from
jbytheway:global_achievements_tracker
Aug 7, 2020
Merged
Introduce infrastructure for tracking past games #42731
ZhilkinSerg
merged 9 commits into
CleverRaven:master
from
jbytheway:global_achievements_tracker
Aug 7, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dee9fd1
to
029d803
Compare
What would it take to clear the record? Deletion of the memorial file? |
Yes. Specifically, the memorial json file. The txt file doesn't matter. |
Use it to simplify the data loading code.
This is intended to be a class to centralize details about past games to be used e.g. to determine when achievements are newly achieved.
In past_games_info, provide access to exactly which games previously completed certain achievements.
In most situations we want to see past games in the order they occurred. Sort them by the date encoded in the filename. This sorts by date the game ended, which seems as good an order as any. Of course, games can overlap, but there's only so much we can do.
In the achievements window, show which achievements have been completed in past games.
This is just sorting date/time strings so we don't need a localized sort.
The past game info loading code puts up a popup window. This was being run in test mode, which fails because the UI stuff isn't initialized. Add an early return from the redraw function in test mode to avoid this issue.
9c1d303
to
448613e
Compare
I believe the remaining CI errors are not related to this PR. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
<Enhancement / Feature>
New features, or enhancements on existing
Game: Achievements / Conducts / Scores
Player goals and how they are tracked.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: Features "Show which achievements have been completed in past games"
Purpose of change
Generally speaking achievements are intended to be tracked globally, not just within a single game. We need to start implementing that.
Describe the solution
This PR introduces the infrastructure code to do that, and implements a minimal application of that code in the form of showing which achievements have been completed in past games (when you're looking at the achievements screen).
This works by reading the json memorial files I added in #41886. The new
past_games_info
class has a global instance which is not part ofgame
(since it's not specific to a single game).The only extracted data we actually use is the achievement completion info. We report in the achievements window when an achievement has been previously completed, reporting the first character to do so and how many have.
Describe alternatives you've considered
There's certainly more we want to do with past game info, but this is intended to be a minimal viable product.
The "first" character is actually determined by the order in which those characters died, not the order in which they gained the achievement. We could add real-world time of getting achievements, but that's not currently available.
We currently only get past game info from games with memorial files, which means only games which have finished. We could try to also include currently active games, but that's rather more complicated.
Testing
Got some achievements in some games and then looked at the achievements window.
Feel guilty about not writing more unit tests.
Additional context
The next step is to implement popup windows when you complete an achievement. I want to only do that for the first time you get an achievement (by default) and so was waiting until this infrastructure was in place before doing that.
I'd like to argue for this to bypass the feature freeze for a couple of reasons:
But if it doesn't make it in before release it won't be the end of the world.