Skip to content

Commit d672faa

Browse files
feat: wire move+found loops + 29x render perf (Sprint 1 integration)
Five parallel department workflows (disjoint files) + integrator wiring: - PERF (#4): viewport culling + LOD + dpr clamp + auto quality in render/* — render at zoom 8.2 dropped 33.9ms -> 1.17ms/frame (~29x), crushing the GitHub Pages heavy-load on weak/high-dpr devices. Drop-in, on by default. - FOUND (#1,#2): territory.js TREASURY_RESERVE lets a nation save past the 10g cost (gold reaches 12 by yr3, was stuck 0-2 forever); settlement.js spacing relaxed 8->5 + settleSys.lastFoundReason surfaced in game.js so a rejected tile explains why (water/too_close). - MOVE (#3): pathfind.js flow-field wired into the sim.js order block, replacing the greedy 6-angle deflector. A pinned-energy unit now routes around water and ARRIVES (48.6 -> 1.2 tiles). Real-play long-march completion + player-survival balance tracked in #8. - Cognition: agent order/hold/path state + bit-identical brain forward pass. - Statecraft: war-goals/peace-terms + treasury lever + war-tracking APIs (landed; wiring in the next slice). - Docs: ECONOMY_DESIGN.md (#6), AGENT_LIFE_DESIGN.md (#7), SPRINT_PLAN.md. Headless invariant ALL PASS (pop 3200, gen 27). CI gates every push. Fixes #1 Fixes #2 Fixes #4 Refs #3 Refs #8 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 87a13d6 commit d672faa

18 files changed

Lines changed: 1058 additions & 70 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Thumbs.db
66
# editor / OS cruft
77
.vscode/
88
.idea/
9+
.serena/
910
# scratch workflow / playtest scripts (not part of the game)
1011
test/_*.js
1112
test/_*.mjs

AGENT_LIFE_DESIGN.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# AEON — The Free Guy Principle: every soul has an inner life
2+
3+
_North-star design (drlor, 2026-06-13): "give them feelings, hunger, community needs, personal
4+
behaviors... we want them basically living in the city like Free Guy. We just can be a leader in
5+
places, as survival mode." Tracked as issue #7._
6+
7+
## The vision
8+
AEON's one true differentiator: **every creature already thinks with a real, evolving neural net.**
9+
The goal is to make that FELT — each NPC is a background character with a life of their own (like the
10+
NPCs in *Free Guy*): they get hungry, afraid, content, lonely; they have personal habits and bonds;
11+
they pursue their own little goals. **The player is a LEADER among them (Survival mode), not a
12+
puppeteer** — you set direction (policies, orders, found cities) and the populace lives in response.
13+
The drama is emergent, not scripted. (Creative/god mode is the sandbox exception.)
14+
15+
## Inner state (per agent) — the two-layer mind, deepened
16+
**Layer 1 — needs & feelings (survival brain, already partly here):**
17+
- **Needs:** hunger (energy), thirst, rest/fatigue, safety, and **belonging** (social contact with
18+
one's people). Each has a level; unmet needs drive behavior and hurt the agent over time.
19+
- **Emotions/mood:** an affect state DERIVED from needs + recent events — content (fed & safe),
20+
fear (under threat / starving), anger (attacked / rival near), grief (lost kin), joy (birth, plenty).
21+
Mood biases the NN's choices and is VISIBLE.
22+
- **Personality:** genome-derived tendencies (bold/timid, social/solitary, forager/homebody,
23+
curious/cautious) so two well-fed agents still behave differently — watching ONE is interesting.
24+
- **Relationships & memory:** kin and tribe bonds; light memory of recent events (who fed/attacked me,
25+
where food/danger was) that colors decisions.
26+
27+
**Layer 2 — community (culture/social):** belonging, shared language/religion/customs (already
28+
emerging via culture/anthropology) become real social NEEDS — agents want to be near their people,
29+
participate, and suffer when isolated (ties to the city-needs economy, issue #6, and tribe fission).
30+
31+
## Wire it into the NN (cognition + integrator)
32+
- Add **senses** for inner/social state (own mood, nearest-kin direction, crowd density, belonging
33+
level) so the brain can act ON feelings.
34+
- Feed needs/mood as **modulators** of existing drives (a fearful agent flees & shares less; a content
35+
one explores & breeds). Keep it cheap (no per-agent heavy loops) and keep evolution intact.
36+
37+
## Surface it (frontend + integrator) — legibility is the feature
38+
- **Inspect an NPC** → a little "life card": mood (emoji/face + color), needs bars (hunger/thirst/
39+
belonging), current activity WITH A REASON ("foraging — hungry", "fleeing — afraid", "heading home"),
40+
closest bonds, age/generation. This is the Free Guy moment: you click a dot and meet a person.
41+
- Subtle world tells: expression/posture, occasional thought/▴ emote, mood-tinted shading (cheap LOD).
42+
43+
## Player-as-leader (survival)
44+
You lead a people, not micro-pawns: policies bias the population's feelings/behavior; orders/found are
45+
deliberate interventions; the populace otherwise lives autonomously. Success = a thriving, content
46+
nation; failure = starvation, fear, collapse (the fail-state work). Legible cause→effect throughout.
47+
48+
## Sequencing
49+
A COGNITION-led sprint (brain.js/agent.js inner state) + FRONTEND (life-card UI) + INTEGRATOR (senses
50+
wiring + inspector), AFTER the current verb-wiring wave. Pairs with the city-needs economy (#6). Balance
51+
per the design law ([[feedback-balance-and-ux]]): feelings must MATTER without being punishing, and
52+
must be readable.

ECONOMY_DESIGN.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# AEON — Economy Design: Costs & City Needs
2+
3+
_Design spec for the "not-too-easy" depth layer (drlor, 2026-06-13). Tracked as issue #6.
4+
Implemented in the coremech sprint AFTER the verb-wiring integration wave (single-writer settlement.js)._
5+
6+
## Principle
7+
Mechanics must be **neither too easy nor too hard**, and **interface/controls must make every
8+
cost and need legible**. Cities are not plant-and-forget: founding and building **cost currencies/
9+
resources**, and every city carries **ongoing needs** it must meet or it declines. This is the
10+
pressure that turns a sandbox into a game with real decisions.
11+
12+
## Currencies & resources (mostly already in `tribe.stock` + `tribe.gold`)
13+
`gold` (treasury) · `wood` · `stone` · `ore` → refined `metal` · `food`.
14+
15+
## Costs (the sinks)
16+
| Action | Cost | Notes |
17+
|--------|------|-------|
18+
| Found city | gold + settler pop | **scales per city** (city N costs more) so expansion is a decision, not a reflex |
19+
| Granary | stone + food | +food / growth (FUNC-BUILDINGS) |
20+
| Walls | stone | +defense (feeds conquest `s.defense`) |
21+
| Barracks | wood + metal | lets you train soldiers you control |
22+
| Market | gold + wood | +gold |
23+
| Library | stone + gold | +research |
24+
| Train soldier | gold + metal | partially exists (`trainSoldier`) |
25+
26+
## City NEEDS (ongoing — unmet ⇒ the city suffers)
27+
- **Food:** city food income ≥ pop, else it shrinks / starves (formalize per-city food balance; the
28+
founding food-magnet is the seed of this).
29+
- **Water:** city-level water access (adjacent water or a well building); extends the agent thirst need.
30+
- **Upkeep:** every city and unit costs gold/yr. If the treasury can't pay → unrest, then disband.
31+
This is the sink that makes gold income matter turn-to-turn.
32+
- **Supply / connection:** a city disconnected from national territory is **isolated** → reduced
33+
output and revolt risk (hooks into TRIBE-FISSION / secession).
34+
- **Stability:** unmet needs or overexpansion → unhappiness → revolt / secession.
35+
36+
## Balance knobs (target feel)
37+
- 2–3 cities comfortable on default play; 6+ requires deliberate economy management.
38+
- Needs create **failure pressure** (you can lose a city, even your nation) but recoverable — not punishing.
39+
- Costs scale so the player must choose between tall (few strong cities) and wide (many needy ones).
40+
41+
## Interface / controls (REQUIRED — legibility is the feature)
42+
- City inspector shows **each need** with sign + color: `food +3 / −1`, `upkeep −4g`, `water ✓`,
43+
`supply ✓/✗`, `stability 72%`.
44+
- Build queue shows **costs up front**; an unaffordable item shows the **missing resource by name**
45+
("need 2 stone").
46+
- A city in trouble surfaces a **toast** ("Rondisad is starving") so the player can act.
47+
48+
## Dependencies
49+
Builds on the now-working **Found** verb (#1, #2) and treasury reserve. Pairs with FUNC-BUILDINGS,
50+
GHOST-CITY, FOUND-SUSTAIN, EMPTY-CITY-GATE from SPRINT_PLAN.md.

0 commit comments

Comments
 (0)