-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Show indicator in replay player once replay fails #34628
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
Conversation
Before this commit, there was `AllowFailAnimation` (used by multiplayer) and `OnFail()` (used by score submitting implementations of player to ensure a failed play submits). The former is replaced by `PerformFail()` which allows for arbitrary operations on failure, which replay player shall leverage in subsequent commits. The latter would ideally be replaced by nothing, but it's placed in a very awkward place behind a schedule, so by force of necessity to avoid code duplication it's replaced by `ConcludeFailedScore()` which is overridden to submit the score in all submitting players --- except for multiplayer, which is never supposed to be calling it, so in that case it just throws an exception.
This indicator allows the player to either rewind to an earlier part of the replay, or to proceed to results. It also plays a shortened variant of the failure animation SFX.
As indicated in the inline comment this is very best effort, just to make the HP bar not very obviously stuck in a very obviously incorrect state after the replay is rewound from a failure. There's likely to be a bunch of replay accuracy issues related to this, but I'm just making the minimum effort to get this to work semi-acceptably for now.
| /// <summary> | ||
| /// "Go to results" | ||
| /// </summary> | ||
| public static LocalisableString GoToResults => new TranslatableString(getKey(@"go_to_results"), @"Go to results"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was thinking "Show results" might fit better but given it's shifting between game screens I think this is probably best left as-is.
peppy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work pretty well. Feels more than good enough for a first iteration.
This indicator allows the player to either rewind to an earlier part of the replay, or to proceed to results. It also plays a shortened variant of the failure animation SFX.
2025-08-12.14-35-51.mov
In addition to the main piece, this goes on a few side missions as well:
Refactor fail management to be more centralised
Before this commit, there was
AllowFailAnimation(used by multiplayer) andOnFail()(used by score submitting implementations of player to ensure a failed play submits).The former is replaced by
PerformFail()which allows for arbitrary operations on failure, which replay player leverages here for the main piece to work. The latter would ideally be replaced by nothing, but it's placed in a very awkward place behind a schedule, so by force of necessity to avoid code duplication it's replaced byConcludeFailedScore()which is overridden to submit the score in all submitting players --- except for multiplayer, which is never supposed to be calling it, so in that case it just throws an exception.The reason I did this is not to be a hypocrite after I complained about the fail flows last time.
Add rudimentary support of rewinding failed state to health processor
As indicated in the inline comment this is very best effort, just to make the HP bar not very obviously stuck in a very obviously incorrect state after the replay is rewound from a failure. There's likely to be a bunch of replay accuracy issues related to this, but I'm just making the minimum effort to get this to work semi-acceptably for now.
If this is too much then I'll drop this change with no contest.