From c62dfa20d2655603d6c8c94f8afd145bddf2c18a Mon Sep 17 00:00:00 2001 From: Kimberly Wilber Date: Sat, 15 Jun 2024 13:54:42 -0400 Subject: [PATCH 1/2] Disable camera dampening when looking backwards. When traveling quickly, camera dampening normally causes the camera to get further away from the player, but it screws up camera angles when looking backwards. This change causes camera dampening to happen instantly when looking behind. That way, players can expect the camera to always be in a consistent location when they tap the "look behind" button. --- src/p_user.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index c144c04bd..5b074a848 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3622,6 +3622,14 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall thiscam->momx = x - thiscam->x; thiscam->momy = y - thiscam->y; + if (lookback && lookbackdelay[num]) { + // when looking back, camera's momentum + // should inherit the momentum of the player + // plus extra + thiscam->momx += 2*mo->momx; + thiscam->momy += 2*mo->momy; + } + fixed_t z_speed = Easing_Linear( player->karthud[khud_aircam], camspeed * 3 / 5, From c4154470b9778fac16a42458bb91c4634f04a97e Mon Sep 17 00:00:00 2001 From: Kimberly Wilber Date: Sun, 16 Jun 2024 15:00:55 -0400 Subject: [PATCH 2/2] Disable camera lookback during loops. --- src/p_user.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 5b074a848..c712bec7c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3193,6 +3193,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall sonicloopcamvars_t *loop = &player->loop.camera; tic_t loop_out = leveltime - loop->enter_tic; tic_t loop_in = max(leveltime, loop->exit_tic) - loop->exit_tic; + boolean affected_by_loop = (loop_out <= + (loop->zoom_in_speed + loop->zoom_out_speed) && leveltime > introtime); thiscam->old_x = thiscam->x; thiscam->old_y = thiscam->y; @@ -3406,8 +3408,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall } else if (player->exiting) // SRB2Kart: Leave the camera behind while exiting, for dramatic effect! camstill = true; - else if (lookback || lookbackdelay[num]) // SRB2kart - Camera flipper + else if ((lookback || lookbackdelay[num]) && !affected_by_loop) { + // SRB2Kart -- Camera flip when looking backwards #define MAXLOOKBACKDELAY 2 camspeed = FRACUNIT; if (lookback) @@ -3622,7 +3625,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall thiscam->momx = x - thiscam->x; thiscam->momy = y - thiscam->y; - if (lookback && lookbackdelay[num]) { + if (lookback && lookbackdelay[num] && !affected_by_loop) { // when looking back, camera's momentum // should inherit the momentum of the player // plus extra