Log inGet started
World

Deep Field

Branchmain
Branchesmain
Commit97b82cdc4f

README.md

df_rules

Every rule of Deep Field that is arithmetic rather than behaviour. Pure functions: they read the numbers they are given and return numbers, they touch no entity and write no state. DeepFieldGame is the only caller.

local Rules = require("game.df_rules")

Attention

Rules.attentionDelta(brightness, depth, dt) -- + accrues, - bleeds
Rules.ATTENTION.warnAt                      -- 0.72; past this the lamp gutters

Gain rises with the cube-ish of brightness and with depth (ATTENTION.depthGain per stratum); bleed only happens near the bottom of the dial. The dive ends at 1.0.

Confidence

Rules.confidenceBand(c)   -- "certain" | "probable" | "glimpsed"
Rules.CONFIDENCE.glance   -- 0.30
Rules.CONFIDENCE.sure     -- 0.70

Confidence is the BEST Core.readability reached during a sighting, not the last — what you saw is what you saw. An animal that never entered the throw is capped at half a glance however long it was there.

What rises next

Rules.weight(spec, depth, brightness, unlocked, journal, burned)
Rules.pick(specs, depth, brightness, unlocked, journal, burned, rng?)
Rules.interval(brightness, depth, rng?)
Rules.window(spec, brightness)
Rules.isApex(spec)

Weight is zero outside the species' depth band or in a locked stratum. Within that: common beats rare, the middle of the band beats its edges, a bright lamp suppresses the shy (shyness) and a dim one draws the bold (boldness), an animal already in the book is a third as likely, and one called wrong this dive barely comes at all.

rng is there so a test can hand in a fixed roll.

Progression

Rules.unlockedFor(identifiedCount)  -- { fringe = true, ... }
Rules.newlyUnlocked(before, now)    -- the strata that just opened
Rules.depthCeiling(unlocked)        -- how far the line may go
Rules.countIdentified(journal)

Committing

Rules.resolve(guessId, sighting, state) -- the whole outcome, as a table
Rules.applyToJournal(journal, result, depth)

resolve decides nothing about the world; it only says what happened. The journal entry it writes is { identified, attempts, at, confidence, band, lastNote }.

Slice owner: core-loop.