Repository navigation
One fall for every body: Drop and the gravity of the world - #570
Conversation
…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
⏱ Performance: this PR against mainScenarios 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).
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
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 🍎 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. |


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:
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).Fauna(both branches),Leash,Flock.run/Flock.smoothandPen.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 ofBoom.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).fallprofile ofGroundis gone: the one question issink.RP_G,KIN_G: the formulas of rails and of tipping are in real units); the test names them.Visible
Tests
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 asksDrop.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: conceptdrop(0 apart), new detectorsink(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).etho,foot,herd,sport,susptests take the new file.boom.testin 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