Skip to content

Conversation

@Savestate2A03
Copy link

@Savestate2A03 Savestate2A03 commented Dec 8, 2025

Dashback Out of Squat

dbooc.mp4

Preface

This is a first attempt at making changes to HDR so feedback, opinions, ideas, and questions would be appreciated. I can not confidently say that this code is steadfast and will be testing it over the coming days and others testing it would be appreciated. Obvious blunders or mistakes being made apparent would help as well. Getting acquainted with a new codebase and way-of-working is always a process.

Primary Changes

Added two new functions to the install list of squat.rs:

  • fightercommon_status_squatwait_main
  • fightercommon_status_squatrv_main

Created a dashback out of squat checking function, dashback_in_squat_check, that runs during SquatWait (resting in squat) and SquatRV (standing up from squat), both of which are run each frame during the animation. The logic is mostly based on the backdash logic already present in dash.rs, although I separated things out a bit for readability since I have a bit of trouble following rust sometimes.

Added a new param to common.xml:

    <float hash="squat_disable_dashback_crouch_threshold_stick_y">-0.6</float> <!-- standard threshold from game for squat -->

This is referenced in squat.rs to know whether or not to allow cancelling crouch with dashback. I do not know where I would find this threshold to reference it in-game however. As that would be preferred, do let me know where to find this if you yourself know where.

Secondary Changes

Previously, the moonwalk helper code disabled dashback for the entirety of the dash if your stick's Y coordinate was below -0.5 at any point during the dash. This meant that dash forward out of crouch (which already existed) was sometimes entirely locked out of being able to dash back after starting the dash if your stick's y position happened to be below the threshold when starting dash while you were making the quarter-circle motion upwards.

moonwalk_from_crouch.mp4
// Disables dashbacks when stick falls below threshold
// For ease of moonwalking
let moonwalk_disable_dashback_stick_y = ParamModule::get_float(fighter.battle_object, ParamType::Common, "moonwalk_disable_dashback_stick_y");
if fighter.global_table[STICK_Y].get_f32() <= moonwalk_disable_dashback_stick_y
&& WorkModule::is_enable_transition_term(fighter.module_accessor, *FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_TURN_DASH) {
    WorkModule::unable_transition_term(fighter.module_accessor, *FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_TURN_DASH);
}

The core logic after the change disregards the concept of unabling FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_TURN_DASH for the entirety of dash to begin with, rather moving the threshold check of the current frame in time to the comparison later on that checks to see if a backdash input has been made.

    let stick_y_should_disable_dashback: bool = fighter.global_table[STICK_Y].get_f32() <= ParamModule::get_float(fighter.battle_object, ParamType::Common, "moonwalk_disable_dashback_stick_y");
    let is_backdash_input: bool = fighter.global_table[STICK_X].get_f32() * PostureModule::lr(fighter.module_accessor) <= ParamModule::get_float(fighter.object(), ParamType::Common, "dashback_stick_x")
                                && fighter.global_table[FLICK_X].get_i32() <= WorkModule::get_param_int(fighter.module_accessor, hash40("common"), hash40("dash_flick_x"));

    // Note: Previously the moonwalk helper disabled dashback entirely for
    //       the rest of the dash. Changed only check whether or not it
    //       should apply as needed - rei wolf 2025-12-07

    if (
        WorkModule::is_enable_transition_term(
            fighter.module_accessor,
            *FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_TURN_DASH // Turn dashes are allowed / enabled
        )
        && !stick_y_should_disable_dashback // AND the y stick is not implicating a moonwalk
        && is_backdash_input // AND is a backdash input
    ) {
        // do backdash stuff
        // ...

Tertiary Changes

Minor bugfix regarding a runtime Rust panic that I encountered due to two u64s being multiplied and triggering an unhandled overflow. I changed the line that panicked to use u64::overflowing_mul instead to avoid this happening in the future.

let mut rng_seed = StdRng::seed_from_u64((now.as_millis() as u64 + 1).overflowing_mul(rand::thread_rng().gen::<u64>()).0);

@Savestate2A03
Copy link
Author

Savestate2A03 commented Dec 8, 2025

I am unsure how to mark this as a Proposal if that is something that is formally done as a part of the process.

Edit: This seems to work for now.

@Savestate2A03 Savestate2A03 marked this pull request as draft December 8, 2025 06:56
@github-actions
Copy link

github-actions bot commented Dec 8, 2025

Download the artifacts for this pull request:

@SuddyN SuddyN added engine For working on engine changes semver:patch discussion ongoing Content has yet to be agreed upon labels Dec 8, 2025
@SuddyN SuddyN marked this pull request as ready for review December 8, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discussion ongoing Content has yet to be agreed upon engine For working on engine changes semver:patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants