# 欧陆 · 1914 (WWI 3D hex strategy game, Chinese UI) — project brief

## Goal
Hark has FULL ownership (user, 2026-11-26): drive the game to a finished product over many rounds. Run rounds back-to-back with no pause: self-assess, iterate, verify, deploy, start the next, until the day's quota runs out. User only gives occasional guidance. Plan: ROADMAP.md. Per-round technical notes: GAME_NOTES.md (R8–R19; R10/R11 sections missing). Handoff notes: HANDOFF.md.

## Live / deploy
- Cloudflare Pages `oulu-1914` → https://oulu-1914.pages.dev (account 8a3896db5a9372329e64697a63bcf775; Cloudflare API token saved in Hark, provider cloudflare).
- deploy.py (pip requests blake3). JWT: GET /accounts/{A}/pages/projects/oulu-1914/upload-token → /tmp/jwt_eu. Asset calls go to api.cloudflare.com. (trailing dot) so token injection does not overwrite the JWT. Sends no-cache _headers (Cache-Control no-store, CDN-Cache-Control no-store, Cloudflare-CDN-Cache-Control no-store, Pragma, Expires) — verify with curl -sI after deploy.
- If an agent edits site/ concurrently: cp -a site /tmp/site_deploy and deploy that snapshot.
- Latest deploy: R20 tutorial (2026-11-28).

## Standing user rules
- After EVERY completed task, reply with the live URL https://oulu-1914.pages.dev; latest version never cached.
- All game modes in ONE page (app.html, no navigation): 3D conquest (js/game3d/session.js), battles (js/battle/ui.js enter/exit), codex (SCREENS.cxv iframe). 2D game.html is legacy (战略版 2D · 旧版).
- Conquest base map = editor's Europe map rendered natively (js3d/worldview.js); editor map.html?edit=1 must keep working. Crisp, no blur/flicker, no black flash.
- Units true 3D (no sprite swap, no size pop), seamless loops, move starts immediately on tap.
- River hexes enterable but end the move; one-move crossing only via bridges.
- Nation colours flag-derived, low saturation, unified (js/game/palette.js). Side rings red/green; strategic dots gold/silver/red.
- Move speed ×1/×2 only. Generals use 23-rank ladder (js/app/ranks.js, rankLabel) — keep rankLabel in game/ui.js and conquest/ui.js.
- App screens fill four corners, small even margins. Gameplay-scaled map, every strait keeps a navigable hex, no buildings in water.

## Files
- site/: deployed tree. app.html main app; js/app (main, ranks, meta rewards/records, ach achievements+mail, settings unified store, loader), js/conquest (rules, state, ai, ui, history), js/data (conquest, events, campaigns_*, generals, theaters), js/game3d (session, main, scene_wv, overlay_wv, units), js/game (ui, scene, map 2D), js/battle (engine, ui, deploy, scenarios, scen_*), js3d (worldview, terrain editor, kit, anim). Loader inlined by tools/inline_loader.py (rerun when loader.css/js change).
- Tests: node tools/test_conquest.mjs; node r18/test_deploy.mjs; r14f/pages.py, r14f/edit.py; r19/final.py, r19/events.py; r14m/artseq.py, loopcheck.py, tapprof*.py, gpucost.py; balance r16/batch.mjs, r17/batch.mjs; chapter sims r18/sim_all.mjs, tune.mjs.
- Backups per round: bak_rNN/ (not in handoff zip). Screenshots shots/rNN_final/ (not in zip).
- tools/build_theater.py (campaign maps), tools/build_cq_map.py, bl/kit.py (Blender UI kit), portraits/ (general portrait pipeline), art/ (event art sources).

## Workflow
- Each round: dispatch a subagent with the ROADMAP section; it backs up to bak_rNN/, doesn't deploy, one swiftshader browser at a time on its own port, reports SAFE TO DEPLOY. Parallel agents get disjoint files.
- Before deploy: tests pass, pages.py/edit.py 0 errors. After deploy: curl -sI headers, update ROADMAP status, reply with URL + short Chinese summary.
- Playwright: pip install playwright && python3 -m playwright install chromium if missing; local http.server in site/.

## Open threads
- R20 tutorial DONE (js/app/tutorial.js; verify leftovers: tut.py @1366, cq_hints.py, edit.py, r19/final.py). R20b next: research/production. Old note: tutorial (first-launch offer, skippable, replay in settings; tut key via setSetting; guided path 战役→同盟国→施里芬→第1章→简报→部署→出征; battle steps watch window.__b.B, #info:not(.off), #end; conquest first-time hints via MutationObserver on #g-unit,#g-city,#g-event,#g-dip,#g-gens,#g-end .on), then research/production.
- R21 offline/save robustness/real-phone perf (power-save 30 fps in scene_wv); R22 audio; R23 English.
- Move start first frames still >50 ms on swiftshader; real devices unmeasured.
- Old round-7 3D files (scene3d.js, game3d/terrain.js, props.js, overlay.js, main_baked.js) — delete undecided.
