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

[Feature Request][Sonic Frontiers] Allow redirection for "Disable Spin Charge Air Deceleration" #21

Open
mikeploythai opened this issue Oct 5, 2023 · 2 comments
Labels
feature Feature Request

Comments

@mikeploythai
Copy link

For the current "Disable Spin Charge Air Deceleration" code, Sonic is fixed to whatever direction he was in prior to spin charging in the air. I think a good quality of life improvement to this code is to allow the player to redirect where to land based on where they tilt the left stick.

I made an implementation of this in a physics mod I created, which uses Player.Kinematics to update the velocity vector using the GetForward() method. Just wanted to share this snippet and video demonstrations so someone can consider implementing this behavior in a much neater fashion lol. I hope what I provided can be helpful and insightful!

var kinematics = Player.Kinematics.Get();
if (kinematics == null) return;

// check if the player in the air
// check if LT is being held to prevent weird behaviors when spin charging a drop dash
// check if current state is the spin charge
if (
  !Player.Status.IsGrounded() &&
  Player.Input.IsDown(Player.InputActionType.PlayerSonicboom) &&
  Player.State.GetCurrentStateID<Sonic.StateID>() == Sonic.StateID.StateSpinBoostCharge
) {
  kinematics->Velocity += Player.Kinematics.GetForward();
}

Current implementation - https://youtu.be/fBZ_YGKGn78
My implementation - https://youtu.be/0ki7K9hYQkM

@mikeploythai mikeploythai changed the title [Feature Request] Allow redirection for "Disable Spin Charge Air Deceleration" [Feature Request][Sonic Frontiers] Allow redirection for "Disable Spin Charge Air Deceleration" Oct 5, 2023
@hyperbx
Copy link
Member

hyperbx commented Oct 6, 2023

This is an interesting concept. It might be worth scaling the velocity to have a maximum magnitude though, as the player tends to rocket off if you keep holding in a direction. lol

I've implemented this locally and added a check for if the analog stick is neutral and it feels a bit less slippery, so I may experiment with this.

Thanks for your feedback!

@mikeploythai
Copy link
Author

Tiny bit off topic, but could you provide an example for the IsAnalogNeutral method, which is what I assume you're using to check for neutrality? Can't find much documentation for an example integer to pass.

@DeaTh-G DeaTh-G added the feature Feature Request label Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature Request
Projects
None yet
Development

No branches or pull requests

3 participants