init.luau
Versions
Every version of this package its world published, newest first by when it first appeared. A version published again later keeps its place.
Comparing from 01M1TW3BNKM1C5S7CVQ9RDBW2B. Pick the version to compare it with. Cancel
city: three landmarks, THE TANK's burst, and a city the frame stops paying for THE TOWER, THE SPAN and THE TANK are elected on every build — the tallest skyscraper, the bridge, and the water tower nearest the centre line — and each flies a pennant on the block that stands highest in it, parented so the flag rides the structure down. City:landmarks(), City:atRest() and City:bounds() are what the launcher, the HUD and the camera read them through. A landmark's topple pays its multiple and the called one pays again, applied at the single place a topple is now recorded. THE TANK bursts when it goes: every live block inside six metres takes an outward shove that falls off to nothing at the rim, and the governor bounds it like any other debris. Underneath, the city stops costing the frame what it used to. The 143 block ids are bound once at build and every frame's positions arrive in one call into a typed vec3 buffer, which the sweep then reads as BYTES — measured over 143 blocks and 200 frames on this engine: 0.307 ms per entity, 0.438 ms through batchRead into Lua tables, 0.077 ms through the buffer's getVec3, 0.036 ms this way. The per-block state moved from 143 tables to arrays indexed by slot, 0.59 ms of sweep against 0.054 ms. City's update reads 0.11-0.22 ms where it read 0.40-0.46. The arming pass writes armPerFrame joints a frame instead of all 126 in one step, so the fifth of a second it used to spend frozen two seconds into every session is spread across eight frames; the log line still reports all 126 armed from 50..1885 N. And a block whose joint has broken sheds its Joint component from the break handler, so a flattened city ticks no joint pumps at all where it used to tick 126. blocks.module closes every archetype through one finish(), which names the 3.2 metres a topple tier is worth once instead of six times; PAINT_COUNT and KINDS are gone, and the layout's zMax clamp stays as the check that Rules.CITY.zMax is still where the far street is. Seed 7 builds the same city it did: 17 structures, 143 blocks, 126 joints, the same x/z/height/tier for every one. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0139MdCaDTnP2jpG8zgk5N2N
01M1TW3BNKM1C5S7CVQ9RDBW2B2d3aac4182Browse filesPickedcity: six block archetypes, joints sized from the load they carry, and the score for knocking them down The skyline is a plan before it is bodies. game.city.blocks lays out six archetypes - a tapering skyscraper, a banded office slab, a water tower on four legs, a thin antenna mast, a three-span bridge and a gate with a lintel - across four streets from a seed, and hands back block specs and joint edges. It spawns nothing and reads no entity, so a layout can be counted and validated without a simulation. Sites are shares of the table's own half-width, and the far street keeps clear of the table edge so a toppled block has somewhere to fall. Every structure is a TREE of fixed joints in which each block holds at most one. An entity carries one Joint component and a second silently replaces the first, so that rule is what makes Physics.jointReaction(blockId) answer for a known joint - which is what lets the thresholds be measured. Blocks.validate checks it and the component refuses to build a structure that fails. Joints are created with no threshold. The city then stands on its own until every few blocks read below Rules.PHYS.settleSpeed, the resting load is sampled over 15 frames, and each joint is armed at breakForce = measured force x Rules.PHYS.jointBreakMargin breakTorque = measured torque x Rules.PHYS.jointBreakMargin floored so a joint under nothing is not released by its own settling. Nothing is guessed. Sizing the ANGULAR threshold from the measured torque rather than from the linear one is what stopped the bridge and the gate collapsing on their own: a cantilevered deck rests under 180 Nm of angular reaction and almost no force, so a threshold derived from the force alone released on the first step. Home is re-read at arming, so settling is never scored as damage, and a structure that failed to stand up is reported instead of counted as the player's work. Every frame a block that moved is clamped to Rules.PHYS.debrisMaxSpeed and debrisMaxSpin - the governor that stands in for CCD, which is off on every body here - and scored: displaced by mass, off the table, and a structure past toppleFraction going through Game.recordTopple for the chain. A block reaching the playroom floor is despawned a couple per frame so a wave of debris does not rebuild the solver's islands at once. Painted wood: ten materials over one generated grain texture, each structure turned off the grid and each free-standing stack given a per-block twist, so a tower reads hand-stacked. A block's yaw is why the joint anchors are rotated into each body's own frame before they are handed over. Verified in play at 1080x1440: 17 structures, 143 blocks, 126 joints, all standing and nothing displaced after a rebuild. A boosted launch down the middle lane toppled 8 towers with the chain reaching 8 and the multiplier 4.5, for 35220. A repeatable 40 kg strike topples 2-4 and the census reads back the standing count the capture shows. The antenna mast clipped at 12.6 m keeps blocks 1-8 within 0.02 m of where they were built and loses only the top four; the same mass into a skyscraper's base shoves its bottom four storeys 4.8 m along the table still stacked at their own heights. Physics step median 0.16 ms across every run, 0.53 ms peak over a full collapse on a quiet engine, ccdMs 0 throughout, and no loose body above the debris clamp once everything rests.
01M1SFEZJW1HHDX5X2CQXG2XFE61d1de18e8Browse filesCompare with this version