Skip to content

Looking backwards no longer makes the player seasick (fixed camera distance)

Kimberly requested to merge kimmy/RingRacers:lookback-camera into master

This change fixes the camera distance when looking backwards. With this change, the kart stays in a roughly consistent location on the player's 2D viewport so there's less mental load while glancing backwards. Without this change, it's hard to predict what you'll see when looking back -- the camera is much closer to the kart than usual and the pitch tips down sharply because of it. This is especially noticeable when taking boost pads while looking back.

Cause: Camera momentum is computed before player motion occurs, so the camera always appears to lag about one frame behind the player. While looking ahead, the camera appears to lag behind the player; while looking back, the kart's movement catches up to the camera on that frame.

Proposed fix: Add the player's momentum to the camera momentum when looking back. 1x this momentum is enough to fix the issue, but adding 2x the momentum mimics the ordinary "pull-back" effect when accelerating, which looks pretty natural.

Visual comparison: Driving over a boost pad normally and while looking backward.

0001-1215

Note how taking a booster while looking backwards after this change causes visually similar camera motion as taking a boost normally - from the backward-facing view, the camera pulls up close to the player and then lags "behind" (ahead) as the player accelerates. Backwards camera and forwards camera now have analogous optical flow, making quick backwards glances more predictable and consistent no matter how fast you're going.

This change should not affect ordinary camera movement.

Edited by Kimberly

Merge request reports

Loading