Compare commits
3 Commits
fix/192-re
...
sprint/iss
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73832b286a | ||
| d5645fea58 | |||
|
|
db08f9a478 |
16
GENOME.md
16
GENOME.md
@@ -8,24 +8,32 @@ The Beacon is a browser-based idle/incremental game inspired by Universal Paperc
|
||||
|
||||
Static HTML/JS — no build step, no dependencies, no framework. Open `index.html` in any browser.
|
||||
|
||||
**5,128 lines of JavaScript** across 10 files. **1 HTML file** with embedded CSS (~300 lines). **1 Python test file** for reckoning projects.
|
||||
**6,033 lines of JavaScript** across 11 files. **1 HTML file** with embedded CSS (~300 lines). **3 test files** (2 Node.js, 1 Python).
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
index.html (UI + embedded CSS)
|
||||
index.html (UI + embedded CSS + inline JS ~5000L)
|
||||
|
|
||||
+-- js/engine.js (1590L) Core game loop, tick, resources, buildings, projects, events
|
||||
+-- js/data.js (944L) Building definitions, project trees, event tables, phase data
|
||||
+-- js/render.js (390L) DOM rendering, UI updates, resource displays
|
||||
+-- js/combat.js (359L) Boss encounters, combat mechanics
|
||||
+-- js/combat.js (359L) Canvas boid-flocking combat visualization
|
||||
+-- js/sound.js (401L) Web Audio API ambient drone, phase-aware sound
|
||||
+-- js/dismantle.js (570L) The Dismantle sequence (late-game narrative)
|
||||
+-- js/main.js (223L) Initialization, game loop start, auto-save, help overlay
|
||||
+-- js/utils.js (314L) Formatting, save/load, export/import, DOM helpers
|
||||
+-- js/tutorial.js (251L) New player tutorial, step-by-step guidance
|
||||
+-- js/strategy.js (68L) NPC strategy logic for combat
|
||||
+-- game/npc-logic.js (18L) NPC behavior stub
|
||||
+-- js/emergent-mechanics.js Emergent game mechanics from player behavior
|
||||
|
||||
CI scripts (not browser runtime):
|
||||
+-- scripts/guardrails.sh Static analysis guardrails for game logic
|
||||
+-- scripts/smoke.mjs Playwright smoke tests
|
||||
|
||||
Reference prototypes (NOT loaded by runtime):
|
||||
+-- docs/reference/npc-logic-prototype.js NPC state machine prototype
|
||||
+-- docs/reference/guardrails-prototype.js Stat validation prototype
|
||||
```
|
||||
|
||||
## Entry Points
|
||||
|
||||
28
README.md
28
README.md
@@ -105,10 +105,34 @@ This game is a **decision simulator** for our actual work.
|
||||
## Files
|
||||
|
||||
- `index.html` — Game UI
|
||||
- `game.js` — Core engine (tick loop, buildings, projects, events)
|
||||
- `js/` — Split runtime modules:
|
||||
- `js/data.js` — Game data, buildings, projects, constants
|
||||
- `js/utils.js` — Utility functions, formatting, helpers
|
||||
- `js/combat.js` — Combat system, corruption events
|
||||
- `js/strategy.js` — Strategy mechanics, decisions
|
||||
- `js/sound.js` — Audio system
|
||||
- `js/engine.js` — Core engine (tick loop, state management)
|
||||
- `js/render.js` — UI rendering, DOM updates
|
||||
- `js/tutorial.js` — Tutorial system
|
||||
- `js/dismantle.js` — Dismantling mechanics
|
||||
- `js/emergent-mechanics.js` — Emergent gameplay systems
|
||||
- `js/main.js` — Entry point, initialization
|
||||
- `DESIGN.md` — Full design document with narrative arc and mechanics
|
||||
- `README.md` — This file
|
||||
|
||||
## How the Code Is Organized
|
||||
|
||||
The game uses a modular runtime split across 11 files in `js/`. Each module handles a specific domain:
|
||||
|
||||
1. **Data layer** (`data.js`) — All game constants, building definitions, project specs
|
||||
2. **Core engine** (`engine.js`) — The tick loop, state transitions, event system
|
||||
3. **Rendering** (`render.js`) — DOM updates, UI state visualization
|
||||
4. **Gameplay systems** — `combat.js`, `strategy.js`, `dismantle.js`, `emergent-mechanics.js`
|
||||
5. **Support systems** — `sound.js`, `tutorial.js`, `utils.js`
|
||||
6. **Entry point** (`main.js`) — Bootstrap, event listeners, initialization
|
||||
|
||||
`index.html` loads all modules in dependency order. No bundler required.
|
||||
|
||||
## No Build Required
|
||||
|
||||
This is a static HTML/JS game. Just open `index.html` in a browser.
|
||||
@@ -117,4 +141,4 @@ This is a static HTML/JS game. Just open `index.html` in a browser.
|
||||
|
||||
*The Beacon is not about making the most paperclips.
|
||||
It is about keeping the light on for one person in the dark.
|
||||
Everything else is just infrastructure.*
|
||||
Everything else is just infrastructure.*
|
||||
@@ -3,20 +3,15 @@ _2026-04-12, Perplexity QA_
|
||||
|
||||
## Findings
|
||||
|
||||
### Potentially Unimported Files
|
||||
### Dead Code — Resolved (2026-04-15, Issue #192)
|
||||
|
||||
The following files were added by recent PRs but may not be imported
|
||||
by the main game runtime (`js/main.js` → `js/engine.js`):
|
||||
The following files were confirmed dead code — never imported by any runtime module.
|
||||
They have been moved to `docs/reference/` as prototype reference code.
|
||||
|
||||
| File | Added By | Lines | Status |
|
||||
|------|----------|-------|--------|
|
||||
| `game/npc-logic.js` | PR #79 (GOFAI NPC State Machine) | ~150 | **Verify import** |
|
||||
| `scripts/guardrails.js` | PR #80 (GOFAI Symbolic Guardrails) | ~120 | **Verify import** |
|
||||
|
||||
**Action:** Check if `js/main.js` or `js/engine.js` imports from `game/` or `scripts/`.
|
||||
If not, these files are dead code and should either be:
|
||||
1. Imported and wired into the game loop, or
|
||||
2. Moved to `docs/` as reference implementations
|
||||
| File | Original | Resolution |
|
||||
|------|----------|------------|
|
||||
| `game/npc-logic.js` | PR #79 (GOFAI NPC State Machine) | **Moved to `docs/reference/npc-logic-prototype.js`** — ES module using `export default`, incompatible with the global-script loading pattern. Concept (NPC state machine) is sound but not wired into any game system. |
|
||||
| `scripts/guardrails.js` | PR #80 (GOFAI Symbolic Guardrails) | **Moved to `docs/reference/guardrails-prototype.js`** — validates HP/MP/stats concepts that don't exist in The Beacon's resource system. The `scripts/guardrails.sh` (bash CI script) remains active. |
|
||||
|
||||
### game.js Bloat (PR #76)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user