diff options
| author | Schark <jordan@schark.online> | 2026-09-29 18:26:32 -0400 |
|---|---|---|
| committer | Schark <jordan@schark.online> | 2026-09-29 18:26:32 -0400 |
| commit | 25992eb0baa1be5b49e8732e4b63734cdafe3b80 (patch) | |
| tree | 20afa57514ba4ca2cb41fa1c6f8ee46bbd64d50a /platformer/game_feel.md | |
| parent | 87486b2f6c11791d1e192bba8a583a994f273201 (diff) | |
| download | gamedev-25992eb0baa1be5b49e8732e4b63734cdafe3b80.tar.gz gamedev-25992eb0baa1be5b49e8732e4b63734cdafe3b80.zip | |
Small inertia and movement tweaks
Diffstat (limited to 'platformer/game_feel.md')
| -rw-r--r-- | platformer/game_feel.md | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/platformer/game_feel.md b/platformer/game_feel.md index 2d96731..166d476 100644 --- a/platformer/game_feel.md +++ b/platformer/game_feel.md @@ -40,15 +40,29 @@ and eased, not snappier. ## Character movement -- **Speed follows the stick.** Tilt amount sets target speed (`PLAYER_MAX_SPEED` 9 m/s at full tilt). +- **Speed follows the stick.** Tilt amount sets target speed (`PLAYER_MAX_SPEED` 6 m/s at full tilt). + The top run speed is kept modest **on purpose**: future moves will be how players go faster, and a + slower base run makes precise movement easier. The left stick uses a **radial** deadzone so diagonals and slow walking stay smooth. Never snap the left stick to axes; movement must stay free in every direction. - **Camera-relative controls.** Stick up = away from the camera. -- **Turning is quick but not instant** (`PLAYER_TURN_RATE` 12 rad/s, about 0.26 s for 180°). The nose on - the player box exists so the turn rate can be judged by eye. -- **Stops are short and smooth:** from full speed, friction stops the player in about 14 ticks (0.23 s). -- **Air keeps momentum.** Air control is 30% of ground accel and turn rate, with no friction when the - stick is released (SM64-style). +- **The character is heavy.** Starts build up and stops skid: the player should feel like a real, + tangible object, but never like they're on ice. From rest, full tilt reaches top speed in 43 ticks + (0.72 s, `PLAYER_GROUND_ACCEL` 8.4 m/s²). Releasing the stick at full speed skids to a stop in 32 ticks + (0.53 s, 1.54 m, `PLAYER_GROUND_FRICTION` 11.3 m/s²). Heaviness is felt as *time*, so if you change + `PLAYER_MAX_SPEED`, rescale accel and friction to keep these times (at a lower top speed, the same + accel reaches it sooner and feels snappier). +- **Turning is quick but not instant while moving** (`PLAYER_TURN_RATE` 12 rad/s, about 0.26 s for 180°). + The nose on the player box exists so the turn rate can be judged by eye. +- **Turning on a dime from a standstill.** On the ground at speed 0, a stick push more than 90° + (`PLAYER_SNAP_TURN_DEG`) away from the facing direction faces it on the very first tick. Pushes of + 90° or less use the normal quick turn rate (a 90° turn takes 8 ticks, 0.13 s), so small aim + adjustments stay smooth. This applies only on the ground; in the air the reduced turn rate always + applies. +- **Air keeps momentum.** In the air the turn rate is 30% of the ground rate (`PLAYER_AIR_CONTROL`), and + acceleration has its own constant (`PLAYER_AIR_ACCEL` 9 m/s², the old 30% of the ground accel, kept when + the ground got heavier so jumps steer the same). There's no friction when the stick is released + (SM64-style). - **Variable jump height.** Holding A gives a full jump; releasing early multiplies upward speed by `PLAYER_JUMP_CUT` once. Measured at 60 Hz: a full jump reaches **2.33 m** (the "~2.4 m" in comments is the continuous-physics figure) and a tap gives about 0.72 m. Level geometry is sized against 2.33 m. @@ -56,7 +70,7 @@ and eased, not snappier. logic on the same tick it detects landing. - **SM64-style circling is intentional.** Controls stay purely camera-relative even while the camera swings on its own, so holding the stick sideways during a camera swing makes the player run a - wide arc (about 18 m radius, 36 m across). The user explicitly chose this over locking the stick direction. + wide arc (about 12 m radius, 24 m across, at 6 m/s). The user explicitly chose this over locking the stick direction. **Don't "fix" it without asking.** --- @@ -144,7 +158,9 @@ New automatic camera behaviors should follow the same approach: slow, eased, and platforms (`WORLD_SEED`, so every run is the same layout). Spawn is kept clear (4 m). - **Heights are sized to the jump:** ground blocks top out at 2.0 m (below the 2.33 m jump); floating slabs sit at 2.6–4.2 m, reached by jumping from a block. Only 9 of 16 floating slabs have a block close - enough to jump from; reachability isn't guaranteed yet. + enough to jump from; reachability isn't guaranteed yet. That count was made at a 9 m/s run. At 6 m/s a + full running jump covers only about 4.0 m horizontally (it was about 6 m), so fewer slabs may be + reachable now. - **Collision behaviors worth preserving:** - Gravity *always* pulls and the floor pushes back, so walking off a ledge falls without special cases. - Movement is resolved one axis at a time, so running diagonally into a wall **slides** along it. @@ -168,11 +184,16 @@ New automatic camera behaviors should follow the same approach: slow, eased, and with the camera, so the swing chases forever. It only settles when the player steers to hold a line. - **The starting pitch (20°) differs from the auto-tilt target (15°),** so every session begins with a small upward tilt. Setting `CAMERA_PITCH_DEFAULT` to 0.26 rad would skip it. +- **Heavy stops, but not heavy reversals.** Letting go skids, yet pushing the stick the opposite way + at full speed keeps all the speed and swings around in a tight 0.26 s U-turn, since velocity always + points along the facing direction. SM64 solves this with a turnaround skid (brake, then turn). That's + listed under `NOT IN SCOPE` in `player.c` for now, but it's the natural next step if reversals feel + too light next to the stops. - **High-angle auto-tilt resets are long** (60° → 15° takes about 15.7 s of motion). For big tilts the top speed (`CAMERA_AUTO_PITCH_SPEED`) sets the time; for small ones, the acceleration does. - **No camera collision:** the camera can pass through tall platforms (it's on the roadmap). - **Rough edges not yet addressed:** there's no step-up (even a 0.6 m block needs a jump); - `forward_speed` isn't reduced by walls (the title shows 9 m/s while pushing into one); the drawn + `forward_speed` isn't reduced by walls (the title shows 6 m/s while pushing into one); the drawn box rotates but the collision box doesn't (up to about 17 cm visual overlap with walls at diagonals). @@ -191,6 +212,11 @@ New automatic camera behaviors should follow the same approach: slow, eased, and | Auto-tilt motion | linear 0.15 rad/s → eased, much slower → accel slightly quicker → all 10% slower | 0.054 rad/s cap, 0.045 rad/s² | | Manual pitch speed | 1.5 → 1.125 rad/s | 1.125 | | Right-stick snap | none → 15° → 10° → 5° → back to 15° | 15° | +| Top run speed | 9 → 7 → 5 → 6 m/s (slower on purpose; later moves add speed) | 6 m/s | +| Ground accel | 30 → 12 → 7 → 8.4 m/s² (0.30 → 0.60 → 0.72 s to top speed; the last step kept 0.72 s at 6 m/s) | 8.4 m/s² | +| Ground friction | 40 → 16 → 9.5 → 11.3 m/s² (0.23 → 0.45 → 0.53 s stop; the last step kept 0.53 s at 6 m/s) | 11.3 m/s² | +| Air accel | 30% of ground accel → its own constant, value kept | 9 m/s² | +| Standstill turn | turn rate → instant at speed 0 → instant only past 90° (ground only) | > 90° instant | --- @@ -209,7 +235,7 @@ New automatic camera behaviors should follow the same approach: slow, eased, and times. The user tunes with both numbers and feel. - **Say what you couldn't test.** Agents can't press the gamepad. Live checks are limited to launching (`timeout 2.5 ./platformer`), reading the title-bar readout (state, speed, height, - pad/keyboard), and screenshots (e.g. `ffmpeg -f x11grab`). + pad/keyboard), the FPS counter in the top-right corner (vsync caps it at the display rate), and screenshots (e.g. `ffmpeg -f x11grab`). - **The development pad** is an Xbox Elite Series 2 over USB. GLFW's built-in database lacks its exact GUID, so an embedded mapping line lives in `controls.c` (`EXTRA_GAMEPAD_MAPPINGS`). Unmapped pads are printed at startup with their GUID. |
