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

Alter lean speed/angle #638

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

Conversation

nullsystem
Copy link
Collaborator

@nullsystem nullsystem commented Sep 22, 2024

Description

Alter the lean speed/angle to make it seem closer to OG:NT? Although it ain't exact as lean is done differently.
Also to note this was from like 2 months ago just rebased now. Only been notified to try for a PR.

Toolchain

  • Linux GCC Distro Native Arch/GCC 14

Linked Issues

@nullsystem nullsystem marked this pull request as ready for review September 22, 2024 19:03
@AdamTadeusz
Copy link
Contributor

AdamTadeusz commented Sep 24, 2024

When I suggested this be opened I didn't check whether the values here and resultant behavior were actually correct. Playing around, starting a lean from the same position and angle I notice that our camera in the original has a final roll of 20 degrees in either direction depending on direction on lean. However while adjusting the final body yaw does indeed increase the final camera roll, it primarily increases how much we can see, as shown by the x part of the pos. a value of 20 which almost gets us the right camera roll, and a value of 15 in this PR, both make the peak way too strong.
image
I think, after doing some testing, that the final yaw_peek left and right amounts should both be 7.5 default, and the function needs to be either changed to increase the camera roll at a rate of (20/7.5) 2.666 higher to the body yaw so the final camera roll is 20 when the upper body yaw is 7.5 (looking at the body in thirdperson I guess the body_yaw variable controls how far the camera moves perpendicular to the direction we are looking, although the way that is achieved is the final body roll is changed depending on the body_yaw variable)

EDIT left peek should be 7.5, current right peek yaw of 15 seems correct

@AdamTadeusz
Copy link
Contributor

Also I should add that if rolling the upper body 7.5 degrees either way results in exactly the same amount of stuff being visible to the player, and therefore the same amount of the player being exposed, rolling the camera a further 2.66 times to get the same camera angle is kinda pointless. It just makes the screen more sideways without giving the player any more information.

Unless of course the reason why the final camera roll in the original is 20 degrees in either direction is because the character in the original doesn't roll his entire upper body, but only like the top part of his upper body, in which case he can see the same amount of stuff while exposing less of his body, although the camera rotated that much more probably makes it a bit more awkward to aim

@AdamTadeusz
Copy link
Contributor

image
Here's what I mean. Both players can see pretty much exactly the same scene, except the image is rolled over more for the original player, so I can only assume the reason is that the original player isnt rotating his body around the waist but instead higher up, maybe around the breastbone area

@AdamTadeusz
Copy link
Contributor

image
Ok the bots seem to roll from their waist, so it's probably just a case of the camera roll being exaggerated. Using cl_showpos the body yaw actually moves 7.5 to the left when left peeking and 15 to the right when right peeking. Rotating the camera further around the camera's origin can be done to mimick the original behavior, but its probably only a hindrance to players as it doesn't expose them any more or give them any more info, just makes the screen closer to portrait mode

@Agiel
Copy link
Contributor

Agiel commented Sep 24, 2024

Less roll is probably better because it's less disorientating as a player. What's important is that the visibility is the same and that the first person and third person matches up so you can't see around a corner without exposing yourself.

@AdamTadeusz
Copy link
Contributor

Less roll is probably better because it's less disorientating as a player. What's important is that the visibility is the same and that the first person and third person matches up so you can't see around a corner without exposing yourself.

I agree, that's why I personally wouldn't bother implementing the camera roll that's present in the base game, and instead keep the camera roll fixed to the body roll. We should probably open a discussion about this and make an entry in the design doc

// Original Neotokyo with the latest leftlean fix uses 7 for leftlean and 15 for rightlean yaw slide.
ConVar neo_lean_yaw_peek_left_amount("neo_lean_yaw_peek_left_amount", "7.0", FCVAR_REPLICATED | FCVAR_CHEAT, "How far sideways will a full left lean view reach.", true, 0.001f, false, 0);
ConVar neo_lean_speed("neo_lean_speed", "0.2", FCVAR_REPLICATED | FCVAR_CHEAT, "Lean speed scale", true, 0.0, false, 1000.0);
ConVar neo_lean_yaw_peek_left_amount("neo_lean_yaw_peek_left_amount", "15.0", FCVAR_REPLICATED | FCVAR_CHEAT, "How far sideways will a full left lean view reach.", true, 0.001f, false, 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

should be 7.5

ConVar neo_lean_speed("neo_lean_speed", "0.333", FCVAR_REPLICATED | FCVAR_CHEAT, "Lean speed scale", true, 0.0, false, 1000.0);
// Original Neotokyo with the latest leftlean fix uses 7 for leftlean and 15 for rightlean yaw slide.
ConVar neo_lean_yaw_peek_left_amount("neo_lean_yaw_peek_left_amount", "7.0", FCVAR_REPLICATED | FCVAR_CHEAT, "How far sideways will a full left lean view reach.", true, 0.001f, false, 0);
ConVar neo_lean_speed("neo_lean_speed", "0.2", FCVAR_REPLICATED | FCVAR_CHEAT, "Lean speed scale", true, 0.0, false, 1000.0);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you just made the lean speed slower here. A speed of 0.4 is one frame away from the lean coming to a full stop at the same time as in the original when recorded at host_timescale 0.1

Copy link
Contributor

Choose a reason for hiding this comment

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

image

Copy link
Contributor

Choose a reason for hiding this comment

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

since its using lerp we're actually very close to the end of the lean a few frames before 01:10, but 01:10 is when cl_showpos shows no more changes to our position

Copy link
Contributor

Choose a reason for hiding this comment

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

keep in mind this was recorded with neo_lean_yaw_peek_left_amount 7.5, but im fairly confident that's the correct value, I explained my reasoning earlier

Copy link
Contributor

Choose a reason for hiding this comment

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

damn im playing this back at host_timescale 1 and its so quick now ;(

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.

Leaning animation shouldn't take longer than OG NT
3 participants