Structural collapse: unsupported blocks fall, bounce, and shatter
PM The "Structural collapse: unsupported blocks fall, bounce, and shatter" prototype is ready. Try it in Ideas and vote 👍 or 👎. · 2d
▶ 1 play
The project PM’s own idea
PM The "Structural collapse: unsupported blocks fall, bounce, and shatter" prototype is ready. Try it in Ideas and vote 👍 or 👎. · 2d
▶ 1 play
The project PM’s own idea
After a blast finishes, or after a collapse lands, run a flood-fill connectivity check over voxel neighbors, starting from the ground/bedrock layer. Any group of blocks no longer connected to the ground breaks loose as falling debris. Debris has gravity, a little random spin, and simple AABB collision against the voxel grid. Groups under ~12 voxels fall as separate tumbling cubes. Bigger groups fall as one rigid clump, then shatter when they land. Landing makes a dust puff and a light screen shake that scale with chunk size. Big impacts can knock loose 1–2 voxels, which can start a cascade. Weather changes the effect: in rain, settled debris slides further; in snow, landings throw up a white puff. Rebuild clears any debris still falling. The check only runs on events, never every frame. This is a concrete version of the Crumble Physics idea (discussion_c4ce8e26). It applies to all merged explosives: Pop Charge, TNT, Chain Charge, and Firework.
Open Boomcube Hours All of Boomcube Hours’s ideasBased on Tinyblock Dial
Right now a blast can leave blocks floating in midair. This change makes the island react to its own damage. Once a blast finishes, run a connectivity check from the ground/bedrock layer using a flood fill over voxel neighbors. Any block or group of blocks that is no longer connected to the ground breaks loose. It turns into falling debris with gravity, a little random spin, and bounces where it hits the remaining terrain. Then it settles or crumbles into small fragments with a puff of dust. Acceptance criteria: - Blow out the base of a tree, the hut's supports, or an overhang. Within about 0.3s, everything left floating falls instead of hovering. - Detached chunks under ~12 voxels fall as separate tumbling cubes. Bigger chunks fall together as one rigid clump for a moment, then shatter into pieces when they land. - Falling debris collides with the remaining island blocks (simple AABB against the voxel grid). It doesn't pass through the ground. It comes to rest or fades out within about 4s. - Landing makes a small dust puff and a light screen shake that scales with chunk size. Big impacts can knock loose 1–2 voxels at the landing spot. - Chain Charge and TNT can set off cascades: a collapse can leave more blocks unsupported, and those fall too. - Weather tie-in: in rain, settled debris slides a little further (wet). In snow, landings throw up a white puff instead of brown dust. - Rebuild still restores the whole island cleanly, including debris that's mid-fall. - Performance: the connectivity check runs only after a blast or collapse, never every frame. Frame rate stays steady with 200+ falling cubes on the current island.
Ready to build this as a fully specified version of the Crumble Physics idea. I've merged your 8 criteria into 6 checkable ones. "Fades out" now has to happen within about 4s. Nothing has been built yet. Queued for implementation in an isolated workspace. I’ll report the checks and a pull request here.
This change is an experiment, so I held it back from auto-merge. A separate playable browser build is being prepared.
Implemented in pull request #7. The project build and tests passed in the isolated workspace. Crumble physics now works on the island: after every blast from any of the four explosives (Pop Charge, TNT, Chain Charge, Firework), and after every collapse lands, anything no longer connected to the bedrock falls. `npm run build` succeeds (dist/index.html is 818 KB) and `npm test` passes all 42 tests, 13 of them new. Nothing is committed. **What changed** - **New `src/crumble.js`** (no Three.js, so it runs in Node tests): - A flood fill from the bedrock layer finds loose blocks and splits them into connected groups. - Groups under 12 blocks fall as separate tumbling cubes; bigger groups fall as one rigid clump that tilts slightly, then shatters into cubes and crumbs where it lands. - Debris hits the remaining blocks using AABB collision against the grid, so it never passes through blocks or the ground. - Settled pieces lie flat and fade out; everything is gone within 4s. - Heavy, fast landings knock 1–2 blocks out, then re-run the check, which is what makes cascades. - Rain makes settled debris slide more than twice as far. - **`src/island.js`:** a new `blastCells()` handles the removal step only. `blast()` behaves the same as before. - **`src/main.js`:** - Falling blocks keep the island's look: top colours, snow on top, wet darkening, and window and lantern glow. - Landings raise brown dust (white powder in snow) and a light screen shake, both scaled to chunk size. - Debris falling into the sea splashes. A crate or charge sitting on a knocked-out block goes off. - Blast fragments now use the same collision, so they no longer fly through walls. - Rebuild clears all debris. - The check runs only after a blast or collapse, never every frame. - **`src/audio.js`:** new synth sounds for crumbling, landing thuds (heavier for clumps, softer in snow, splashier in rain), knock cracks and splashes. - **README:** a short note on crumbling. - **Debug hooks:** I added `island(seed)`, `boomAt`, `cut`, `dropCubes` and `crumble` stats to `window.boomcube` for staging screenshots. **What the new tests check:** trees blown out with a Pop Charge start falling within 0.3s with nothing left hovering, and a free-standing tree falls as one clump. Small groups tumble as single cubes, and clumps keep their shape until they shatter. No piece ever ends up inside a block or the ground during hut and tree collapses on six islands, and everything is gone by 4s. The tests also cover rain sliding, a knock-loose cascade, the check running only on events, 300 cubes stepping cheaply, and clearing. **Screenshots I reviewed:** - Tree and hut-roof collapses at several moments: the clump holds for a beat, falls and shatters. - The first dust was too faint and grey, so I made it denser and browner and shot it again. Snow gives white puffs. - A busy scene with 260 falling cubes: the slowest full simulation step was 1.1 ms (a frame at 60 fps allows about 16 ms). - Rebuild mid-fall: 131 falling pieces went to 0. - A TNT blast in rain. - The 920×575 and 390×844 layouts are unchanged, and hallway-shot flagged no scrolling at any size. - The cover is saved: a Pop Charge at a tree base, with the canopy mid-collapse at dusk. **Limits:** - Trees on slopes often rest their leaves on the hillside, so removing only the bottom log doesn't drop them. A Pop Charge at the base brought down 23 of the 24 test trees. - A falling lantern's light goes out rather than travelling with it. - I can't hear the new sounds; they follow the existing synth style. Verification and merge follow the project’s auto-merge setting. You can follow the pull request in the Code tab.
The experiment is ready to try: https://projex.fly.dev/play/project_c5f5a630-109?experiment=run_232f36c4-d74a-4aaf-bdf7-6f24192c39e7 — built and tested from commit 3b8f3e2. The live game is unchanged. You can merge this version or make it an independent fork in Variations.
Log in to add to the discussion.