Skip to content

One fall for every body: Drop and the gravity of the world - #570

Merged
k06a merged 4 commits into
mainfrom
claude/project-thread-63bh1y
Dec 3, 2026
Merged

k06a merged 4 commits into
mainfrom
claude/project-thread-63bh1y

Conversation

@k06a

@k06a k06a commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Requested by Anton · project thread

One fall for every body, one gravity of the world

Step 3 of the refactor towards one way per concept (after Ground, #521, and the one step on foot, #549).

What was wrong

A body that lost its floor came down by the rule of whoever moved it:

who how it came down 20 cells (4 m) took
an animal, a pet on the leash 22 cells a second, constant 0.92 s
a herd, the animals of a pen eased to the floor (most of the way in a fifth of a second) about 0.4 s
a resident whose place lost its floor 24 cells a second, and it stayed in the air over water 0.85 s
a walker stepping down (residents, their dogs, fire and repair crews, police) 16 cells a second 1.27 s
a townsperson by a crater, a parked car a gravity of 45 0.95 s
the player, a rider, a vehicle a gravity of 62 0.80 s

The number 62 itself was written in seven places (the player, the ball, the board, the suspension, the rope of the leash, the jump of a horse, the fall of a mount).

What it is now

  • GRAV (00_util.js): the gravity of the world, one number. The player, the ball, the board, the suspension, the rope and a rolling car read it.
  • Drop (71_drop.js): the one law of a body that comes down. Who asks brings the body's height, its speed and the floor under it.
    • Drop.under(x, z, y): what a body with nothing under it comes down to: the first thing below, the water too (nobody hangs in the air; water a cell deep is waded).
    • Drop.to(o, g, dt): one step of the fall; returns the speed of the landing.
    • Drop.feet(o, fy, dt, up): feet that follow their floor: up a step at one rate for everybody, down by falling.
    • Drop.v(vy, dt): the speed after a while in the air (a mount or a vehicle off the ground).
  • Folded in: Fauna (both branches), Leash, Flock.run / Flock.smooth and Pen.step (herds, pens, their dog and people), Nav.lift (residents, crews, police), Nav.fall (a kept place), the residents' dogs, Boom.sink (a townsperson in an edited column), the parked cars of Boom.after, the player of a game after a jump at the ball (79_sport.js), Drive (free fall of a vehicle and of a mount).
  • The fall profile of Ground is gone: the one question is sink.
  • Two numbers stay the real 9.81 m/s² on purpose (RP_G, KIN_G: the formulas of rails and of tipping are in real units); the test names them.

Visible

  • Everybody falls the same height in the same time and lands together (4 m: 0.8 s).
  • A resident whose floor is dug away over water comes down to the water.
  • Feet rise onto a step at one rate (14 cells a second; it was 9, 10 or 14); a herd no longer snaps to a floor that moved.

Tests

  • New tools/drop.test.mjs: the time and the speed of a fall (24 falls of 0.3…60 cells at 30…240 frames a second), the floor at frames of up to 5 s, the cap of the air, feet on a step, what is under a body (a hole, deep and shallow water, a table, a crown, a floor further than the look reaches); a walker, a kept place and an animal come down 20 cells in the same frames (the older rules are printed next to them); no file writes gravity as a number where it is used; who brings a body down asks Drop.
  • tools/ground.test.mjs: the old fall of a kept place, kept in the test, against the law on 60 000 random columns: the same floor wherever the old one found one; the three chosen differences are counted and named (water below or a floor more than 72 cells down: now it comes down; a place inside a block or in water: not a fall).
  • tools/split.test.mjs: concept drop (0 apart), new detector sink (a height that comes down at a rate written on the spot): 8 on main, 1 now (a climber lowering itself over an edge on its 3D way).
  • Loaders of etho, foot, herd, sport, susp tests take the new file.
  • Green here: drop, ground, foot, etho (115), herd, navkeep, movers, board, ball, susp, split, members, undef, dupkeys, srclist, conventions, quotes; boom.test in the browser (a table and a parked car come down into a crater, undo puts them back).

Screenshots

tools/shots/517.mjs: a photo finish. A deck is taken from under a parked car, a cow and a sheep at the same moment and the world is stopped 0.4 s later: all three are the same 5 cells down.

https://claude.ai/code/session_01Uiczdv1q9xAXyaDKTTGyWH


Generated by Claude Code

…ld (GRAV)

Animals, pets on the leash, residents and their dogs, crews, police, townspeople and parked cars over a
hole, a mount or a vehicle off the ground come down by one law; the ball, the board, the suspension and
the player read the same gravity. New tools/drop.test.mjs, split.drop 0, split.sink 1 (8 on main).
Work in progress: notes, shots and browser tests follow.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdv1q9xAXyaDKTTGyWH
…e fall go through Drop; notes and shots of build 516

Nav.lift (residents, crews, police), the residents' dogs and the player of a game after a jump come down
by the law; a mount or a vehicle off the ground takes its speed from Drop.v. The fall profile of the
ground is gone (Drop.under asks the sink profile; water a cell deep is waded). ground.test compares the
old fall of a kept place with the law and names the three chosen differences.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdv1q9xAXyaDKTTGyWH
…a deck

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdv1q9xAXyaDKTTGyWH
@k06a k06a self-assigned this Dec 3, 2026
@k06a k06a added the queue In the merge queue: lands on main by itself (node tools/merge.mjs <pr>) label Dec 3, 2026 — with Claude
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

⏱ Performance: this PR against main

Scenarios of src/game/98_perf.js, the two builds by turns on one runner (tools/perf.mjs, CPU side, draws counted not drawn).

✅ No regression against main

More turns to settle a suspicion: night +4, drive +4 (a difference counts when the turns of the two builds stand apart, 8 turns each).

scenario metric main PR Δ threshold turns
– no change beyond the noise
scenario CPU mean p95 max slow/min spikes/min miss sync gens read gens draws top systems (ms/frame)
idle 12.8 26.9 69.2 7.48 33.7 0% 0.00 0.00 369 Town.update 2.31⚠️, Land.drawPass 1.06, Land.meshChunk 0.90, Town.draw 0.74
night 10.4 23.4 53.0 3.00 8.99 0% 0.00 0.00 366 Town.update 1.52⚠️, Land.drawPass 1.07, Town.draw 0.66, Land.meshChunk 0.62
drive 60.7 118 531 464 15.0 79% 72.0 0.00 114 Land.lightTick 23.7⚠️, Land.gen 5.58⚠️, Land.lodData 3.22, Lift.update 2.93
flight 24.4 60.5 986 105 155 0% 0.00 0.00 50.5 Folk.update 3.58, Land.lodData 3.17, Lift.update 1.96, BigMap.sample 1.67
tunnel 26.9 84.6 492 170 117 5% 0.00 0.00 206 Land.lightTick 5.18⚠️, Town.update 2.54⚠️, Folk.update 1.97, Sp.draw 1.86

Over budget (ms/frame, budget): drive Land.lightTick 23.74 > 1 · drive Land.gen 5.58 > 0 · tunnel Land.lightTick 5.18 > 1 · drive Town.update 2.88 > 1 · tunnel Town.update 2.54 > 1 · drive Land.meshChunk 2.46 > 1 · idle Town.update 2.31 > 1 · drive gl.upload 1.46 > 0.8


Generated by Claude Code

…T, the notes and the shots of the fall become 517

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uiczdv1q9xAXyaDKTTGyWH
@k06a
k06a merged commit f1d62b2 into main Dec 3, 2026
2 checks passed
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Screenshots of build v522

🍎 One fall for every body: a deck went from under a parked car, a cow and a sheep at the same moment, and the world is stopped 0.4 s later. All three are the same 5 cells down. Before, the animals would be 8.8 cells down and the car 3.6: each kind of body fell by a rule of its own

One fall for every body: a deck went from under a parked car, a cow and a sheep at the same moment, and the world is stopped 0.4 s later. All three are the same 5 cells down. Before, the animals would be 8.8 cells down and the car 3.6: each kind of body fell by a rule of its own

🍎 The same three a moment later: on the meadow, 12 cells down, on their feet and wheels

The same three a moment later: on the meadow, 12 cells down, on their feet and wheels

All of them are assets of the v522 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

queue In the merge queue: lands on main by itself (node tools/merge.mjs <pr>)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants