diff options
Diffstat (limited to '')
| -rw-r--r-- | platformer/game_feel.md | 98 |
1 files changed, 66 insertions, 32 deletions
diff --git a/platformer/game_feel.md b/platformer/game_feel.md index 616e649..7cd1217 100644 --- a/platformer/game_feel.md +++ b/platformer/game_feel.md @@ -48,8 +48,8 @@ and eased, not snappier. - **Camera-relative controls.** Stick up = away from the camera. - **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 + (0.72 s, `PLAYER_GROUND_ACCEL` 8.4 m/s²). Releasing the stick at full speed skids to a stop in 31 ticks + (0.52 s, 1.45 m, `PLAYER_GROUND_FRICTION` 12.0 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°). @@ -68,6 +68,12 @@ and eased, not snappier. is the continuous-physics figure) and a tap gives about 0.72 m. Level geometry is sized against 2.33 m. - **A jump pressed on the landing tick is never lost.** The FALL state hands off to the ground logic on the same tick it detects landing. +- **Jump buffer: an early press still counts.** An A press is remembered for `PLAYER_JUMP_BUFFER` + (0.1 s), and the first moment within that time a jump is possible, it happens. On the ground + that's instant. Pressed while still falling, it fires on the landing tick: presses up to 6 ticks + (0.10 s) early give the second jump, and 7 or more give nothing. Pressed just before grabbing a + wall, it fires as an early wall jump the moment you grab. Holding A still decides hop vs. full + jump. **Why:** players pressed a hair early while falling and lost the second jump. - **A normal jump rewards a full run with a little extra speed.** In a normal jump the top speed is `PLAYER_JUMP_MAX_SPEED` (7 m/s). Up to run speed (6 m/s × stick) the air accelerates as usual; past it, only at `PLAYER_JUMP_BOOST_ACCEL` (1.5 m/s²), so a full jump from a full run builds evenly: @@ -95,7 +101,7 @@ and eased, not snappier. in `player.c` reads it. Walking off an edge and landing also turns it off. A press on the landing tick already counts. - **The skid (SM64's turnaround skid).** At full run and above (at least 95% of `PLAYER_MAX_SPEED`, - `PLAYER_SKID_SPEED_FRACTION`, so faster future moves count too), pulling the stick more than 120° + `PLAYER_SKID_SPEED_FRACTION`, so faster future moves count too), pulling the stick more than 130° (`PLAYER_SKID_ANGLE_DEG`) off the run direction enters the `SKID` state. The player **faces the stick at once** (and keeps tracking it) while still sliding the old way (`skid_yaw`), so they're turned around and sliding backward. There's no steering. The skid always lasts `PLAYER_SKID_DURATION` (0.5 s, 30 ticks) @@ -116,15 +122,21 @@ and eased, not snappier. on through the jump and turns off on landing. Landing it **does** open the second-jump window (`heightened_movement`, 0.2 s), so skid → retreat jump → second jump chains. `heightened_movement` is also on for the whole retreat jump, so it can grab a wall. -- **`heightened_movement` rules, all in one place.** It turns on when landing a normal or retreat jump - (a 0.2 s window that only counts down while not in a jump), and during a second jump, retreat - jump, wall hang, or **any** wall jump (early or late). It turns off when the window runs out, when - landing a second jump or plain fall, or when a wall hang runs out. On the ground it means "A +- **`heightened_movement` rules, all in one place.** It's on during the second jump, retreat jump, + every wall jump and every wall hang, and for a 0.2 s window after landing a normal or retreat jump + (the window only counts down while not in a jump). It is **not** on during a plain first jump, so a + single jump can't grab a wall. **We tried it the other way:** players expected to wall hang off one + jump, but it made wall hangs too strong, so it was reverted. It turns off when the window runs out, + when landing a second jump or plain fall, or when a wall hang runs out. On the ground it means "A gives the second jump"; in the air it means "can wall hang". - **The wall hang (`WALL_HANG`).** Grabbing a wall needs all of these: `heightened_movement` is on, the player is in the air (JUMP or FALL), they hit the side of a box with `allows_wall_hang`, and - they came in within 45° of head-on (`PLAYER_WALL_HANG_ANGLE_DEG`). A 50° hit slides along the wall - as usual. On grabbing, the player **turns to face where the wall jump will launch** (the + they came in within 45° of head-on (`PLAYER_WALL_HANG_ANGLE_DEG`), **and** their jump wouldn't + carry their feet over the wall's top anyway (apex = y + vy²/2g below the top). A 50° hit slides + along the wall as usual. The **clear-the-top rule** means hopping onto a ledge from just below its + lip with a heightened jump lands on top instead of grabbing the face. It was added when every jump + could grab and kept after the revert, since it also stops second jumps snagging on lips. Measured + with a heightened jump: 1.2 m under the cliff's lip lands on top, while 10 m lower grabs the face. On grabbing, the player **turns to face where the wall jump will launch** (the mirrored direction below, so the nose previews the jump), stops, and slides down with gravity off: `vel.y = −min(3 m/s² × t, 2 m/s)` (`PLAYER_WALL_SLIDE_ACCEL`, `PLAYER_WALL_SLIDE_MAX_SPEED`). That's 0.45 / 0.90 / 1.35 / 1.50 m/s at 0.15 / 0.30 / 0.45 / 0.50 s, and about 0.4 m of slide over the @@ -240,6 +252,16 @@ New automatic camera behaviors should follow the same approach: slow, eased, and ## Level and collision +> **Platform size rule: platforms are ~5 m across at minimum.** Only the most extreme challenges +> (or secrets) go smaller. **Why:** the player is heavy. Starts build up, stops skid for half a +> second, and a normal jump lands with momentum. At this size or larger, the player feels they have +> **space**: room to land, skid and line up the next jump, without a small ledge turning every +> landing into a fall. Apply it to anything new, hand-placed or generated. A smaller platform is a +> deliberate choice that should read as a special challenge, never a default. +> (Right now the cliff course generator uses 4–6 m, `ROUTE_MIN_SIZE` / `ROUTE_MAX_SIZE` in +> `level.c`; its minimum should move up to ~5 m to follow this rule. The random test platforms +> around spawn, 2–6 m, predate the rule.) + - **The level is a test space**, like SM64's pre-level sandbox: flat ground plus 40 seeded-random box platforms (`WORLD_SEED`, so every run is the same layout). Spawn is kept clear (4 m). - **Wall hanging is opt-in per box.** `Box.allows_wall_hang` is false by default. The level marks @@ -260,25 +282,33 @@ New automatic camera behaviors should follow the same approach: slow, eased, and - **The cliff** is a right triangle, 55 m tall. The south face (z = 40, facing spawn, x −30..20) and the east face (x = 20, z 40..90) meet at the south-east corner. The third side faces north-west, built as 10 strips stepping down the diagonal. **The cliff is hangable** (violet-tinted rock), and - so are 7 tall rock pillars 3.5–5 m out from the faces, which form random chimneys with it. The rule - is that big terrain surfaces are hangable and small platforms aren't. + so are 7 tall rock pillars 4–6 m out from the faces, which form random chimneys with it. The pillars + are placed after the route and never block one of its hops. The rule is that big terrain surfaces + are hangable and small platforms aren't. + - **Height tiers:** every still platform's top sits on a **1.5 m grid** measured down from the cliff + top (`TIER_HEIGHT`). One tier up is a single jump and two tiers up is a double (second) jump, so + which one a gap needs reads at a glance. - **How it's generated:** a band wraps the cliff (along the south face, around the corner, up the east face). Each row out from the face turns the corner at its own spot, so distance along the band is continuous. On it: - 1. One hidden **route** from the ground to one hop below the top, made of **big platforms (3–4.5 - m)**, because the player's weight makes small ledges skid-offs. Each step is a comfortable - normal-jump rise (0.9–1.7 m) or second-jump rise (2–2.9 m), with the path between the two - platforms checked clear (no pillar or platform in the way). About a third of the steps are - **switchbacks**, hopping out to the next row or back in instead of along, so the route climbs - without running off the end of the face. Hops in toward the hangable face are always normal - jumps, because a second jump's overshoot would grab the face instead of landing. The route - stays beside the faces and drifts in for its last hop. When boxed in, it tries easier hops, - then a scan of nearby spots. - 2. A **scatter** of 5 more platforms (mostly moving) for branches and dead ends. - 3. **The crossing:** a route on the line from the top's north-west corner over the river to the - far cliff (60 m, hangable, the finish), plus 2 extras. - - In total that's **about 37 platforms** (the user asked for 30–40, down from ~135), 8 of them moving. + 1. One hidden **route** from the ground to one tier below the top, made of **big platforms (4–6 + m)**, because the player's weight makes small ledges skid-offs. The platforms sit **1.5–13 m out + from the face** (not hugging it; only the last few come in, for the hop onto the top). Steps + are **mostly singles (+1.5 m)**, with doubles (+3.0 m) mixed in as needed and **never two + doubles in a row**. Measured on the current seed: 19 singles, 8 doubles, 1 level step, 0 + back-to-back doubles. The path between each pair is checked clear. A step either goes along + the band or **switches rows** (out a row, or back in, at the same spot along the face). It + switches more when it's ahead of schedule, so it arrives (`ROUTE_ARRIVE_BY`) without running + off the face. Hops in toward the face are singles. When stuck, it tries easier hops, then a + scan of nearby spots. + 2. A **scatter** of 6 platforms, each a **single hop beside a route platform**, level with it or + one tier up or down. They're branches, shortcuts and dead ends, mostly reachable with one jump. + 3. **The crossing:** a tiered route (mostly up or level, never two doubles in a row) from the + top's north-west corner over the river to the **far cliff, 58 m** (two tiers above the top, + hangable, the finish), plus 2 extras beside it. + + In total that's **39 platforms** (the user asked for 30–40), 7 of them moving. Climb platforms + average 6.2 m from the cliff face. - **Moving platforms:** each slides back and forth along the band, bobs up and down, or loops a flat or upright circle, with its own 3.5–7 s period and phase (`BoxMotion` in `level.h`). Every motion passes through its placed position each cycle, and no two moving route platforms are in a @@ -288,16 +318,15 @@ New automatic camera behaviors should follow the same approach: slow, eased, and are 4.3 m apart vertically, so none blocks a jump from another. - **Verified by a headless course test** (outside the repo). It builds a reachability graph with a conservative jump model, sampling the moving platforms over 60 s. The bot then plays every - plausible upward hop between still platforms and drops the ones that fail (35 played, 1 failed). - The top and the finish are reachable. With one route and ~37 platforms, most route platforms are + plausible upward hop between still platforms and drops the ones that fail (30 played, 0 failed). + The top and the finish are reachable. With one route and ~39 platforms, most route platforms are the only way past their spot in the graph. The graph doesn't count wall hangs, though, and the hangable cliff and pillar chimneys offer other ways up. **The user asked for ambiguity:** jumps that fail or dead ends are fine, as long as the course as a whole can be finished. Don't tighten it into a clean, obvious path. - - **A snag to know about:** a *second* jump straight at the hangable cliff from a ledge just below - the lip grabs the face instead of clearing the top, because `heightened_movement` is on. Topping - out works with a normal jump (wait out the 0.2 s window). The generator's hops in toward the face - are normal jumps for the same reason. A ledge-climb or "clear the lip" rule is a candidate for later. + - **Topping out:** the route's last hop is a single jump (no wall grab). With a second jump, the + clear-the-top rule lands you on top instead of grabbing the face. The generator's hops in toward + the face are singles, so they can't grab the face on an overshoot. - **The river** is 13 overlapping water tiles (`BOX_STYLE_WATER`, a solid 5 cm sheet, no swimming) along the diagonal, parallel to the third side. - **Known rough edges:** there's no camera collision, so the camera passes into the cliff and @@ -374,7 +403,7 @@ New automatic camera behaviors should follow the same approach: slow, eased, and | 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² | +| Ground friction | 40 → 16 → 9.5 → 11.3 → 12.0 m/s² (0.23 → 0.45 → 0.53 → 0.52 s stop; 11.3 kept 0.53 s at 6 m/s, then a hair quicker) | 12.0 m/s² | | Air accel | 30% of ground accel → its own constant, value kept | 9 m/s² | | Second jump height | 2× (19.66 m/s) → 1.75× (18.41 m/s), sets `heightened_movement` | 18.41 m/s | | Second jump window | 0.5 s → 0.3 s → 0.2 s after landing | 0.2 s | @@ -387,6 +416,11 @@ New automatic camera behaviors should follow the same approach: slow, eased, and | Wall lockout | per box → per wall surface (the cliff is several boxes) | surface | | Late wall jump heightened | off → on (late wall jumps couldn't grab the next wall) | on | | Facing while wall hanging | into the wall → the wall jump's launch direction (a visual preview) | launch dir | +| Jump buffer | none → 0.1 s (early presses fire on landing / grab) | 0.1 s | +| First jump heightened | off → on (a single jump can wall hang), plus the clear-the-top rule | (reverted below) | +| Skid pull-back angle | 120° → 130° (must pull more squarely back) | 130° | +| First jump heightened (revert) | on → off again (wall hangs off one jump were too strong); clear-the-top rule kept | off | +| Cliff course platforms | 3–4.5 m → 4–6 m, 1.5–13 m out from the face, heights on a 1.5 m tier grid, no back-to-back doubles, far cliff 60 → 58 m | 39 | | Second jump top speed | 6 m/s (same as running) → 4 → 5 m/s until it lands (4 felt a tad harsh) | 5 m/s | | Second jump slowdown | air accel 9 m/s² (0.25 s, "wall of syrup") → own rate 3.5 m/s² (0.60 s) | 3.5 m/s² | | Skid | none (full-speed U-turn) → 18 m/s² even braking, turn at the end (0.33 s) → face the stick at once, glide-then-plant curve (power 2) | 0.5 s | |
