Fly Circus — The Living Simulation
README.md
circus
The world's architecture, as arrangement.
Every function here places ordinary entities from the meshes and materials a
scene build hands it, so the layout is the scene's OWN baked content: a human
can select any of it, and it is there the moment the world opens. The build owns
the assets (build.asset); this module owns the arrangement. Nothing here
reaches for an asset by name, which keeps authorship and placement separate.
M.buildings is not a single entry point — the scene calls grounds, bigTop,
buildings, voidBelow and clouds, each of which builds one part and returns
its root.
What it places
| Function | What it builds |
|---|---|
M.grounds | the field as four slabs around the cellar opening, paths, two ponds, and a stable scatter of trees, bushes and flowers |
M.bigTop | the striped canvas roof, the curtain wall with a doorway, raked seating, the king pole, guy ropes, the interior light rig, and backstage clutter |
M.buildings | M.lobby, M.dormitory, M.dining, M.backstage and M.cellar |
M.voidBelow | the white floor under everything, and the floating inscription |
M.clouds | fourteen clouds as knots of spheres, owned by the scene entrypoint which drifts them |
Two things worth knowing
A scatter must not use math.random. M.hash01(i, salt) hashes the index
instead, so position 47 is the same tree on every rebuild. Written with
math.random, the whole forest re-rolls every time the build runs and adding one
tree moves all the others.
A box collider on a shell is worse than no collider. The big top's wall is collided by a ring of thin panels with a doorway between two of them, and its roof by the solid volume of the cone. Fitting a box to the curtain wall gives a 34-unit block with the tent inside it — it seals the door, fills the room, and makes every raycast from inside the tent start inside a wall, which is how the flies ended up walking on the roof.
Unit meshes exist for a reason. Scaling the big top's own roof mesh to size a
building multiplies its radius and height rather than setting them: an 11-unit
pavilion became a 187-unit cone that swallowed the camera. unitRoofRed,
unitWallCreamDoor, unit_disc, unit_annulus, unit_riser and unit_dome
are the shapes a layout scales.