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

Trying to fix frame advantage #527

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Hedgestock
Copy link

_was_in_shieldstun() problem:
When buffering from shield status is never "shieldstun", it is instead 29 (I haven't figured out what 29 is, but 28 is holding shield and 30 is shieldstun).

If the attack is really minus (on hit or shield), the cpu would have time to go into other states and checking for hitstun or shieldstun would not work when trying to update frame advantage so I removed this check.

Instead I make sure that FRAME_ADVANTAGE_CHECK is only true when a hit connect (I uncommented the is_infliction() condition, maybe good to look into is_infliction_status() too). That however does not work with projectile, maybe the condition should just be that the CPU enters hitstun or block stun, I haven't thought enough about this nor tested it.

The is_enable_transition_term() function returns "false" for 1 frame when going from actionable states to actionable states, like from crouching to standing, standing to walking etc...

That can mean that on some move the "actionable" state of the player turns to false again before the CPU is out of hitstun (think drag down aerials) to prevent that, the "active frame" variable is now a signed int that uses -1 as a flag to indicate it has not been updated in this current interaction. This also prevent the same issue if on a really positive move, the player would input a whiffed action before the end of the cpu hitstun.

Also the was_in_hitstun function actually checks the previous status, but when not mashing, the CPU stays in hitstun even when actionable. We could store the value of WorkModule::get_float(cpu_module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLOAT_DAMAGE_REACTION_FRAME) for the next frame, as this does return the number of frames left before being actionable in hitstun (well not really the frames because of baloon KB multiplicator but I won't discuss that here, what's important is that if it was not 0 on the last frame, and is 0 now, this is a more accurate was_in_hitstun indicator regarding actionability).

I haven't touched the "Extra check later in the frame" but it probably deserves some love, I'm not yet sure why it's needed as I couldn't reproduce the issue it says it fixes in the comment.

@Hedgestock Hedgestock requested a review from jugeeya as a code owner April 27, 2023 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant