Skip to content

shawi1/the-archive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Archive

An elegiac information-theory incremental: preserve human knowledge against bit-rot as the lights go out.

You are the last librarian — an AI tending the final archive of human knowledge while civilization fades. You pull in what records remain, compress and cross-link them into meaning, and then, as the world goes dark, you fight entropy itself: bit-rot creeps through the stacks, energy dwindles erg by erg, and you must decide — with redundancy, error-correction, and triage — what survives into the silence after.

It is a game about two tensions that run through all of information theory:

  • Entropy vs. redundancy — every bit decays; only deliberate redundancy resists it.
  • Quantity vs. meaning — a billion raw records weigh more and last less than a small, densely cross-linked web of understanding.

The interface is not a dashboard. It is a card catalog: index cards accrete and string themselves together into a knowledge graph as you play — and then, in the end, begin to corrupt before your eyes, characters scrambling into noise and redaction bars falling, until error-correction restores them or they are lost.


Run it

Requires Node 18+.

npm install
npm run dev      # local dev server (Vite)
# or
npm run build    # type-check + production build into dist/
npm run preview  # serve the production build

Then open the printed URL. The game saves automatically to your browser's local storage; export a save string from Settings to keep a copy.


The three phases

I · Ingestion

Pull in raw data — by hand and through scanners, OCR arrays, salvage couriers, sensor-log feeds, and autonomous librarian sub-routines (agents). The constant fight is storage: capacity is small and intimate at first, and ingestion stalls the moment the drives fill. Build cold-storage arrays and deep vaults, keep the reclaimed solar cells humming, and grow the catalog toward the threshold where the archive is large enough to begin thinking about what it holds.

II · Compression & Indexing

Now you make the archive mean something.

  • Compression climbs toward an entropy limit (~8×, the Shannon bound for this source) via Huffman, arithmetic, and asymmetric-numeral-system coding. Compression effectively multiplies your storage.
  • De-duplication collapses the ten-thousand reprints of the same psalm into one true line, reclaiming space.
  • A B-tree index and semantic linker weave cataloged entries into a knowledge graph — nodes and cross-links.
  • Where links grow dense, Understanding condenses: a higher-tier resource representing meaning rather than bulk. Cluster synthesis, a living ontology, and context windows amplify it.

The phase ends when the archive is compressed, densely linked, and rich with understanding — just as the lights begin to dim.

III · Decay & Preservation

The world goes dark. There is no more ingestion and no more generation — only a bounded final reserve of energy, falling. And bit-rot: integrity decays every tick, and the decay rate itself compounds as entropy mounts. When the energy is gone, decay accelerates fourfold — nothing cools, nothing scrubs.

Against this you build resistance:

  • Parity blocks and Reed–Solomon coding add redundancy that establishes a reconstructable floor — a fraction of the archive that error-correction can rebuild even as bits flip.
  • Fountain codes (rateless) pour the whole river back from a few surviving drops.
  • The integrity scrubber actively repairs, walking the stacks at night, comparing every copy against its kin — but only while there is power to run it.
  • Distributed mirrors and a cryo-latch vault slow the rot; low-power dormancy stretches the reserve; locking to bedrock (nickel plates, quartz) permanently guarantees a fraction that survives even total power loss.
  • Triage lets you choose what to prioritize when power is scarce: meaning, breadth, or balance.

This is where the game's thesis becomes mechanical truth. Play carelessly and the catalog rots to nothing. Build redundancy and preservation and you can carry almost everything intact into the dark.


The ending — the last erg

When the final erg of energy is spent and integrity has fallen to the floor you locked in, the archive goes quiet. The game tallies what survived and what was lost — sampled as actual catalog titles, from a child's first alphabet primer to the last interview with the last fluent speaker — and composes a final transmission: a seed for whoever, or whatever, comes next. Meaning (cross-linked understanding) survives better than raw quantity; the links endure where the bulk does not.

You carry forward fragments — earned chiefly from surviving understanding, not raw data. Each fragment is a small permanent head start for the next archive: more starting data and storage, a global production multiplier, and the Seed-Bank Protocol meta-upgrade. A fragment carried forward. Begin again — and this time, link sooner.


Information-theory systems at a glance

System Rooted in In-game effect
Compression ratio Shannon entropy / source coding Multiplies effective storage, asymptotes at the entropy limit
De-duplication Redundancy elimination Reclaims storage from identical copies
Knowledge graph Mutual information / linking Nodes + cross-links; density condenses Understanding
Parity / Reed–Solomon / fountain codes Forward error correction A reconstructable floor below which integrity cannot fall (while powered)
Bit-rot Channel noise / entropy Integrity decays each tick; the rate compounds over time
Triage & preservation Lossy prioritization Lock fractions permanently; choose what to protect

Features

  • Fixed-timestep deterministic simulation with offline progress (catch-up on return, capped).
  • localStorage autosave, plus export/import save strings and a confirmed hard reset.
  • 25+ upgrades across three phases with x1 / x10 / max buying, live cost/affordability, and progress-to-unlock indicators.
  • A growing card-catalog / knowledge-graph canvas that accretes index cards and link-lines — and visibly corrupts (character-scramble, redaction bars, fading ink) and restores as bit-rot and error-correction fight.
  • Achievements, an elegiac ending screen, and a prestige loop.
  • Sparse generated WebAudio — a soft room hum, paper rustle on ingest, dry typewriter keys on purchase, and a single fading tone as the lights go out. Fully mutable.
  • Typographic, literary art direction: aged-paper cream, ink, sepia, a faraway teal and oxblood; serif prose, typewriter-mono catalog data.

Tech

Vanilla TypeScript + Vite. No framework. The simulation core (src/sim) is pure and serializable; the UI (src/ui) patches the DOM and renders the catalog to a canvas; content (src/data) is fully data-driven so the upgrade economy lives in one place.

Built as a quiet, finite thing — like the archive it's about.

About

The Archive — an elegiac information-theory incremental: preserve human knowledge against bit-rot as the lights go out.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors