Chapter 6 · Section 1
From a Field of Bodies to Galaxies
BPT Part 3.14 (The Game's Reading) states the method this chapter documents: "A galaxy in the game holds tens of bodies, not the hundred thousand arms need ... So, as cosmological simulations do, its inner structure is drawn by the known laws from what the simulation measures in it: from the mass round its well, its rotation curve, and from that its shear rate, epicyclic frequency, disk surface density, its number of arms (Arm Number) and their pitch (Arm Pitch Angle); the disk itself turns by the Disk Turn Rate on a flat curve, each star on its own orbit, the arms' pattern with it, in the galaxy's own sense." The simulation decides where each galaxy is, which bodies and stars are its own, its mass, gas, metals, young share, turning sense, the mass profile round its well, and how it moves. The laws decide its arms, pitch, disk scale length, turning rate and inner layout, from the numbers the simulation measured.
The reading runs in a fixed order, every 8 steps of pulseCounter (the comment calls it every 4 Pulses) from the Physical Nova on: measureFeeding() app.js:793, which stepWells() app.js:818 calls each step, calls updateGalaxies() app.js:3093 at app.js:816.
- The index.
galaxyIndex()app.js:2919 bins all bodies, gives each body to the well that pulls it hardest, measures each well's halo reach, makes every well inside a heavier halo that halo's satellite, and reads the knee of the galaxy mass function. (Part 6.2.) - Each galaxy read once.
galaxyOf()app.js:2963 reads, for every non-stellar well, the bodies it owns: their mass, rotation, gas, metals and stars, its type, its disk, arms and pitch, its brightest kinds of star, and its true and drawn size. (Parts 6.3 to 6.5.) - The wells fed, the sites sized and tested. Each well is fed from its galaxy's star formation (wells chapter); each site's halo and core radius are set by
haloRadius()(Part 6.7); the waiting sites are tested for direct collapse (wells chapter). - Star formation by heat. Each body's
sfHeatandgalare set from its galaxy's heat (stars chapter); the literals sit inupdateGalaxies()and are listed in Part 6.6. - The list for the scene. Every galaxy with lit stars, not a cloud and not empty, goes on the list with its turn rate from
diskTurnRate()(Part 6.6); each is enlarged toward its nearest neighbor (Part 6.5) and handed tosetGalaxies()scene3d.js:483 (Part 6.8), which also lays out the streams (Part 6.9).
Each frame, placeGalaxies() scene3d.js:616 puts every galaxy point round its well's current place and turns it, and placeStreams() scene3d.js:598 moves the stream stars in.
Separately, at every life sample, sampleSites() app.js:1489 measures how much of the surface lies inside the sites' cores, for the Site Lift (Part 6.7), and the field drawing marks the web's dense places (Part 6.10).
Two things this code calls belong to other chapters and are only referenced here: the heat of a galaxy's gas and its star formation share (galaxyHeat in heat.js, the stars chapter) and the feeding and direct collapse of the wells (feedWellFromStars, testDirectCollapse, the wells chapter). Their literals in this code are listed where they sit.
What the player sees, in order. Before the Physical Nova (Harmonic 3, the big bang) there is no matter and no galaxy. From it, the 3D view of the torus fills with matter; the readings begin, and a galaxy is drawn round a well as soon as the bodies it owns hold living stars. In a universe too shallow for stars (below the star line) no galaxy is ever drawn, and the Language Block marks every galaxy line "skipped: no stars". Over the life the galaxies turn, grow, merge and change type as their stars age; when the universe returns to the Source the galaxies fade out with the rest of the scene, and in the full decay they are cleared once the matter is in (app.js:2675). After the return, a tap on a well opens the banner that names its galaxy (Part 6.3). All of this is drawn only in the 3D view ("3D · the torus" in the view menu); the 2D field view shows the data, not the galaxies.