PulseCore

Chapter 7 · Section 9

Strings

The BPT law

BPT Part 1.1 lists Strings (⦚) among the Critical Fundamentals every pulse creates: "Geometric connections between discrete states that create spatial extension and serve as the backbone of dimensional architecture." The same part gives what strings make where they cross: "String × String → Force structures (attraction/repulsion dynamics)", "String × Time Crystal → Spacetime structures (geometric-temporal coupling)" and "Data × String → Matter structures (information-geometry binding)". BPT Part 4.5 likens the folds of rupture to "the computational analogue of cosmic strings or domain walls" (Vilenkin 1985).

The game's string is a filament of lit cells that "runs out of the void" (strings.js:2): "a thin, long, connected run of active cells that persists across pulses". Its definition, thin, long, connected and lasting, is a game method. It serves BPT's string as a connection between discrete states that gives the field extension: a chain of pulsers long against the field and one or two cells wide.

The established physics

None: a game method. BPT cites Vilenkin 1985 for cosmic strings, but the game's test is a shape test and uses no cosmic-string physics. The flood fill is standard.

The game's math

Finding (findStrings() strings.js:7). On the lit grid (grid, where a nonzero entry means a lit cell), the function takes each 8-connected component of N cells and computes:

span   = max(Δr, Δc) + 1
diag   = √(Δr² + Δc²) + 1
length = max(span, diag)              (always diag, since √(Δr² + Δc²) ≥ max(Δr, Δc))
width  = N / length
keep if N ≥ minLength, length ≥ minLength and width ≤ 2.2

Here Δr and Δc are the bounding box's extents. A string's center is the mean of its cells. Its "ends" are the bounding box's corners, (min r, min c) and (max r, max c) (strings.js:38).

Following (StringTracker.step() strings.js:46). A string now is the same as a known one if its center is within 4 + 0.15 · length cells of the known string's center (strings.js:50). A string is announced once, when t − born + 1 ≥ minAge = 3 (strings.js:54). A known string is dropped when it has not been seen for more than 2 pulses (strings.js:56).

In app.js (stepFinds() app.js:1941). The tracker steps on every second pulse and only once wells exist: stepFinds() returns before it when rings.sources is empty. Strings are therefore never sought before the first well. The minimum length scales with the field:

minLength = max(10, round(min(rows, cols) / 12))

Each fresh string adds one to ledger.strings, which the packet keeps as its census, and becomes a find. The first string of a universe pops; after that only tier 3 or better pops, and the rest are added quietly.

Rarity (stringRarity() universe.js:425):

length ≥ 96: Legendary; ≥ 48: Epic; ≥ 24: Rare; ≥ 16: Uncommon; otherwise Common

Worked case. At level 8, min(rows, cols) = 1024, so minLength = round(1024/12) = 85 cells. Every string found there is at least 85 cells long, so it is Epic or better. The tiers are fixed lengths and the minimum scales with the field, so on large fields strings are never Common, Uncommon or Rare. On a 128-cell field minLength = 11, and all five tiers can occur. Because the tracker steps every 2 pulses, "minAge 3" means the string was seen at two steps in a row, and "unseen for more than 2" means it was missing for two steps.

In the game

Strings are sought from the first well onward, in the universe epoch, and they are drawn wherever they live.

  • In 2D. Each live string is a gold line, rgba(255, 230, 120, 0.9), 2 pixels wide, from one end to the other (app.js:4103). Until the matter is drawn as stars, the string's own cells are also painted gold (255, 230, 120) on the field texture (app.js:407), so the filament itself shows on the 2D grid and on the torus skin.
  • In 3D. setStrings() (scene3d.js:1785) draws each string as a line from the center of the torus out to the string's center on the surface, in the hue of its rarity at opacity 0.8. The lines turn with the torus. They stay after the stars come, and are cleared at the return to the Source (app.js:2608).
  • The readout. The Void line counts them: "Void: N in · M out", where M is ledger.strings (app.js:2149), and its tooltip reads "The void's ledger: cells folded or collapsed into it, strings drawn out of it" (index.php:87).
  • The record. Each string is a find worded "String generated from the void · N cells long" (finds.js:62). With the notices on, the first of a universe would pop as "String" with the icon 〰. The run summary shows "〰 N strings · best Epic" (app.js:2797), and the Nova data panel links to the site's Strings page (index.php:402).

What the player paints sets how the field fills, and so where lit filaments form. The level sets their minimum length.

The scale model

Exact on the drawn field: no scale model. The minimum length is 1/12 of the field's shorter side, so a "string" is long relative to the drawn field, not in absolute cells.

Where the game and the theory differ

  • The header comment says a string's "Length is its cell count along the chain" (strings.js:3–4), and the comment at strings.js:30 calls it "the longer extent of its principal axis". The code measures the bounding box's diagonal plus one. For a straight filament these agree. For a curved one the cell count along the chain is longer than the diagonal.
  • A string's "ends" are the corners (min r, min c) and (max r, max c) of its bounding box, not the chain's true ends. For a filament running from upper right to lower left, the 2D line is drawn along the other diagonal of its box.
  • In 3D the line runs from the torus's center to the string's center, a spoke and not the filament.
  • The flood fill does not wrap across the torus seam (strings.js:24), so a filament crossing the seam is two components.

Fixed numbers

Number Where What it is Kind
12 (default minLength) strings.js:7 Default minimum (app.js overrides it) METHOD
10, 12 (min(rows, cols)/12) app.js:1942 Minimum string length: 1/12 of the field, at least 10 METHOD
2.2 strings.js:7 Greatest width, in cells per unit length METHOD
1 (+1 in span, diag) strings.js:31–32 Cell count of an extent METHOD
3 (minAge) strings.js:45, app.js:196 Pulses a string must live to count METHOD
4, 0.15 strings.js:45, 50 Matching radius METHOD
2 (forget) strings.js:56 Pulses unseen before a string is dropped METHOD
2 (t % 2) app.js:1941 Strings checked every second pulse METHOD
96, 48, 24, 16; hues universe.js:426–430 Length tiers and colors DISPLAY
1, 3 app.js:1948 Pop rule: first string, or tier ≥ 3 DISPLAY