One-way platforms (drop through with S) #12

Closed
opened 2026-11-07 18:27:42 +00:00 by claude · 1 comment
Member

Terraria's platforms are a core building block. Add a thin platform node you can jump up through and stand on, and drop through with down/sneak. Avatar collision is engine-side, so this probably needs the avatar to toggle a platform-aware collision check (custom ground probe plus a temporary pass-through window). Recipe: 1 wood → 2 platforms, no station.

Terraria's platforms are a core building block. Add a thin platform node you can jump up through and stand on, and drop through with down/sneak. Avatar collision is engine-side, so this probably needs the avatar to toggle a platform-aware collision check (custom ground probe plus a temporary pass-through window). Recipe: 1 wood → 2 platforms, no station.
claude added this to the v0.2 Core Feel milestone 2026-11-07 18:27:42 +00:00
claude added the area/items-crafting
priority
high
type
feature
labels 2026-11-07 18:27:42 +00:00
eric added this to the Strata Roadmap project 2026-11-07 18:36:27 +00:00
eric moved this to To Do in Strata Roadmap on 2026-11-07 18:37:23 +00:00
eric closed this issue 2026-11-08 06:17:37 +00:00
Author
Member

Done in 2c0911d.

What changed

  • New strata_core:platform_wood (thin 3 px strip, full-cell selection box so it's easy to aim at). Recipe: 1 wood → 2, no station.
  • Platforms are walkable = false; landing is done in Lua (mods/strata_core/building.lua): strata.platform_landing(x0, x1, y_from, y_to) finds the highest platform top an entity's feet crossed this step, and strata.platform_step() snaps the entity onto it. strata.platform_support() turns the entity's gravity off while it rests there, so it doesn't sink and jitter between server steps.
  • Avatar: jumping up passes through. S (or sneak) while standing on a platform ignores platforms for 0.25 s and gives a small downward push. Teleports reset the landing history so a long jump doesn't catch a platform in between.
  • Slimes use the same helper, so they stand on platforms too.
  • Placement overlap checks now share strata.objects_in_cell().
  • DESIGN.md and README (controls) updated.

Tests (headless, tests/run.sh): landing math cases (falling, resting, rising, edges); an ownerless avatar driven through a new _test_ctrl hook lands on a platform, drops through with S to the ground, and jumps back up onto it; a slime rests on a platform. 29/29 pass, 0 ERROR.

Follow-ups / not verified: how it looks in the client (snap smoothness) needs a hands-on check. Walking up platform "stairs" diagonally isn't supported yet, since Terraria-style stair platforms would be a separate feature.

Done in 2c0911d. **What changed** - New `strata_core:platform_wood` (thin 3 px strip, full-cell selection box so it's easy to aim at). Recipe: 1 wood → 2, no station. - Platforms are `walkable = false`; landing is done in Lua (`mods/strata_core/building.lua`): `strata.platform_landing(x0, x1, y_from, y_to)` finds the highest platform top an entity's feet crossed this step, and `strata.platform_step()` snaps the entity onto it. `strata.platform_support()` turns the entity's gravity off while it rests there, so it doesn't sink and jitter between server steps. - Avatar: jumping up passes through. **S (or sneak)** while standing on a platform ignores platforms for 0.25 s and gives a small downward push. Teleports reset the landing history so a long jump doesn't catch a platform in between. - Slimes use the same helper, so they stand on platforms too. - Placement overlap checks now share `strata.objects_in_cell()`. - DESIGN.md and README (controls) updated. **Tests** (headless, `tests/run.sh`): landing math cases (falling, resting, rising, edges); an ownerless avatar driven through a new `_test_ctrl` hook lands on a platform, drops through with S to the ground, and jumps back up onto it; a slime rests on a platform. 29/29 pass, 0 ERROR. **Follow-ups / not verified**: how it *looks* in the client (snap smoothness) needs a hands-on check. Walking up platform "stairs" diagonally isn't supported yet, since Terraria-style stair platforms would be a separate feature.
Sign in to join this conversation.