Support for achievements hidden by other achievements #40090
Merged
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 "Support for achievements hidden by other achievements"
Purpose of change
We want to support sequences of similar achievements (such as surviving for ever longer periods, or killing even more monsters). To have all those visible in the achievements UI simultaneously would be clutter; it makes sense for only the next one (and all completed ones) to be visible.
Describe the solution
Each achievement can specify a list of achievements which hide it. The achievement will not appear until all those which hide it have been completed.
I'm supporting a list rather than just a single hiding achievement, because there might be situations where you should complete two different achievements before seeing one. e.g. "drive an electric car 100 miles" might be hidden by both "drive a vehicle 10 miles" and "drive an electric car".
To demonstrate the feature, added two sequences of achievements:
The latter sequence only has "kill 10" and "kill 100" currently. I'd like to add more (I'm thinking 10, 30, 100, 300, ..., 10000) but I haven't thought of a good naming scheme for them. Ideas welcome below (but they can be added later, this PR needn't wait for them).
Describe alternatives you've considered
Defining explicit sequences of achievements, rather than this implicit structure. But I think the greater flexibility of this approach is better.
Testing
Checked in-game
Additional context
Initially, you only see the "survive a day" achievement:
Later, you see the "survive a month" one:
(Since taking these screenshots I've added achievement descriptions and fixed the time display bug evidenced here (#40068).)