From 92b8fe633af9acda37d79f5faf4a5d64b51b8e12 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sat, 27 Apr 2024 15:54:29 -0400 Subject: [PATCH 1/2] Reduce turn stiffening at high speed This mechanic has been identical to SRB2Kart, but we go so much faster now that we wanna nerf it a lot. --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index ee520775c..7b1aefe60 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -10456,7 +10456,7 @@ INT16 K_GetKartTurnValue(const player_t *player, INT16 turnvalue) } else { - p_speed = min(currentSpeed, (p_maxspeed * 2)); + p_speed = min(currentSpeed / 2, p_maxspeed * 2); } if (K_PodiumSequence() == true) From a989fcca50d6690929df966b7e5d3059defc3e90 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sun, 28 Apr 2024 16:12:09 -0700 Subject: [PATCH 2/2] Two-stage turn stiffness dependent on player weight --- src/k_kart.c | 15 +++++++++++++-- src/p_user.c | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 7b1aefe60..da4ab32fd 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -10456,7 +10456,16 @@ INT16 K_GetKartTurnValue(const player_t *player, INT16 turnvalue) } else { - p_speed = min(currentSpeed / 2, p_maxspeed * 2); + // Turning dampens as you go faster, but at extremely high speeds, keeping some control is important. + // Dampening is applied in two stages, one harsh and one soft. + // The harsh window is larger for characters with better baseline maneuverability. + // TODO COMPATLEVEL + // Was p_speed = min(stageSpeed, p_maxspeed * 2); + fixed_t stageSpeed = min(currentSpeed, (100 + 2*(9-player->kartweight)) * p_maxspeed/100); + if (stageSpeed < currentSpeed) + stageSpeed += (currentSpeed - stageSpeed) / 3; + + p_speed = min(stageSpeed, p_maxspeed * 2); } if (K_PodiumSequence() == true) @@ -10482,6 +10491,7 @@ INT16 K_GetKartTurnValue(const player_t *player, INT16 turnvalue) // Sal: K_GetKartDriftValue is short-circuited to give a weird additive magic number, // instead of an entirely replaced turn value. This gaslit me years ago when I was doing a // code readability pass, where I missed that fact because it also returned early. + // TODO COMPATLEVEL (I have no fucking clue what's going on here) turnfixed += K_GetKartDriftValue(player, FRACUNIT) * FRACUNIT; return (turnfixed / FRACUNIT); } @@ -10500,7 +10510,8 @@ INT16 K_GetKartTurnValue(const player_t *player, INT16 turnvalue) fixed_t topspeed = K_GetKartSpeed(player, false, false); if (K_Sliptiding(player)) { - finalhandleboost = FixedMul(5*SLIPTIDEHANDLING/4, FixedDiv(player->speed, topspeed)); + // TODO COMPATLEVEL (was 5*SLIPTIDEHANDLING/4) + finalhandleboost = FixedMul(3*SLIPTIDEHANDLING/4, FixedDiv(player->speed, topspeed)); } if (finalhandleboost > 0 && player->respawn.state == RESPAWNST_NONE) diff --git a/src/p_user.c b/src/p_user.c index 03ec1c7c5..4595af553 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2338,6 +2338,7 @@ static void P_UpdatePlayerAngle(player_t *player) // That means undoing them takes the same amount of time as doing them. // This can lead to oscillating death spiral states on a multi-tic correction, as we swing past the target angle. // So before we go into death-spirals, if our predicton is _almost_ right... + // TODO COMPATLEVEL (was 4*ANG1/3) angle_t leniency = (8*ANG1/3) * min(player->cmd.latency, 6); // Don't force another turning tic, just give them the desired angle!