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

Player: Implement PlayerActionSlopeSlideControl #335

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MonsterDruide1
Copy link
Owner

@MonsterDruide1 MonsterDruide1 commented Feb 2, 2025

This class is used to control all or part of Mario's movement during sliding (mostly) uncontrollably, and while rolling. Working with floating-point calculation functions of this size is ... quite painful, but all functions have been matched here. Some things (especially within update) look quite ugly, so I'm happy to take suggestions on how to simplify code further or improve other stuff - feel free to try by yourself first to verify which changes are possible and which destroy a match: https://decomp.me/scratch/ZqxG4

This PR is currently marked as draft because it should wait for #330 to be merged first, which changes around some stuff within the header of this class, so this will cause merge conflicts if not cleaned up before.


This change is Reviewable

@MonsterDruide1 MonsterDruide1 self-assigned this Feb 2, 2025
@MonsterDruide1 MonsterDruide1 force-pushed the playeractionslopeslidecontrol branch from 451dd9d to f0df0a7 Compare February 22, 2025 09:44
@MonsterDruide1 MonsterDruide1 marked this pull request as ready for review February 22, 2025 09:44
Copy link
Owner Author

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @MonsterDruide1)


a discussion (no related file):
This PR is now ready to review. It definitely has to be rebased before merging, but that will be done after an initial review by someone.

Copy link
Contributor

@LynxDev2 LynxDev2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @MonsterDruide1)


src/Player/PlayerActionSlopeSlideControl.cpp line 127 at r1 (raw file):

                               prevGroundNormal, mGroundNormal);
        sead::Vector3f* velPtr = al::getVelocityPtr(mPlayer);
        velPtr->x = (prevUpVel * mGroundNormal.x) + velPtr->x;

This pattern is also found in BazierCurve and a similar pattern of vecA->x = (vecB.x * mul) + vecC.x(repeat for all axis') is found in both BazierCurve and LinearCurve. So I think you should add a function to the sead vector stuff that takes the vector to multiply, the float to multiply by and the vector to add and then also another function that passes in the vector to add as the target vector

@MonsterDruide1 MonsterDruide1 force-pushed the playeractionslopeslidecontrol branch from f0df0a7 to d70f6c9 Compare March 3, 2025 20:41
Copy link
Owner Author

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @LynxDev2)


a discussion (no related file):

Previously, MonsterDruide1 wrote…

This PR is now ready to review. It definitely has to be rebased before merging, but that will be done after an initial review by someone.

rebased.


src/Player/PlayerActionSlopeSlideControl.cpp line 127 at r1 (raw file):

Previously, LynxDev2 wrote…

This pattern is also found in BazierCurve and a similar pattern of vecA->x = (vecB.x * mul) + vecC.x(repeat for all axis') is found in both BazierCurve and LinearCurve. So I think you should add an implementation to the sead vector stuff that takes the vector to multiply, the float to multiply by and the vector to add and then also another function that passes in the vector to add as the target vector

There are way more occurences of this pattern than just the ones you just pointed out - and even more similar ones that might well be a sead function. We should look into these in the future, yes, but not necessarily before this PR, or would you see this as a hard blocker?

Copy link
Contributor

@LynxDev2 LynxDev2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @MonsterDruide1)


src/Player/PlayerActionSlopeSlideControl.cpp line 127 at r1 (raw file):

Previously, MonsterDruide1 wrote…

There are way more occurences of this pattern than just the ones you just pointed out - and even more similar ones that might well be a sead function. We should look into these in the future, yes, but not necessarily before this PR, or would you see this as a hard blocker?

If you think you'll remember to look into this at some point, then ig not

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.

2 participants