Chapter 5 · Section 7
Where Stars Form: the Gas Depletion Law
The BPT law
BPT Part 6.10 states the Gas Depletion Law, t⇣⊛ = t⇣⊚·(ρ/ρ⇥)^(−0.4): "Gas in galaxies turns into stars over a depletion time, shorter where it is denser." Here t⇣⊚ is the depletion time at the threshold density, "about 2 × 10⁹ years in galaxies today, about 0.145 of the universe's age", ρ the density of the gas and ρ⇥ "the threshold above which gas forms stars". It is the Kennicutt–Schmidt law written as a depletion time, "the rule every cosmological simulation uses below the scale it can resolve, since no simulation of a universe resolves the cores where stars actually form. Measured over the whole life of a universe, the depletion time is a fixed share of its age." Its neighbor, the Star Formation Rate Ṁ⊛ = ε⇓·M_gas/t⇓ (about 1 % per free fall), is the rule at the scale of the cores.
The Part's Game's Reading, Formally, says how the game applies it: "gas in 8 × 8-cell clouds denser than twice the mean (per real area of the torus) turns into stars over t⇣⊛ = 0.145 · T · (ρ/ρ⇥)^(−0.4), T the life from the Physical Nova, each star drawing its mass from its cloud's gas". BPT Part 2.9's Star Formation Condition, the Jeans mass M_J = (π²·√π/6)·σ³/(G·√(G·ρ)), is "about half a Sun to a Sun" in today's cold dense cores. BPT Part 3.14 (Feedback) adds that gas a supernova or quasar has heated forms no stars for a while.
The established physics
- Kennicutt–Schmidt law Σ_SFR ∝ Σ_gas^1.4 (Kennicutt 1998; Bigiel et al. 2008), so depletion time ∝ ρ^(−0.4), about 2 Gyr today.
- Star formation at 1 % per free fall (Krumholz & McKee 2005), the rule this replaced.
- Gas heated by a supernova or quasar forms no stars until it cools (BPT Part 3.14, Feedback).
The game's math
In stepStars() stars.js:144–184. Clouds are CL × CL cells, CL = matter.cloud (8 on desktop, 2 on a phone; Chapter 4, Part 4.15). For each cloud: its gas, mass and metals; Z = metals/gas (stars.js:154–155).
meanCloud = all matter / (rows · cols) matter per cell (the name says cloud; it is per cell)
rhoC = cloud mass / CL² / fr fr the row's area share (below)
rhoTh = KS_THRESHOLD · meanCloud, KS_THRESHOLD = 2
gate: body has gas, its cloud holds more than one Sun of gas, rhoC ≥ rhoTh, and the body is not hot
(b.hotUntil > flipNow)
t_dep = KS_DEPLETION · max(1, life or 2·τ☉) · (rhoC / rhoTh)^(−0.4), KS_DEPLETION = 0.145, life = physLife (flips)
pend += min(gas, gas · dt · sfHeat / t_dep) / S.sun Suns set toward stars this sub-step
sfHeat is the share of the full rate its galaxy's heat allows (Chapter 4, Part 4.14): 1 by default, 0 outside every galaxy after reionization, f from galaxyHeat() inside one.
The gate asks the cloud for a Sun of gas, not the clump (ruling 2026-10-28: 57 % of all gas sat in clumps under one Sun inside clouds that could pay for stars). Density is the cloud's, not the cell's (2026-10-26: at cell scale every body formed stars, 82 % of all matter). The Kennicutt–Schmidt depletion (stars.js:100–109, 2026-10-27, after only 7 % of a level-5 universe's matter became stars) is what runs.
Worked case, desktop: physLife = 128 flips, so at the threshold t_dep = 0.145 × 128 = 18.6 flips; a cloud at ten times the threshold: 18.6 × 10^(−0.4) ≈ 7.4 flips. In one quarter-flip sub-step a pure-gas body there sets aside gas·0.25/7.4 ≈ 3.4 % of its gas.
In the game
Star formation is the gas haze turning into light. Before it, a body's points are its gas: large, faint, soft points in the data's color that add up to a glow where matter gathers and fade in the voids (scene3d.js:781–782). As a body's gas becomes stars, the share of its points drawn as stars follows its star share, 1 − gas/m (scene3d.js:762–763), so the filaments and clumps where the clouds are densest light first and the voids stay haze, as the book's reading says. The HUD's epoch line reads "Universe · expanding, …% of its final size · gas collapsing" until stars live, then counts them (app.js:2148). When the universe is half grown a banner says "Half its final size · filaments are forming along the scaffold, stars igniting in them · N shining" (app.js:672).
A tap in a galaxy that has no stars yet reads "a cloud of gas gathering round its well, no stars lit yet", followed by its heat mode, virial temperature and metals (app.js:2994–2995). Gas a supernova or a feeding well has just heated stays dark until it cools (Part 5.12), so a burst of supernovae stops star birth in the gas round it for about two flips.
The player changes star formation through the level (the law's count and the Sun, Part 5.3) and, less directly, the device: a phone runs the same share of the universe in fewer, wider cloud cells.
The scale model
The depletion time is a share of the life, so it is the same share at every level. The cloud is the same share of the universe on every device. The threshold is a ratio to the mean, so it needs no scaling.
Where the game and the theory differ
- The per-area weight is inert.
fr = max(0.05, rowArea(...)/rowAreaMean)(stars.js:175) applies only ifmatter.rowAreais set, and nothing in 8.3 sets it:sendOutMatter()computesrowAreaand discards it because the field is drawn equal-area (app.js:1227–1228). So fr = 1 always. BPT Part 6.10's "(per real area of the torus)" describes code that does nothing now. - The 1 % rule is not used.
EPS_FF = 0.01(stars.js:98) is exported and never read, and the header comment (stars.js:10–11) and the comment at stars.js:167–171 still describe the free-fall rule. - BPT Part 6.10 names 8 × 8-cell clouds; the game's cloud is a share of the universe, 8 × 8 cells on desktop and 2 × 2 on a phone (Chapter 4, Part 4.15).
Fixed numbers
| Number | Where | What it is | Kind |
|---|---|---|---|
| 0.145 | KS_DEPLETION stars.js:109 |
Depletion time at threshold, share of the life | PHYSICS (Kennicutt 1998; Bigiel et al. 2008; BPT Part 6.10) |
| 2 | KS_THRESHOLD stars.js:109 |
Threshold density over the mean | METHOD (named as the one choice) |
| −0.4 | stars.js:183 | Depletion exponent, 1 − 1.4 | PHYSICS (Kennicutt 1998) |
| 0.01 | EPS_FF stars.js:98 |
Star formation per free fall, unused | PHYSICS (Krumholz & McKee 2005; dead code) |
| 2 (×) | stars.js:183 | 2·τ☉ in flips when life is not given | BPT (Part 1.10, two flips a Tempo) |
| 1 | stars.js:183 | Floor on the life | METHOD |
| 8 | stars.js:144 | Default cloud side | METHOD (overridden by setCloud) |
| 10⁻⁶ | stars.js:166 | Floor on block density | METHOD |
| 0.05 | stars.js:175 | Floor on a row's area share (inert) | METHOD (dead code) |
| 1 | stars.js:182 | A cloud must hold more than one Sun of gas | BPT (Part 2.9: Jeans mass about one Sun) |