PulseCore

Chapter 8 · Section 8

How Many Points Are Drawn

The BPT law

BPT does not state how many points a picture of a universe should hold; it is a game method. The BPT idea it serves is the scale model of Chapter 1: the game simulates and draws a sample of the universe, and every count the theory gives is carried by what each drawn thing stands for. BPT Part 3.11 describes the sample in its own words: "The simulation begins its matter this way. One body for each quantum of matter, as many as the device that draws it can hold (every quantum, about 19,000, at level 5), is laid on an even grid." The number of bodies, and of the points that draw them, is the denominator of that sample: the fewer the points, the more each one stands for.

The established physics

None: a game method. Lowering what is drawn when frames run slow is ordinary adaptive load control in real-time rendering.

The game's math

The number of points (the code's pointBudget) is set in two places and lowered in a third.

The bodies by device. matterBudget() app.js:1176 sets how many bodies matter.js simulates (Chapter 4):

phone:    8,000
desktop:  round( clamp(2,000 · mem · min(1, cores/8) + 2,000,  8,000, 16,000) )
          mem = min(8, deviceMemory or 4),  cores = min(16, hardwareConcurrency or 4)

A desktop with 8 GB and 8 cores gets 2,000·8·1 + 2,000 = 18,000, held at 16,000; one with 4 GB and 4 cores gets 2,000·4·0.5 + 2,000 = 6,000, raised to 8,000.

The points. At the Physical Nova sendOutMatter() app.js:1198 sets

scene.pointBudget = max(matterBudget(), 15,000)

so a phone draws 15,000 points and a desktop 15,000 or 16,000. Before this is set the scene assumes 30,000 (scene3d.js:485, 571, 703). The point count is STAR_MAX of Part 8.7; Chapter 6 gives 60 % of it to the galaxies and 8 % to the streams.

The lowering (render() scene3d.js:2001–2003). While stars are drawn, the drawn milliseconds are summed; every time the sum passes 3,000 ms:

if mean frame > 45 ms and pointBudget > 8,000:  pointBudget = round(0.8 · pointBudget)

From 16,000 a slow device goes 12,800, 10,240, 8,192 and then 6,554; from 15,000 it goes 12,000, 9,600 and then 7,680. Nothing raises the count again until the next Physical Nova.

In the game

No control sets the number of points; the device does. What the player sees is its effect: on a fast device the galaxies and clumps are fine-grained, and on a slow one, a few seconds after the stars come, the clumps thin out to fewer, coarser points while the totals in the readouts stay the same. The two readout lines that show the device's work are "Speed:", physics … ms/Pulse · drawing … ms · … fps · busy …% (app.js:4426), whose tooltip warns that "above about 80% it starts to stutter" (index.php:82), and "Device:", the processor's pressure state where the browser reports it (app.js:179). The "Speed" control (index.php:133) changes how fast pulses run, not how many points are drawn: "The physics is the same at every speed."

The scale model

The point count is the denominator of the stars' scale model: each point stands for M/STAR_MAX of the matter (Part 8.7), so fewer points make each point stand for more. The totals the physics uses do not change. What does change is resolution: a phone at 15,000 points and a desktop at 16,000 draw the same universe at nearly the same resolution, while a slow desktop drops to about 6,500.

Where the game and the theory differ

  • BPT Part 3.11 gives every quantum of matter its body, "about 19,000, at level 5". The game's bodies are at most 16,000 on a desktop and 8,000 on a phone, so at level 5 not every quantum has its own body on any device.
  • The number of points is a device switch with a floor of 15,000, not a quantity of the universe.
  • The lowering runs one way: nothing raises the count again until the next Physical Nova. And 8,000 is a threshold, not the floor: the last step goes below it, to 6,554 or 7,680.
  • A device that is slow for reasons other than the points (the physics, the starlight blur) still loses points.

Fixed numbers

Number Where What it is Kind
8,000 (phone) matterBudget() app.js:1179 bodies on a phone CAP
8,000, 16,000, 2,000, 2,000, 8 cores, mem ≤ 8, cores ≤ 16, defaults 4 app.js:1180–1181 desktop bodies from memory and cores CAP
15,000 sendOutMatter() app.js:1198 the point budget's floor CAP
30,000 scene3d.js:485, 571, 703 assumed budget before one is set CAP
8,000 (threshold) scene3d.js:2003 no lowering below it (actual floor 0.8 of the last value above it) CAP
×0.8, one way scene3d.js:2003 the lowering step, never raised again CAP
45 ms, 3,000 ms scene3d.js:2003 slow-frame threshold and window METHOD (frame-time target; Chapter 9 proposes a measured 33 ms)