diff --git a/DONE.md b/DONE.md index 1dcc214..daedf22 100644 --- a/DONE.md +++ b/DONE.md @@ -1127,3 +1127,16 @@ marquee text, hand-authored tree shapes) are content, not grading. - [x] Align the body-camera timeline to its mockup. - [x] Align scene lighting, fog, and post-processing for `venue_overview` and `late_night_avenue`: lowered the morning sun to 34° (`sun_yaw` is now a phase value), warmed and thickened the day haze, raised the night glow, and brightened the street albedo. `judge` moved `01-venue-overview` to **match** (0.90) and `05-late-night-avenue` from diff to **review** (0.10); `compare` stays 11 good / 0 bad. - [x] Fix the body-camera REC/clock overlay overlapping the shift/rep/crowd status in the top-right HUD. + +## Documentation Consistency + +Completed 2026-11-01. `PLAN.md` was compacted from the historical implementation log into a +product/design plan (674 → 187 lines): escalation, NPC/venue content and design constraints stay, +while the completed control/rendering pass specs were folded into a short Presentation and +Controls section. `README.md` now reflects the implemented venues, Blender/v2 asset pipeline, the +custom test runner, the Web target, the current release state, and the capture smoke. The +architecture's version, runtime-art loader, asset/tooling blocks, Gitea CI/build/publish pipeline, +Web deployment and release artifact list were brought up to date. `MEMORY.md` was cleaned of +obsolete uncommitted/active-pass claims and now points at the current follow-ups. + +- [x] Re-check `PLAN.md`/`MEMORY.md` against the current build, update `README.md` and `docs/architecture.md`, and compact the historical PLAN sections. diff --git a/MEMORY.md b/MEMORY.md index c67f829..d93f599 100644 --- a/MEMORY.md +++ b/MEMORY.md @@ -4,8 +4,11 @@ Session memory for durable decisions, state, and gotchas. Keep concise, remove o ## Decisions -- The visual-alignment path/loader/verification work is complete and recorded in `DONE.md`; - the only open visual task is scene lighting/fog, held until the current realism pass lands. +- The visual-alignment path/loader/panel/HUD work and the realism lighting pass are complete and + recorded in `DONE.md`; remaining visual items are the realism follow-ups in `TODO.md`. +- `PLAN.md` is a compact product/design document, not an implementation log. Historical control + and v0.3.0 specs were folded into its Presentation and Controls section; put new step-by-step + work in `TODO.md`, not the plan. - Editable Blender sources under `assets/models/blender_src/` are gitignored and untracked (46 `.blend` files removed from the index on 2026-11-01); the `.gdignore` marker stays tracked. - `screen_designs.py judge` default `google/gemini-2.5-flash-lite` worked on 2026-11-01 @@ -55,27 +58,12 @@ Session memory for durable decisions, state, and gotchas. Keep concise, remove o ## Handoff (read this first) -- **Status + active passes (2026-11-01, moved from `TODO.md`):** v0.6.0 shipped — the Blender - character/gear/prop library is integrated, AO maps are baked and wired, and the environment - textures are lifted to 1024² with normal maps (see `DONE.md`). Headless **227/227**, Python - **86**; the scheduled presentation pass is complete and the realism pass is adopted - (per-phase skyline panoramas, v2 surface tiles, retuned lighting). Active in `TODO.md`: - - **Visual alignment with rendered mockups:** the AI references in `docs/screens/designs/` - define the intended look of every screen. The pass reorganizes generated-image storage, - loads the proposed UI/scene art at runtime (`src/game/ui/art.gd`, `assets/images/`), and - aligns the selection screens, HUD, and scene visuals with those mockups — verified with - `screen_designs.py compare` + `judge`. - - **Realism pass** (plan: `PLAN.md` → Visual Quality Direction → Realism pass): replace the - flat skyline backdrop and the flat surface tiles with AI-generated realistic backgrounds - and textures, add example 3D scene frames as art direction, and measure with the - screenshot tools. Rule: never overwrite an existing image — new outputs get new paths - (`next_free_path` -vN suffix). Raw → `assets/textures/ai/v2/raw/` (gitignored); candidates - → `assets/textures/ai/game_ready/v2/` (gitignored pool, only validated picks tracked, - ADR-0014); scene refs → `docs/screens/concepts/`; trials → `docs/screens/realism//`. - Realism report 2026-11-01-v2 mean judge scores: backdrop 2.6 → 3.6 (v2 day + night - skyline) → **4.0** (v2 day + dusk skyline for the Evening phase); texture detail 1.2 → - 1.6–1.75; overall 1.6 → 2.0. Scores swing ±1–2 between runs (trend only); the - `characters` score moved 3.0 → 1.0 with identical NPCs, showing the noise. +- **Status (2026-11-01):** v0.6.0 is released; the post-v0.6.0 realism and visual-alignment + work is merged and pushed to `origin/main`. Headless **227/227**, Python tooling **86/86**, + `tools/check_screenshots.sh` **11 good / 0 bad**, `screen_designs.py judge` **7 match / + 4 review / 0 diff**. `PLAN.md` was compacted, and README/architecture were synchronized with + the current controls, asset pipeline, CI, and release artifacts. The historical notes below + remain useful for implementation gotchas; for current tasks, use `TODO.md`. - **Phase 2 — AI texturing (this agent, DONE 2026-11-01).** Phase 1 assets were already in the tree (untracked) and are preserved. Generated six seamless AI @@ -89,8 +77,8 @@ Session memory for durable decisions, state, and gotchas. Keep concise, remove o (writes `assets/textures/npc/palette.json` via `model_pipeline.dominant_colors`). `write_slot_textures()` now skips the albedo for slots with an AI override (normal/ORM stay procedural). Blender `build` re-run: GLB audit ok, 1204 tris / - 2488 verts, AI albedo embedded for cloth+pants. **Do not commit yet** — Phase 1 - files are uncommitted; coordinate the commit with the Phase 1/3 agents. + 2488 verts, AI albedo embedded for cloth+pants. Phase 2 completed and shipped with + the v0.6.0 asset library. **Import concurrency:** a parallel agent is running `timeout 300 godot --headless --editor --quit --path .` and then checks `assets/models/generated/npc_base.glb.import` — treat that as the canonical @@ -118,8 +106,6 @@ Session memory for durable decisions, state, and gotchas. Keep concise, remove o `game_ready` textures, generated models, NPC maps), and refreshed dev-status / not-yet lines; `docs/architecture.md` Level 2 now lists `npc_pipeline.py` + `asset_pipeline.py` and the confirmed-asset locations. - **Foreign, left uncommitted:** a TODO section "Bug Fix NPCs walking backwards" - from another agent — do not touch or commit it. - Repo: `/run/media/system/DATA/Documents/06-games/security-game` (also reachable at `/var/home/zwitschi/Documents/06-games/security-game`). Godot: `~/.local/bin/godot` (4.3.stable). @@ -239,7 +225,7 @@ Session memory for durable decisions, state, and gotchas. Keep concise, remove o adopted (custom runner covers it without an editor plugin). - Do not re-open `override_access`. Do not bind wand to `W`. Do not remove the radio easter egg. -## Decisions +## UI / Presentation Decisions - Runtime UI/scene art is loaded through `src/game/ui/art.gd` (`assets/images/ui/` then `scenes/`); missing files return null so panels keep procedural fallbacks. - Screen mockups with baked-in controls are used as backdrops plus an opaque `ArtPanel` cover, not as clickable full-screen skins. @@ -251,7 +237,7 @@ Session memory for durable decisions, state, and gotchas. Keep concise, remove o ## Current State -- **v0.3.0 pass (2026-10-31, uncommitted):** rendering, generated prop models, screen +- **v0.3.0 pass (2026-10-31, historical; shipped):** rendering, generated prop models, screen catalogue, aim-free selection. See ADR-0011 (selection) and ADR-0012 (materials/props). - `src/game/materials.gd` (`SurfaceMaterials`) is now the single source of surface recipes + `configure_environment()`. `GameManager.PHASE_LIGHTING` gained @@ -301,7 +287,7 @@ Session memory for durable decisions, state, and gotchas. Keep concise, remove o `carried_items` per spawn (seeded). Tests in `src/test/tests/test_access_loadout.gd`. - Wand shortcut is **`C`**, not `W` (`W` is walk). `radio_emergency` input map no longer includes W. `hud.controls` / `hud.screen_first` updated. -- Control pass (in tree, uncommitted, smoke-tested): cone focus via `src/game/npc_focus.gd`, +- Control pass (historical; smoke-tested): cone focus via `src/game/npc_focus.gd`, accel/decel, gravity only airborne, `input_locked` freeze, Esc no longer on the guard. `NpcAvatar` in group `npc`; neck/hair/eyes/shoes; blue focus circle + `Label3D` name; `set_focus_visual`. `src/game/ui/action_radial.gd` doughnut (LMB/Space open, A/D/arrows, Space/click confirm, Esc/RMB @@ -313,7 +299,7 @@ Session memory for durable decisions, state, and gotchas. Keep concise, remove o awning, and marquee are visible; step treads rise toward the door; `ShiftCoordinator` pulls the event scheduler once per simulated second (was every physics frame → >1200 NPCs in seconds); `GameManager.MAX_LIVE_NPCS = 16` caps live avatars. -- **Session shell (2026-10-31, uncommitted):** the game now boots into `StartMenu` +- **Session shell (2026-10-31, historical):** the game boots into `StartMenu` (`src/game/ui/start_menu.gd`, layer 20) instead of a live shift. `GameManager._on_venue_selected()` builds the scenario and calls `_start_shift()`; `_shift_running` gates input and `_refresh_freeze()`. Esc with nothing open now pauses (`PauseOverlay`, layer 18) → resume / restart / settings / @@ -328,7 +314,7 @@ Session memory for durable decisions, state, and gotchas. Keep concise, remove o `StaticBody3D` with per-tread `BoxShape3D` colliders; marquee `font_size` 160 / outline 24; focus circle (blue disc in front of the face) + name tag 48px; `NpcAvatar.ephemeral`/`lifetime_s` despawns routine traffic (authored events stay). Guard spawn height verified on the landing (guard_y=0.84). -- **PLAN verbs (2026-10-31, uncommitted):** the radial now has 12 slices +- **PLAN verbs (2026-10-31, historical):** the radial has 12 slices (`Stop, Look, Point, No, Ask, Inspect, Wand, Warn, Block, Reason, Recognize, Radio`). `eye_contact` reuses the Level 1 reaction table via `_apply_interaction`. Recognition is a player decision: `NPCController.player_recognized` + `IncidentRecorder.add_access_evidence`, and @@ -576,9 +562,9 @@ Session memory for durable decisions, state, and gotchas. Keep concise, remove o - Persistence tests write into the real `user://shift_results.json` (harmless local pollution of the demo history). - macOS export required `rendering/textures/vram_compression/import_etc2_astc=true` in `project.godot` (universal build demands ETC2 ASTC enabled). - Joke Shop `door_staff_lines` are logged through `GameManager` (inspect / wand / refuse). They are not a separate dialogue UI. -- Access loadout is implemented in the working tree (see Current State); do not re-fix `override_access` as if it were still unread. -- `Save.SETTINGS_FILE` is declared and unused; no mouse-sensitivity or pause menu yet. -- Headless suite is **77/77**; the windowed focus/radial smoke passes. Remaining visual follow-ups are at the top of `TODO.md`. +- Access loadout is implemented; do not re-fix `override_access` as if it were still unread. +- `Save.SETTINGS_FILE` is declared and unused; settings persistence goes through `Save.load_settings()` / `save_settings()`. +- Headless suite is **227/227**; the windowed smokes, screenshot compare, and judge pass. Remaining visual follow-ups are in `TODO.md`. - Typed spawn signal extra args: handlers must accept the 4th `event: Dictionary` or Godot will not call them (`test_shift_coordinator_runs_a_shift` failed until `_on_spawn` took four args). - GDScript inference trap that broke the main scene: a `var` typed as a base class (`radial: CanvasLayer`) exposes script members as `Variant`, so `var x := radial.is_open` is a @@ -593,27 +579,25 @@ Session memory for durable decisions, state, and gotchas. Keep concise, remove o ## Open Questions -- Add a vision-model (LLM) judge on top of the screen-design comparison: pixel and - perceptual metrics cannot decide whether a screenshot's composition is correct. - Whether the responder avatar should be playable/controllable or purely scripted. - Localization target languages beyond English. - macOS notarization approach for broad distribution. -## Plan vs code (re-evaluated) +## Plan vs code -On local `main` (6 commits not on origin): v0.2.1 packages, ADRs 0007–0010, asset pipeline wired to -`assets/textures/ai/game_ready/`, screenshots refreshed. - -Uncommitted: `AccessLoadout`, control pass (cone, ring, radial, NPC face, named input actions), -and boot/spawn fixes. Headless 77/77; windowed smoke passes. Access-artifact and control-pass -sections moved to `DONE.md`. - -Still in `TODO.md`: world follow-ups (guard float, step colliders, skyline asset, marquee size); -session shell; leftover PLAN verbs; crowd rubberneck; emergency aftermath; body-cam replay; -sit/photo/film poses; real crowd audio; Joke Shop/Studio extra events; PLAN.md says GUT/GitHub. +`PLAN.md` describes intended design; `README.md` and `DONE.md` describe what shipped. As of +2026-11-01 the playable build covers all three venues, controls, access/radio/evidence/review, +the Blender asset library, the realism pass, and the visual-alignment pass. `TODO.md` holds only +the realism follow-ups and optional future ideas. The project uses a custom headless runner, not +GUT, and Gitea Actions, not GitHub Actions. ## Uncommitted Workstreams -- A separate realism pass is editing `PLAN.md`, `README.md`, `.gitignore`, `src/game/materials.gd`, `tools/scene_concepts.py`, `tools/test_scene_concepts.py`, `src/test/capture_realism.gd`, `assets/textures/ai/game_ready/v2/`, `docs/screens/concepts|realism/`, and regenerated Blender planter/tree assets. Do not commit or revert these while that pass is active; verify game changes in a clean `git worktree` at HEAD when its unimported textures break parsing. +- **NPC fidelity pass (2026-11-01, active):** editing the Blender NPC/gear/prop library + (`assets/models/blender/` + `manifest.json`), `src/game/game_manager.gd`, `materials.gd`, + `capture_realism.gd`, the door/flashlight and Blender tests, `tools/blender_assets.py`, + `tools/scene_concepts.py`, `tools/test_blender_assets.py`, the affected screenshots, and the + new NPC portrait concepts. Do not commit or revert these until the pass finishes; verify game + changes in a clean `git worktree` at HEAD. diff --git a/PLAN.md b/PLAN.md index d58f9b7..5b40706 100644 --- a/PLAN.md +++ b/PLAN.md @@ -2,673 +2,186 @@ ## Premise -You play a private security guard stationed at the top of the steps outside a fictional building on Hollywood Boulevard. Your job is to keep the entrance and steps clear while dealing with tourists, trespassers, performers, protesters, intoxicated pedestrians, and occasional determined intruders. +You are a private security guard working the entrance of a fictional Hollywood Boulevard building. You keep the steps and doors clear, check who is allowed in, and deal with tourists, performers, influencers, confused visitors, intoxicated pedestrians, trespassers, people in mental-health crisis, and rare determined threats. -The game is about **judgment, communication, and escalation management**, not simply attacking anyone who approaches. +The game is about **judgment, communication, access verification, and proportionate escalation**, not about attacking everyone who approaches. ---- +## Design Pillars + +- **Lowest effective response wins.** Observation, a gesture, or a clear direction should solve most situations. +- **People are not labels.** Clothes, props, credentials, and behavior tell the player what they need; internal NPC types stay in the debug overlay. +- **Every decision has a record.** Incidents, evidence, radio reports, and outcomes feed the shift review. +- **Emergency help is a last resort.** Responders handle crises the guard cannot safely manage; calling them has costs. +- **Readability beats raw fidelity.** The GL Compatibility renderer, clear silhouettes, the focus ring, and the HUD stay legible. ## Core Gameplay Loop -1. Watch the stairs, entrance, and sidewalk. -2. Identify why each person is approaching. -3. Give verbal warnings and directions. -4. Escalate only when necessary. -5. Call for assistance in rare dangerous situations. -6. Maintain public safety, building security, and your employer’s reputation. +1. Watch the entrance, steps, queue, and sidewalk. +2. Work out why each person is approaching. +3. Use a gesture or short direction before escalating. +4. Verify authorized access when the venue requires it. +5. Escalate only when the person refuses, forces entry, or presents a genuine threat. +6. Record the incident and call for help when it is justified. +7. Review the shift: safety, judgment, accuracy, crowd reaction, and reputation. -People should not all behave the same way. Some are confused, some are rude, some are filming, and a very small number are deliberately attempting to enter. +A shift lasts roughly 10–15 minutes. Most people comply when approached calmly. -## Authorized Access +## Access and Verification -Some people are authorized to enter the building. The security guard must verify them before granting access. +Some people are authorized to enter. The guard may admit them by: -An authorized person can be admitted if either: +- recognizing a person the guard already knows; or +- verifying a venue-appropriate artifact: wristband, ID, ticket, credential, or guest list. -- The guard already knows and recognizes them. -- The person presents a valid event or staff wristband, which the guard checks before opening the entrance. +Artifacts can be valid, expired, counterfeit, mismatched, missing, or ambiguous. The player inspects the details the venue asks for instead of judging by appearance. -The wristband check should require the player to inspect details such as its color, pattern, date, or event marking. NPCs may have valid wristbands, expired wristbands, counterfeit wristbands, or no wristband at all. +Decisions are admit, redirect, hold, or refuse. Incorrectly denying an authorized person hurts reputation; admitting an unauthorized person is a security failure. Recognition is a player decision and is recorded as evidence. -The player should avoid relying on appearance or assumptions. A familiar person may still need verification if the building’s current policy requires it, while an unfamiliar person with a valid wristband may be admitted after a successful check. Incorrectly denying an authorized person harms the building’s reputation; admitting someone without authorization creates a security failure. +## Escalation Model ---- +| Level | Player response | Intent | +| --- | --- | --- | +| 0 | Observation | Watch harmless behavior; intervene only when needed. | +| 1 | Simple deterrence / polite direction | Raise a hand, make eye contact, point to the sidewalk or check-in area, shake the head, give a short instruction. | +| 2 | Formal warning | State the rule and ask for compliance; optionally arm the body camera. | +| 3 | Blocking and positioning | Stand between the person and the door, secure the entrance, keep distance and an escape route, ask for their reason. | +| 4 | Radio for security assistance | Request a second guard, supervisor, building management, or other support. | +| 5 | Emergency response | Hold and confirm the emergency call only for an immediate threat such as a weapon, assault, forced entry, or serious threat to occupants. | -## Escalation System +At Level 2 an NPC may leave, argue, pretend not to understand, record the guard, call someone, or move closer. At Level 3 the goal is to deny access **without starting a fight**. Physical contact creates legal, employment, and public-relations consequences. -### Level 0: Observation - -The guard watches NPC behavior and decides whether intervention is needed. - -Examples: - -- Someone taking a photograph from the sidewalk -- A tourist reading a map -- A person sitting briefly on the edge of the steps -- Someone approaching the entrance with a delivery package - -The player should avoid interrupting harmless behavior. Unnecessary confrontations reduce the guard’s performance rating. - ---- - -### Level 1: Simple Deterrence and Polite Direction - -The player can begin with a simple, nonverbal deterrent before speaking. These actions are quick and low-pressure, making them useful when someone is only approaching the steps casually or appears unsure. - -Possible actions include: - -- Raise an open hand to signal “stop” or “please wait” -- Make eye contact -- Point toward the public sidewalk -- Gesture toward the wristband-check area -- Shake the head gently when someone approaches a restricted entrance - -If the person continues, the player uses a short verbal prompt. - -Example commands: - -- “Please keep the stairs clear.” -- “The entrance is for authorized guests only.” -- “You can’t remain here.” -- “Please move back to the sidewalk.” - -At this stage, most NPCs comply immediately. - ---- - -### Level 2: Formal Warning - -If the person remains on the steps or continues toward the entrance, the player issues a formal warning. - -Possible dialogue: - -> “This is private property. You have been asked to leave. Please move away from the entrance now.” - -The player may activate a visible security light or body camera. This creates a record of the interaction and can discourage repeat offenders. - -At this level, the NPC may: - -- Leave -- Argue -- Pretend not to understand -- Start recording the guard -- Call someone else -- Move closer to the door - ---- - -### Level 3: Blocking and Physical Positioning - -The guard moves into a defensive position between the NPC and the building. - -Gameplay actions: - -- Stand in front of the entrance -- Point toward the public sidewalk -- Lock or secure the door -- Request the person’s reason for entry -- Keep distance while maintaining a clear escape route -- Use a flashlight or radio warning tone at night - -The player should not automatically shove or strike people. Physical contact creates legal, employment, and public-relations consequences. - -This level is about **denying access without creating a fight**. - ---- - -### Level 4: Radio for Security Assistance - -If the person refuses to leave, attempts to force the door, threatens staff, or repeatedly returns, the player uses the radio. - -Possible assistance: - -- A second security guard -- Building management -- Police dispatch -- Nearby security personnel - -The radio call takes time, so the player must continue monitoring the person while waiting. The player can choose what information to report: - -- Location -- Description -- Behavior -- Whether weapons have been seen -- Whether anyone is in immediate danger - -Incorrect or exaggerated reports damage the guard’s credibility. - ---- - -### Level 5: Emergency Response - -This is reserved for immediate threats, such as: - -- A person displaying a weapon -- An attempted forced entry while people are inside -- An assault on the guard or another person -- A serious threat against occupants -- A violent struggle that cannot be safely disengaged - -The player presses and holds a clearly marked **Emergency Radio** button. A confirmation prompt prevents accidental activation. - -The call brings an off-duty law-enforcement officer or armed emergency responder to the location. This character has greater authority and can control a dangerous situation, but the call has serious consequences: - -- The building may be evacuated -- The street may be closed -- The guard’s actions are reviewed -- The building loses reputation -- The player may face an investigation if the call was unjustified -- The officer may use force only when the game’s threat assessment supports it - -The officer should not function as a convenient “stronger attack.” Their role is to handle a crisis the player cannot safely manage. In most scenarios, their arrival results in commands, restraint, evacuation, or arrest rather than automatic gunfire. - ---- +At Level 4 the report matters: location, description, behavior, weapons seen, and immediate danger. Exaggerated reports damage credibility. At Level 5 the call may evacuate the building, close the street, trigger a review, cost reputation, or open an investigation if unjustified. Responders may command, restrain, evacuate, or arrest; they are not a routine stronger attack. ## NPC Behavior Types -### Tourists - -- Take photos -- Sit on steps -- Wander toward restricted doors -- Usually respond well to polite directions - -### Street Performers - -- May block stairs -- May become argumentative if moved -- Can be redirected to a permitted area - -### Influencers and Filmmakers - -- Film the guard -- Test boundaries for content -- May accuse the guard of overreacting -- Create public-relations risk - -### Confused Visitors - -- Have appointments or directions -- May genuinely believe the building is public -- Reward patient explanations - -### Intoxicated Pedestrians - -- Move unpredictably -- May ignore instructions -- Require additional distance and assistance - -### Trespassers - -- Repeatedly test entrances -- Use distractions -- May return after being told to leave - -### Violent Threats - -- Rare -- Escalate quickly -- Trigger the emergency response system only when their behavior indicates immediate danger - -### 51/50s - -Crazy Homeless Individuals may be referred to as "51/50s" in the context of the game, indicating a person who may be experiencing a mental health crisis and could pose a potential threat to themselves or others. - -- May loiter near entrances -- Can be unpredictable in behavior -- Often respond poorly to aggressive confrontation -- Require careful de-escalation and patience - ---- +- **Tourists:** take photos, sit on steps, drift toward restricted doors; usually respond well to polite directions. +- **Street performers:** may block stairs or argue when moved; can be redirected to a permitted area. +- **Influencers and filmmakers:** film the guard, test boundaries, and create public-relations risk. +- **Confused visitors:** may have appointments or genuinely believe the building is public; reward patient explanation. +- **Intoxicated pedestrians:** move unpredictably, ignore instructions, and need extra distance or assistance. +- **Trespassers:** test entrances, use distractions, and may return after being told to leave. +- **Violent threats:** rare, escalate quickly, and justify emergency response only when behavior shows immediate danger. +- **People in mental-health crisis:** may loiter, behave unpredictably, and respond poorly to aggression; require patience and careful de-escalation. The setting may refer to a 51/50 hold, but the game should present the person respectfully, not as an automatic threat. ## Special Systems -### Reputation Meter +### Reputation -The player is evaluated on: - -- Number of incidents resolved peacefully -- Response time -- Accuracy of radio reports -- Number of unnecessary confrontations -- Public complaints -- Property damage -- Whether the entrance remained secure - -A player who calls armed assistance too often should score poorly, even if no one was injured. +The shift evaluates peaceful resolutions, response time, radio accuracy, unnecessary confrontations, public complaints, property damage, entrance security, and whether assistance was justified. Calling armed help too often scores poorly even when no one is hurt. ### Evidence and Body Camera -Interactions are automatically recorded. After each shift, the player reviews incidents and sees whether their escalation was justified. +Interactions are recorded automatically. The body camera is a real state the player can toggle; a formal warning also arms it. The shift review uses the recorded events and evidence to show whether the response was justified. -This encourages players to think before acting. +### Crowd Reaction -### Public Crowd Reaction +Nearby pedestrians react to the guard. Calm professionalism attracts little attention; aggression draws a crowd; visible weapons or responders can cause panic. Good de-escalation keeps the boulevard moving. -Nearby pedestrians react to the guard’s behavior: +### Radio Limits -- Calm professionalism attracts little attention -- Aggressive behavior creates a crowd -- Visible weapons or emergency responders cause panic -- Good de-escalation keeps the boulevard moving normally - -### Limited Radio Battery or Cooldown - -The emergency radio should not be infinitely available. A call has a cooldown and may require the player to give a short report first. - ---- +The emergency radio has a cooldown, and the call requires a short report. Assistance takes time to arrive, so the guard must keep monitoring the situation. ## Shift Structure -Each shift lasts 10–15 minutes. +- **Early:** harmless tourists, delivery workers, people resting on the steps. +- **Midday:** heavier crowds, more entry attempts, more filming. +- **Evening:** lower light, more intoxicated pedestrians and aggressive groups. +- **Late:** a rare serious incident may test whether the player recognizes a real threat without overreacting to ordinary behavior. -### Early Shift +## Outcomes -Mostly harmless tourists, delivery workers, and people sitting on the stairs. +A successful shift keeps the building secure, resolves most incidents without force, keeps public access clear, makes justified emergency calls, avoids bystander injuries, and follows policy. -### Midday +A poor shift involves excessive force, confronting innocent people, ignoring a real threat, false reports, allowing unauthorized entry, causing a crowd or panic, or behaving recklessly even if the door stayed locked. -Crowds become heavier. More people attempt to enter the building or film interactions. +## Venues -### Evening +### Hollywood Boulevard Building -Lighting decreases. Intoxicated pedestrians and aggressive groups become more common. +The original scenario: a building entrance with steps, sidewalk, street lamps, and a restricted door. Tourists, performers, influencers, confused visitors, intoxicated pedestrians, trespassers, people in crisis, and rare violent threats approach from the boulevard. -### Late Shift - -A rare serious incident may occur, testing whether the player recognizes a genuine threat instead of overreacting to ordinary behavior. - ---- - -## Win and Loss Conditions - -## Successful Shift - -- Building remains secure -- Most incidents are resolved without physical force -- Public access remains clear -- Emergency calls are justified -- No bystanders are injured -- The player follows company policy - -## Poor Performance - -- Excessive use of force -- Repeatedly confronting innocent people -- Ignoring a real threat -- Making false radio reports -- Allowing repeated unauthorized entry -- Causing a crowd or panic - -A shift can be technically “secure” but still receive a poor rating if the guard behaves recklessly. - ---- - -## Venues and Scenarios - -The game should support multiple venues, each with its own access rules, crowd patterns, equipment, and escalation procedures. The core gameplay remains the same: observe, verify access, communicate clearly, and use the lowest effective level of escalation. +Authorized people are recognized or present a valid wristband. Wristbands vary by color, pattern, date, and event marking, and may be valid, expired, counterfeit, or missing. ### The Joke Shop -**The Joke Shop** is a comedy club scenario where the player works as a door person at the entrance. The player is responsible for checking identification, confirming that guests are attending the correct show, and screening guests for weapons with a handheld security wand. +A comedy-club entrance. The door person checks IDs, tickets, reservations, guest-list status, and screens guests with a handheld wand under venue policy. -#### Primary Responsibilities +The wand does **not** identify a weapon automatically. Keys, belts, and phones can trigger false alarms; the player must ask the guest to identify the item and apply procedure. A guest with valid credentials can still require assistance if they threaten staff or patrons. -- Check each guest’s government-issued ID where required. -- Confirm that the guest meets the venue’s age requirement. -- Verify that the ID appears valid and belongs to the person presenting it. -- Check tickets, reservations, or guest-list status. -- Use the handheld wand according to venue policy. -- Direct guests through the entrance without blocking the sidewalk. -- Refuse entry when a guest has an invalid ID, no valid admission, or a prohibited item. +Typical events: -#### Guest Outcomes +- a busy weekend show creates a long line; +- a performer arrives through the guest entrance; +- a guest has a reservation but no ID; +- a fake or borrowed ID appears; +- a wand alert comes from keys or a belt; +- a guest refuses screening but insists on entering; +- someone tries to follow an authorized person through the door; +- a late audience member arrives during the performance. -A guest may have: - -- A valid ID and ticket -- A valid ID but no ticket or reservation -- An expired, damaged, or questionable ID -- An ID that does not match the guest -- A prohibited item detected by the wand -- A harmless item that causes a false alarm -- No ID when identification is required - -The player must make decisions based on the venue’s rules and observable evidence, not on a guest’s appearance or attitude. A calm guest with a valid ID should be admitted efficiently, while an aggressive guest with valid credentials may still require assistance if they threaten staff or other patrons. - -#### Joke Shop Escalation - -1. **Nonverbal direction:** Raise a hand, point to the ID-check area, or gesture for the guest to wait. -2. **Routine explanation:** Explain the ID, ticket, or wand-check requirement. -3. **Repeat request:** Clearly state what is missing or what must happen before entry. -4. **Refusal of entry:** Keep the guest outside and direct them away from the entrance. -5. **Manager or security assistance:** Call for a supervisor or another staff member when a guest argues, refuses screening, or blocks the line. -6. **Emergency response:** Call emergency services only for an immediate threat, such as a weapon, assault, or serious attempt to force entry. - -The handheld wand should not automatically identify an item as a weapon. The player must interpret the alert, ask the guest to identify the item, and follow venue procedure. The goal is to create a believable screening challenge while keeping the emphasis on communication and proportionate responses. - -#### Scenario Events - -- A busy weekend comedy show creates a long line. -- A performer arrives through the guest entrance and must be recognized or verified. -- A guest forgets their ID but appears on the reservation list. -- A fake or borrowed ID is presented. -- A wand alert comes from keys, a belt buckle, or a phone. -- A guest refuses the screening but insists on entering. -- A disruptive guest attempts to follow another person through the door. -- A late-arriving audience member tries to enter during a performance. +Joke Shop escalation follows the common ladder: direction, explanation, repeat request, refusal, manager/security assistance, emergency only for immediate danger. ### Hollywood Boulevard Late Night TV Studio -This scenario takes place outside a late-night television studio on Hollywood Boulevard. The guard manages the front steps, studio entrance, guest arrivals, deliveries, audience members, and the public crowd gathered around the building. +A busy studio entrance with audience members, production staff, performers, guests, deliveries, celebrity arrivals, tourists, influencers, and the same range of street behavior as the building scenario. -The studio encounters all of the NPC types described in the game plan: +Staff and guests are recognized or present a wristband, credential, ticket, guest-list confirmation, or other approved marker. The player keeps the steps clear, protects arrivals and equipment, manages filming boundaries, watches for tailgating, and calls for help only when there is immediate danger. -- **Tourists** stopping to take photos or watch arrivals -- **Street performers** occupying the steps or performing near the entrance -- **Influencers and filmmakers** recording the guard, guests, or celebrity arrivals -- **Confused visitors** looking for the wrong entrance or trying to attend a show without understanding the access rules -- **Intoxicated pedestrians** approaching the entrance or disrupting the crowd -- **Trespassers** testing the doors, trying to follow authorized guests, or returning after being directed away -- **Violent threats**, which are rare but require careful recognition and emergency escalation +Typical events: -The studio also has authorized guests and staff. They must either be recognized by the guard or present a valid wristband, credential, guest-list confirmation, or other approved access marker. The player must check these credentials without holding up the audience line or allowing unauthorized people to enter. +- a crowd gathers for a celebrity arrival; +- tourists block the entrance for photographs; +- a performer sets up in the audience queue; +- an influencer ignores the filming boundary; +- a confused visitor believes the studio is open; +- an intoxicated pedestrian approaches the stage door; +- a trespasser blends into an audience group; +- an authorized guest arrives without a wristband; +- someone presents a counterfeit credential; +- a violent threat appears during a crowded arrival. -#### Studio Responsibilities +## Presentation and Controls -- Keep the front steps and entrance clear. -- Direct tourists and performers away from restricted areas. -- Check wristbands, credentials, tickets, or guest-list status. -- Admit authorized staff, performers, guests, and audience members. -- Manage influencers and filmmakers without unnecessarily obstructing lawful filming. -- Protect celebrity arrivals and production equipment from crowding. -- Coordinate with studio staff, production assistants, and additional security guards. -- Watch for attempts to follow authorized people through the entrance. -- Call for emergency assistance only when there is an immediate threat. +The game is first-person: WASD and mouse look, a focus cone on nearby people, a billboarded focus circle, `Tab`/mouse-wheel cycling for aim-free selection, and a radial action menu opened with left click or `Space`. `Shift` is precision walk. Gamepad input is supported, and keys/buttons can be remapped in Settings. -#### Studio Scenario Events +The action wheel prioritizes de-escalation: Stop, Look, Point, No, Ask, Inspect, Wand, Warn, Block, Reason, Recognize, Radio. Emergency stays on `R` and is not a wheel slice. `W` is walk, never the wand; `C` is the optional wand shortcut. -- A crowd gathers to watch a celebrity arrive. -- Tourists stop on the steps and block the entrance for photographs. -- A street performer sets up in front of the audience queue. -- An influencer repeatedly ignores the restricted filming boundary. -- A confused visitor believes the studio is open to the public. -- An intoxicated pedestrian wanders toward the stage door. -- A trespasser tries to blend into an audience group. -- An authorized guest arrives without their wristband and must be verified another way. -- Someone presents a counterfeit wristband or credential. -- A violent threat appears during a crowded arrival, requiring the player to protect the entrance while calling for assistance. +The visual direction is readable stylized realism: ---- +- **Blender library:** 8 skinned NPC variants, 18 gear pieces, and 20 street/venue props, with baked albedo/normal/AO/ORM maps, a manifest, and procedural fallbacks. `Rig/Head` stays the focus anchor. +- **Realism pass:** AI-assisted per-phase skyline panoramas, v2 surface tiles with normal maps, wet asphalt at night, a warm day haze, phase-specific sun/exposure/fog, a visible flashlight beam, and denser foliage. +- **References and QA:** runtime UI art lives in `assets/images/ui/`; reference/art-direction sets live in `docs/screens/designs/` and `docs/screens/concepts/`; captures live in `docs/screenshots/`; realism runs live in `docs/screens/realism/`. `screen_designs.py compare/judge` and `tools/check_screenshots.sh` guard drift. +- **Storage convention:** see [ADR-0014](docs/adr/0014-runtime-image-root.md). Never overwrite an existing image; new outputs get a new path or `-vN` suffix. -## Visual Quality Direction +Remaining visual work is tracked in `TODO.md` (NPC fidelity and the two venue stages), not in this plan. -The game prioritizes readable, well-lit, low-poly presentation over realism (GL Compatibility -renderer). The v0.6.0 visual pass moves presentation to a **Blender-authored asset library**: -skinned NPC character variants, head/back/chest/hand gear, and street/venue props, all carrying -baked albedo/normal/AO/ORM maps. A generator (`tools/blender_assets.py`) and manifest -(`assets/models/blender/manifest.json`) keep the assets reproducible; the game selects variants -by NPC role/outfit and keeps the procedural rig and primitive props as offline fallbacks. The -existing AI tools remain the source of art direction for fabric textures, palettes, and the -screen-design compare/judge gate. - -The library targets 8 character variants (casual, jacket, coat, vest, dress, hoodie, firefighter, -guard), 18 gear pieces, and 20 props — including replacements for the current generated street -furniture, lamps, trees, doors, marquee, and a venue car. Integration must preserve the -`Rig/Head` focus anchor, seed-driven outfit determinism, collider/navigation footprints, and the -frame budget measured by `smoke_npc_budget.gd`. See -[`docs/plan-graphics-v0.6.md`](docs/plan-graphics-v0.6.md) and -[ADR-0013](docs/adr/0013-blender-authored-npc-characters.md). - -### Realism pass - -The target look is the realistic 3D-game frames in `docs/screens/designs/` and the larger -example set in `docs/screens/concepts/`: hazy, layered city depth, believable materials, and -warm practical lights at night. Readability still comes first. Silhouettes, the focus ring and -the HUD must stay clear, and the GL Compatibility renderer stays. - -- **Backgrounds.** The flat, black-box skyline strip is retired in favour of AI-generated - panoramic skylines (Hollywood mid-rises, palms, hills) for day, dusk and night. Each one is a - transparent-sky 4:1 strip that tiles horizontally on the existing backdrop ring, and the night - variant has lit windows. -- **Textures.** Higher-detail seamless 1024² tiles with derived normal maps for brick, granite, - sidewalk pavers, asphalt (dry and wet), steps, awning canvas and stucco, at the current UV - scales. -- **Process.** `tools/scene_concepts.py` generates (never overwriting existing images), - processes, audits and judges. `src/test/capture_realism.gd` captures the same camera shots - with the current and the candidate assets, swapped at runtime, so a candidate is compared - before any game code changes. Candidates are adopted only when the realism report (Pillow - detail metrics + vision-model realism scores) improves and `screen_designs.py judge` shows no - new `diff`. -- **Storage.** Raw AI output: `assets/textures/ai/v2/raw/` (local, gitignored). Game-ready - candidates: `assets/textures/ai/game_ready/v2/`. Scene references: `docs/screens/concepts/`. - Trial captures and reports: `docs/screens/realism//`. -- **First result (2026-11-01).** Swapping in the v2 skyline and tiles raised the judge's mean - backdrop score from 2.6 to 4.0 and texture detail from 1.2 to ~1.7. Overall realism stayed at - ~2/10; the limits were lighting and exposure, flat facades and blob foliage, not textures. -- **Adopted (2026-11-01).** The v2 picks are now the runtime skyline and surface set, the phase - lighting was retuned (exposure, darker dusk/late, practical lights, wet asphalt at night), the - backdrop is a fog-free 90 m panorama ring per phase, the facade gained plinth/string - courses/cornice/pilasters/glazing bars, and the library trees and shrubs are denser. Judge - scores on the like-for-like shots rose on every sub-score (overall 0.8 → 1.0, backdrop - 0.6 → 1.6) with the metric gap down 0.444 → 0.348 - (`docs/screens/realism/2026-11-01-adopt/`). The remaining gap to the concepts is the low-poly - character and prop fidelity, a visible flashlight beam at night, and the entrance still being - ~20 % brighter than the concept (`TODO.md` → Realism follow-ups). - -The scenario should test the player’s ability to distinguish ordinary Hollywood Boulevard activity from a genuine security problem. The best solution is usually a simple gesture, clear direction, or credential check rather than immediate escalation. - -Future venues can reuse this structure while changing the rules, equipment, staff roles, and types of access decisions. +Primary decisions: [ADR-0007](docs/adr/0007-locomotion-and-input-layers.md), [ADR-0008](docs/adr/0008-cone-focus-and-head-ring.md), [ADR-0009](docs/adr/0009-radial-action-menu.md), [ADR-0010](docs/adr/0010-procedural-npc-presentation.md), [ADR-0011](docs/adr/0011-aim-free-selection-and-precision-walk.md), [ADR-0012](docs/adr/0012-surface-materials-and-generated-props.md), [ADR-0013](docs/adr/0013-blender-authored-npc-characters.md). ## Tech Stack -### Engine: Godot 4 +- **Engine:** Godot 4.3, GL Compatibility renderer (Web parity). +- **Language:** GDScript. +- **Architecture:** venue-driven simulation; shared systems plus `Resource`-based scenario data. +- **Navigation:** `NavigationRegion3D` / `NavigationAgent3D`. +- **NPC behavior:** lightweight custom finite state machines driven by `NpcProfile` resources. +- **UI/audio:** Godot `Control` nodes, themes, procedural audio, and JSON-backed localized strings. +- **Persistence:** JSON in `user://` for settings and shift history. +- **Testing:** custom headless runner (`src/test/test_runner.gd`); GUT was evaluated and not adopted. Python tooling tests cover the asset/screenshot pipelines. +- **Source control/CI:** git on Gitea; `.gitea/workflows/build.yml` runs headless checks and builds/publishes releases on tags. +- **Targets:** Windows, Linux, macOS, and Web. Release artifacts include portables, an NSIS installer, an AppImage, and a Web zip. -The game is built with the Godot Engine 4.x editor. Godot was chosen for its free and open-source license, built-in 3D rendering, navigation, animation, audio, and UI systems, and its low weight for fast prototyping and iteration. +## Versioning and Delivery -### Language: GDScript - -Gameplay logic is written in GDScript. It is tightly integrated with the engine, fast to iterate on, and avoids an external build toolchain for the prototype phase. - -### Architecture Mapping - -The venue-driven architecture maps onto Godot as follows: - -- **Nodes and scenes:** Each major system (`ShiftCoordinator`, `NPCController`, `InteractionSystem`, `AccessVerifier`, `EscalationManager`, `RadioSystem`, `IncidentRecorder`, `ReputationEvaluator`, `CrowdSystem`, `ShiftReview`) is a Godot node or scene. -- **Scenarios as resources:** `VenueScenario` and content such as `NpcProfile`, `Dialogue`, `EventPool`, and `AccessPolicy` are defined as custom Godot `Resource` types so venue content is data-driven and inspectable in the editor. -- **Navigation:** `NavigationRegion3D` and `NavigationAgent3D` drive NPC and player movement. -- **NPC behavior:** Lightweight custom finite state machines built on the `NPCController` node, with behavior traits coming from `NpcProfile` resources. -- **UI:** Godot `Control` nodes and themes for prompts, access inspection, radio reports, dialogue, timers, and the shift review screen. -- **Audio:** Godot audio buses and `AudioStreamPlayer` nodes for voices, crowd noise, radio, and environment sound. - -### Content and Data - -- Scenario and entity configuration uses typed Godot `Resource` files (`.tres`), created either in the editor or via scripts. -- Localized dialogue and text are stored in JSON files when they need to be editable outside the editor. -- Save data and shift results use JSON in Godot's `user://` directory. - -### Testing - -- Unit and scenario tests use a lightweight custom headless runner - (`src/test/test_runner.gd`). GUT was evaluated but requires the editor plugin. -- Tests run in headless mode so rules, access verification, escalation, and scoring can be verified without rendering or user input. - -## Version Control and CI - -- Source is tracked with git. -- Gitea Actions (`.gitea/workflows/build.yml`) runs headless Godot tests on push/PR and exports - Linux/Windows/macOS desktop builds plus the NSIS installer and AppImage on tags. - -## Planned Commands - -The following commands apply once the Godot project is scaffolded: - -- Open the editor: `godot --editor --path .` -- Run the game: `godot --path .` -- Run tests headlessly: `godot --headless --path . res://src/test/test_runner.tscn` - -## Export Targets - -Desktop is the first target: Windows, Linux, and macOS. A Web export now ships as well -(non-threaded, static hosting); it is published with each release as a zip. - -## Player Control, Focus, and Action Menu (next pass) - -The prototype already walks and looks in first person, but the control scheme fights itself and targeting is a hairline. This pass replaces that with three things that belong together: solid locomotion, a visible focus on a person, and a round action menu for what to do with them. - -Decisions: [ADR-0007](docs/adr/0007-locomotion-and-input-layers.md) locomotion and input layers, [ADR-0008](docs/adr/0008-cone-focus-and-head-ring.md) cone focus and focus circle, [ADR-0009](docs/adr/0009-radial-action-menu.md) radial action menu, [ADR-0010](docs/adr/0010-procedural-npc-presentation.md) procedural NPC presentation. - -### What is wrong today - -- `W` is walk-forward in the input map and wand-screening in `GameManager._handle_key`. Walking at someone with a wand venue fires the wand. -- `A` / `D` are strafe and also allow/deny during inspection. -- `Q` is polite direction and is also bound as `cancel`. -- Focus is an 8 m physics ray from the camera. Missing a capsule by a few pixels clears the target. There is no mark in the world that you have someone. -- NPC bodies are colored capsules with props. They read as markers, not people. -- Actions live on number keys `1`–`6` plus `Q` / `E` / `W` / `R`. That is a cheat-sheet, not a verb you pick while looking at a person. -- `Esc` only toggles mouse capture. There is no "I changed my mind" for an action in progress. - -### Movement and look - -Keep first-person WASD + mouse look. Fix the feel and stop stealing those keys. - -- Body yaw from mouse X, head pitch from mouse Y, pitch clamped (already `-80` to `80`). -- Move relative to body yaw only (already). Add short acceleration / deceleration so starts and stops are not instant. -- Gravity only when `not is_on_floor()`; `floor_snap_length` so the steps work. -- Mouse look runs only while `MOUSE_MODE_CAPTURED` and no modal UI is open (radial, inspection, wand, radio, shift review). -- Walk speed stays around 3.2 m/s. No sprint, no crouch in this pass. -- While the radial is open: freeze look and WASD so `A` / `D` can cycle the menu. Recapture the mouse when the menu closes. -- `Esc` with a modal open closes that modal and does nothing else. `Esc` with nothing open keeps the current capture/release toggle. - -Equipment stays on its own keys because it is not about a person: `G` flashlight, `L` door lock, `Tab` cycle nearby people, `V` venue (debug), `F` debug overlay. `R` stays the dedicated emergency radio (hold-to-confirm on the existing panel). Those do not go on the wheel. - -Wand leaves `W`. It is a slice on the wheel (greyed when the venue has no wand) and an optional extra key that is not WASD, suggested `C`. - -### Focus area - -Replace the hairline ray as the primary picker. - -- A **focus cone** in front of the camera: people within about 10 m whose head projects inside a screen-space circle around the crosshair (about 90 px / 10 degrees). -- If several heads sit in the circle, pick the one closest to the center, then the nearer one if tied. -- The person must be in front (dot with camera forward > 0) and not fully occluded by the building. A short ray to the head is enough for occlusion. -- `Tab` still cycles people inside 12 m as the aim-free path. Cycling sets the same focused person the cone would. -- Clearing: look away until the head leaves the circle for a few frames (small grace so a bob does not drop them), or they walk out of range. - -### Focus circle - -When a person is in focus, draw a blue, semi-transparent circle in front of their face. - -- Attach to the avatar `Head` node, just in front of the face, billboarded to the camera so it stays a circle on screen. -- Slow spin is fine; no ping-pong scale spam. -- Idle focus: blue, semi-transparent, modest size. Radial open on that person: brighter, slightly larger. -- Optional small name under the circle (`display_name` only, not the archetype cheat `Violent Threat` in the world). The existing HUD target line can keep the archetype for the prototype. -- One circle at a time. Everyone else has none. - -Implementation sketch: a thin unshaded `MeshInstance3D` circle (flat disc) in front of the face on the avatar, toggled from `GuardController` / `GameManager` when focus changes. Screen-space fallback (unproject head, draw a `Control` circle) is acceptable if the 3D circle z-fights on hats. - -### Round action HUD - -A doughnut / pie menu centered on the screen, opened on the focused person. - -**Open** - -- Left mouse button, or `Space`, while someone is in focus and no other modal is open. -- If nobody is in focus, log the existing "aim first" line and do not open. -- The click that opens the menu must not also pick a slice. - -**While open** - -- Mouse becomes visible. Look and walk freeze. -- Center of the doughnut shows the focused person's `display_name`. -- Slices, clockwise from the top, de-escalation first: - 1. Raise hand (stop / wait) - 2. Point away - 3. Head shake - 4. Polite direction (old `Q`) - 5. Inspect access (old `E`) - 6. Wand (grey if the venue has no wand) - 7. Formal warning - 8. Block - 9. Radio assist -- Emergency is **not** on the wheel (`R` only). -- Highlight follows the mouse angle when the cursor is over the ring. `Left` / `Right` or `A` / `D` step the highlight. Wrap around. - -**Confirm** - -- Click a slice: that action runs, menu closes, mouse recaptured. -- `Space` while a slice is highlighted: same. -- Inspect or wand: close the wheel, then open the existing inspect / wand panel. Allow / deny on that panel stay `A` / `D` (walk is frozen only while the wheel is up; once the inspect panel is open, WASD can move again, so allow/deny on `A` / `D` remains a press handler and must ignore repeats / echo, which it already does). Safer: keep walk frozen for inspect/wand too, until the panel closes. Prefer freeze until the whole interaction ends. -- Radio assist: close the wheel, open the existing radio panel. - -**Cancel** - -- `Esc` or right mouse button: hide the menu, no action, no recorder event, recapture mouse. -- Focus and the focus circle stay as they were. - -Number keys `1`–`6` may remain as shortcuts that skip the wheel so a smoke-test script still works. They must not fire while the wheel is open (the wheel owns `A` / `D` / `Space`). Document both in the README. - -### NPC display - -Stay on the procedural capsule rig (no Mixamo / GLB dependency this pass). Make them read as people at conversation distance. - -- Neck between torso and head; shoes; simple hair cap (color from seed); two dark eye spheres on the face so a head has a front. -- Keep archetype props (camera, box, hat, sign, bag). Keep height / brightness variation from the visual seed. -- Collision capsule matches the scaled height so the focus ray / cone hits the body you see. -- `Head` stays a named node other systems can find (`get_node("Rig/Head")`) for the ring and the cone. -- Walk bob and the "look at the guard when noticed" cue stay. -- Do not put the internal type name (`Trespasser`, `Violent Threat`) on the body. The player should judge from clothes, props, and behavior. The debug overlay (`F`) can still print the type. - -AI textures in `assets/textures/ai/` stay out of this pass unless a specific map (shirt, hair) is already the right size. - -### Input map (target) - -| Action | Bind | -| --- | --- | -| Walk | WASD / arrows (arrows **do not** walk while the wheel is open; they step the highlight) | -| Look | Mouse, captured | -| Open / confirm action menu | LMB, `Space` | -| Cancel menu | RMB, `Esc` | -| Step highlight | `A` / `D`, left / right arrows | -| Emergency radio | `R` | -| Flashlight | `G` | -| Door lock | `L` | -| Cycle nearby people | `Tab` | -| Wand shortcut | `C` (not `W`) | -| Inspect shortcut | `E` still allowed when the wheel is closed | - -### Files this pass is expected to touch - -- `src/game/guard_controller.gd` — cone focus, no look while modal, accel, floor snap. -- `src/game/npc_avatar.gd` — face / hair / neck, head marker, ring toggle. -- `src/game/ui/action_radial.gd` — new Control, `_draw` doughnut, slice pick. -- `src/game/ui/hud.gd` — host the radial; stop teaching number-key verbs as the only path. -- `src/game/game_manager.gd` — input routing, freeze flags, open/confirm/cancel. -- `project.godot` — input map. -- `src/core/strings.gd` — controls line, aim-first, no new tone-of-voice. -- `src/test/tests/test_focus_and_radial.gd` — cone pick, wrap, cancel emits nothing, `W` is not wand. -- README controls table and smoke checklist. - -## Rendering, Models, and Selection (v0.3.0 pass) - -Decisions: [ADR-0011](docs/adr/0011-aim-free-selection-and-precision-walk.md) aim-free selection and precision walk, [ADR-0012](docs/adr/0012-surface-materials-and-generated-props.md) surface materials and generated props. - -The blockout look and the aim-first selection model were the two biggest gaps left by the control pass. This pass closes them without changing the game's rules. - -**Look.** Surfaces get real profiles instead of stock materials: brick is rough and finely tiled, concrete is rougher still, asphalt is smoother and damp-looking, glass is smooth and slightly metallic. The environment gains ACES tonemapping, soft glow, aerial fog and a mild grade, all driven by the same per-phase configuration that already moves the sun and sky. The facade gains framed windows that light up after dark, a stone base course, door trim and handles. Street furniture becomes real geometry: bollards, benches, bins, planters, newspaper boxes and a hydrant, built as `.glb` props by `tools/model_pipeline.py` with a procedural fallback. NPCs get per-role clothing palettes, small role accessories (cap, hood, backpack, sunglasses, lanyard), hands, shoes, and an arm/leg walk swing. The rule stays: the player judges people from clothes, props and behaviour, never from an archetype label. - -**Models.** Prop meshes are deterministic primitives, so the build works offline. An image model can supply the per-prop colour palette from a concept sheet; that is the only AI influence on geometry, and it is optional. Colours are converted from sRGB to linear before they reach glTF, because glTF factors are linear. - -**Selection.** The focus cone ranks heads by angle from the crosshair then distance. `Tab` and the mouse wheel cycle nearby people nearest-first and pin the choice, so aim-free play works. Right click clears focus and briefly suppresses re-acquisition. Holding `Shift` walks at half speed for close work at the door. Escape keeps its single meaning (close the top panel, otherwise pause). +`config/version` in `project.godot` is the single version source (currently `0.6.0`). Releases are tagged `v`; the CI pipeline builds and publishes the six artifacts. Version bumps follow [Semantic Versioning](https://semver.org/). See [`docs/RELEASING.md`](docs/RELEASING.md) and [`README.md`](README.md) for commands. ## Design Direction The game should feel like a tense workplace simulation with occasional crisis moments. The most satisfying outcome is not overpowering an NPC; it is recognizing the situation early and resolving it calmly. -A useful guiding rule: - > **The player wins by choosing the lowest level of escalation that keeps everyone safe.** ## Future Ideas -- Bob Dobbs cameo (very rare, Easter egg-style appearance), place a hidden note in `MEMORY.md`. -- specific crazy behaviour patterns for NPCs, such as slapping their own face, using their hands as scissors, taking their shirt off, or interacting with props in unexpected ways +- A rare Bob Dobbs cameo (Easter-egg appearance; placement note in `MEMORY.md`). +- Specific unusual NPC behaviors, such as slapping their own face, using hands as scissors, or interacting with props unexpectedly. +- Live 3D body-camera replay; additional venues or seasonal events; real voice/dialogue audio; an image-to-mesh prop pipeline. diff --git a/README.md b/README.md index 2d92529..516b3ac 100644 --- a/README.md +++ b/README.md @@ -36,14 +36,13 @@ The central design goal is simple: > `REQUIRE_SIGNIN_VIEW` was disabled on 2026-10-31. > > **Latest: v0.6.0** — Blender-authored character/gear/prop library with baked AO, higher-resolution environment textures, and phase-driven library props. +> `main` also contains the post-v0.6.0 realism and visual-alignment pass (v2 skylines/textures, +> UI mockup art, flashlight beam, HUD fixes); the next release will package it. > Releases are built automatically when a `vX.Y.Z` tag is pushed > (see [`docs/RELEASING.md`](docs/RELEASING.md)); manual builds use > `./tools/build_releases.sh`. Installer/AppImage packaging runs in the same pipeline > (NSIS + appimagetool) and uploads with the portable binaries. > -> Note: on this host, downloading release files currently requires sign-in; -> the page and tag URLs are public. -> > macOS builds are unsigned: right-click → Open, or clear the quarantine with > `xattr -dr com.apple.quarantine gig-line-macos.zip`. Build instructions and > the release pipeline live in [`docs/RELEASING.md`](docs/RELEASING.md). @@ -67,7 +66,7 @@ A typical shift lasts 10–15 minutes. The player: The game rewards calm resolutions rather than aggressive behavior. Emergency assistance and armed responders are rare last-resort systems with meaningful consequences. -## Planned Venues +## Venues ### Hollywood Boulevard Building @@ -113,7 +112,7 @@ An off-duty law-enforcement officer or armed emergency responder may arrive duri ## Architecture Overview -The planned solution uses a venue-driven simulation architecture. Venue configuration supplies rules, access types, NPC pools, equipment, events, and escalation policies. Shared simulation systems provide movement, perception, interactions, dialogue, access verification, escalation, radio calls, crowds, reputation, evidence, and shift review. +The implemented solution uses a venue-driven simulation architecture. Venue configuration supplies rules, access types, NPC pools, equipment, events, and escalation policies. Shared simulation systems provide movement, perception, interactions, dialogue, access verification, escalation, radio calls, crowds, reputation, evidence, and shift review. ```text Venue Scenario / Rules @@ -143,11 +142,11 @@ The architecture maps onto Godot 4 nodes, scenes, and custom resources as descri - **Navigation:** `NavigationRegion3D` and `NavigationAgent3D` - **NPC behavior:** Custom lightweight finite state machines driven by `NpcProfile` resources - **UI and audio:** Godot `Control` nodes, themes, audio buses, and `AudioStreamPlayer` nodes -- **Art assets:** authored PNGs and the in-game generated set in `assets/textures/ai/game_ready/`; street-furniture models in `assets/models/generated/` build from `tools/model_pipeline.py`; structural geometry stays procedural (`WorldBuilder`). The legacy `tools/generate_textures.py --ai` batch remains available. -- **Asset tooling:** `tools/asset_pipeline.py` generates role-aware assets through OpenRouter (`--variants N` produces alternative images) and provides crop, resize, seamless-tile, and image-audit commands, including gameplay screenshot checks. `tools/model_pipeline.py` builds and audits the street-prop `.glb` models; `tools/npc_pipeline.py` builds and audits the skinned NPC base model. -- **Testing:** GUT (Godot Unit Test) in headless mode -- **Source control:** git on a Gitea host with Gitea Actions (`.gitea/workflows/build.yml`) for headless tests and desktop release builds -- **Targets:** Windows, Linux, and macOS desktop first; web later +- **Art assets:** the Blender-authored character/gear/prop library in `assets/models/blender/` is the preferred runtime set, with `assets/models/generated/` and procedural geometry as fallbacks; the adopted v2 skyline/surface textures live in `assets/textures/ai/game_ready/v2/picks/`, and UI/scene art in `assets/images/`. Structural geometry stays procedural (`WorldBuilder`). `tools/scene_concepts.py` and `tools/screen_designs.py` document the art-direction/gate pipeline. +- **Asset tooling:** `tools/asset_pipeline.py` generates role-aware assets through OpenRouter (`--variants N` produces alternative images) and provides crop, resize, seamless-tile, and image-audit commands, including gameplay screenshot checks. `tools/model_pipeline.py`, `tools/npc_pipeline.py`, and `tools/blender_assets.py` build and audit the generated props, NPC base, and Blender library. `tools/check_screenshots.sh` renders and compares the staged gallery. +- **Testing:** custom headless runner (`src/test/test_runner.gd`); GUT was evaluated but not adopted because it requires the editor plugin. +- **Source control:** git on a Gitea host with Gitea Actions (`.gitea/workflows/build.yml`) for headless tests, desktop/Web exports, installers, and release publishing +- **Targets:** Windows, Linux, macOS, and Web ### Image Asset Tools @@ -433,6 +432,9 @@ godot --headless --path . --script res://src/test/test_runner.gd # Save a screenshot to user:// (windowed) godot --path . --script res://src/test/take_screenshot.gd +# Visual-regression smoke: render the staged captures + prop gallery, then compare them +./tools/check_screenshots.sh + # Windowed control smoke: focus circle, action wheel, wheel cycling + right-click clear; saves PNGs, exits 1 on failure godot --path . --script res://src/test/smoke_focus_radial.gd @@ -559,6 +561,10 @@ Implemented so far: - Web build: `build/gig-line-web-.zip` (Godot's non-threaded web template, no COOP/COEP headers needed) built by `tools/build_releases.sh` and published with the desktop artifacts; serve the unzipped folder from any static host - Aim-free selection pass (v0.3.0 work, [ADR-0011](docs/adr/0011-aim-free-selection-and-precision-walk.md)): the focus cone ranks candidates by angle then distance, `Tab` and the mouse wheel cycle nearby people nearest-first and pin the selection, right click clears focus with a short re-acquire grace, the HUD reports how many people are in the ring, and holding `Shift` walks at half speed for close work +- Visual alignment: start/venue menu, pause, settings, shift review, radio, wand, inspection, timeline, HUD target chip/escalation bar, and radial menu now use or match their AI references in `assets/images/ui/`. The runtime art loader (`src/game/ui/art.gd`) falls back cleanly when a file is missing. +- Realism adoption (post-v0.6.0): v2 per-phase skylines and surface tiles with normal maps, retuned sun/exposure/fog, wet asphalt, denser foliage, a visible additive flashlight beam, and refreshed staging captures. `tools/check_screenshots.sh` is the repeatable capture/compare gate; judge is clean of `diff` verdicts. +- Input/reliability fixes: selecting a venue now releases the start-menu input lock and recaptures the mouse; the body-camera overlay no longer covers the shift status. + Not yet implemented: a desktop-only Forward+ preset (the renderer stays GL Compatibility for Web parity), live 3D body-camera replay, editor-based GUT integration, and crowd performance profiling/LOD (see `TODO.md`). ### Smoke Test Checklist diff --git a/TODO.md b/TODO.md index cf11996..726c39b 100644 --- a/TODO.md +++ b/TODO.md @@ -6,14 +6,20 @@ instead of 50°, so the facade shades the near sidewalk and props cast long shadows. Ground luminance went 95 → **83** against the concept's 78 (it was 173 before the realism pass), with the boulevard at 82 and the street at 81. -- [-] Make the flashlight read in the dark: the `06-night-flashlight` concept shows a visible - beam, but a Compatibility spot light only brightens the near wall. A cheap fake cone (an - additive mesh or a light-shaft quad) would sell it, and the night mockup expects it. -- [ ] NPC skin/clothing still reads as low-poly next to the concepts (judge `characters` ≈ 0–1). +- [x] Make the flashlight read in the dark: narrowed the cone (30° → 14°, range 20 m, forward + aim) so it lights the door instead of washing the facade, raised the spot/glow at night, and + staged the two night captures in LATE instead of dusk (`capture_screenshots.gd`). The judge + moved `06-night-flashlight` from **diff (1.00) to review (0.10)**. A visible beam *shaft* + is not possible on GL Compatibility (no volumetrics): an additive cone was tried and + rejected because a first-person view inside it renders as a filled disc, so it is tracked + as a follow-up for a Forward+ desktop preset. +- [-] NPC skin/clothing still reads as low-poly next to the concepts (judge `characters` ≈ 0–1). The Blender library has the budgets for one more detail pass (fingers, sleeves, faces). - [x] Re-check the `screen_designs.py judge` default model (`google/gemini-2.5-flash-lite`): on 2026-11-01 it returned 7 match / 4 review / 0 diff without a provider error; `--model` override is documented in `README.md`. +- [ ] Add a true flashlight light shaft (volumetric spot) once a desktop Forward+ preset exists; + the Compatibility fallback stays the tight pool. See `DONE.md` → environment renderer note. - [ ] Add the two venue stages to the committed gallery (they are capture-only today) and give the Joke Shop and studio their own geometry so their concept comparisons are geometric, not just lighting. diff --git a/docs/architecture.md b/docs/architecture.md index 540948c..fbbee76 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -36,7 +36,7 @@ This document follows the structure of the arc42 architecture documentation temp - **MINOR** — new venues, NPC archetypes, systems, or features that are backward compatible. - **PATCH** — bug fixes and small polish that do not change behavior. -The single source of truth for the version is `config/version` in `project.godot` (currently `0.1.0`). Each release is tagged in git as `v` (e.g. `v0.1.0`). The `0.x` series is pre-1.0, so MINOR bumps may introduce breaking changes while the prototype is still stabilizing. `tools/build_releases.sh` and `tools/publish_release.sh` read the version from `project.godot`, so bumping it there is the only required step before a release. The full bump checklist lives in [`RELEASING.md`](RELEASING.md). +The single source of truth for the version is `config/version` in `project.godot` (currently `0.6.0`). Each release is tagged in git as `v` (e.g. `v0.6.0`). The `0.x` series is pre-1.0, so MINOR bumps may introduce breaking changes while the prototype is still stabilizing. `tools/build_releases.sh` and `tools/publish_release.sh` read the version from `project.godot`, so bumping it there is the only required step before a release. The full bump checklist lives in [`RELEASING.md`](RELEASING.md). ## 3. Context and Scope @@ -77,12 +77,13 @@ The player interacts with NPCs, venue entrances, access artifacts, equipment, st - `CrowdSystem` models queues, attention, congestion, and public reaction. - `ShiftReview` presents decisions, consequences, and improvement opportunities. - `SurfaceMaterials` (`src/game/materials.gd`) holds the surface profiles, textured albedo/normal recipes, baked-AO wiring, glass/emissive recipes, and the environment tune-up (tonemapping, glow, fog, grading) that the phase lighting applies. -- `WorldBuilder` assembles the procedural venue and instantiates the generated prop models from `assets/models/generated/` with a procedural fallback. +- `WorldBuilder` assembles the procedural venue, prefers the Blender prop library in `assets/models/blender/props/`, and falls back to `assets/models/generated/` or primitives. It also wires the phase-driven library emissives and street dressing. +- `src/game/ui/art.gd` loads runtime UI/scene art from `assets/images/ui/` and `assets/images/scenes/`, with null fallbacks so panels keep their procedural layouts. - `tools/model_pipeline.py` builds and audits the street-prop `.glb` models and packs their colour atlases. - `tools/npc_pipeline.py` builds and audits the skinned NPC base model (`assets/models/generated/npc_base.glb`) and its per-slot material maps, with an optional AI fabric override (ADR-0013). - `tools/blender_assets.py` builds, renders and audits the Blender asset library (`assets/models/blender/{npc,npc_gear,props}/` + `manifest.json`): NPC character variants that are drop-in for `npc_base`, attach-point gear, and street/venue props. `NpcAvatar` selects variants/gear by role/seed and `WorldBuilder` loads the prop replacements and new street dressing, with procedural fallbacks (see `docs/blender-assets.md`). - `tools/scene_concepts.py` generates realism-pass references (`docs/screens/concepts/`), skyline backdrops and surface tiles (raw `assets/textures/ai/v2/raw/` → candidates `assets/textures/ai/game_ready/v2/`), promotes the validated ones to the tracked `v2/picks/` that `SurfaceMaterials`/`WorldBuilder` preload, audits them, and scores `src/test/capture_realism.gd` A/B captures (five stages, runtime texture swaps) against the concepts (`docs/screens/realism//`). -- `tools/asset_pipeline.py` generates and audits role-aware textures; `tools/screen_designs.py` generates screen references and judges captures. +- `tools/asset_pipeline.py` generates and audits role-aware textures; `tools/screen_designs.py` generates screen references and judges captures; `tools/check_screenshots.sh` renders the staged gallery and runs the compare gate. Confirmed game assets live in `assets/textures/ai/game_ready/` (audited surface, UI, and card textures), `assets/models/generated/` (prop and NPC `.glb` models plus their texture atlases), and `assets/textures/npc/` (NPC material maps and `palette.json`). Development-only outputs — AI concept sheets, Blender sources, raw AI fabrics — are gitignored and regenerated by the tools. @@ -135,28 +136,30 @@ in code. ## 7. Deployment View -The initial target is a single-player local game. The expected runtime consists of one client process containing presentation, simulation, rules, content, and persistence for local settings and shift results. No online backend is required for the first prototype. +The game is a single-player local client containing presentation, simulation, rules, content, and persistence for local settings and shift results. No online backend is required. A non-threaded Web export ships alongside the desktop builds and can be served from any static host without special headers. -Future options include external analytics, cloud saves, or replay sharing, but they are not part of the initial architecture. +Future options include external analytics, cloud saves, or replay sharing, but they are not part of the current architecture. ### CI/CD build pipeline -A continuous-integration pipeline keeps the headless test suite green on every change, with a planned extension to build and publish release artifacts automatically. +A continuous-integration pipeline keeps the headless test suite green on every change and publishes tagged releases. -- **CI workflow** (`.github/workflows/ci.yml`) runs on every push to `main` and on every pull request. It installs the pinned Godot 4.3 editor, caches the `.godot` import artifacts, imports the project to build the class cache, and runs the headless test suite (`res://src/test/test_runner.gd`). The job fails on a non-zero exit code or any `SCRIPT ERROR` in the output. -- **Planned extension** grows the pipeline from "test only" to "test, build, and publish": a test stage (headless tests plus a `--quit-after 120` boot smoke test as the merge gate), a build stage (install export templates, run `tools/build_releases.sh`), and a publish stage (on a version tag, upload artifacts via `tools/publish_release.sh` with a `GITEA_TOKEN` secret). -- **Hosting note:** the repository lives on Gitea/Forgejo (`https://git.allucanget.biz/zwitschi/security-game`); the workflow is authored for GitHub Actions and should be mirrored or ported to the host's own runner if Actions is unavailable there. Export templates must match the pinned engine version, and macOS builds are unsigned (production releases need notarization or clear quarantine guidance). +- **Workflow:** `.gitea/workflows/build.yml` runs on pushes, pull requests, tags, and manual dispatches. The `checks` job installs Godot 4.3, imports the project, and runs `res://src/test/test_runner.gd`; it fails on a non-zero exit code or any `SCRIPT ERROR` in the output. +- **Build job:** runs for tags and manual dispatches. It installs export templates, exports Linux/Windows/macOS and the non-threaded Web build, packages the NSIS installer and Linux AppImage, verifies the installer contents, and uploads the artifacts. +- **Publish job:** tag builds call `tools/publish_release.sh` to create the Gitea release and upload the six artifacts. The script uses `GITEA_TOKEN` when configured and otherwise reuses the runner's checkout extraheader credentials. +- **Hosting:** the repository lives on Gitea (`https://git.allucanget.biz/zwitschi/security-game`). Export templates must match the pinned Godot version; macOS builds are unsigned and need quarantine guidance or notarization for wider distribution. ### Release management Releases are produced from a tagged commit and published to the repository host's release page, where the README "Downloads" links point. -- `export_presets.cfg` — committed Linux, Windows Desktop, and macOS export presets so builds are reproducible. -- `tools/build_releases.sh` — exports all three desktop artifacts into `build/`, named `gig-line--.`. -- `tools/publish_release.sh` — creates a release and uploads the artifacts via the Gitea/Forgejo API (requires `GITEA_TOKEN`). +- `export_presets.cfg` — committed Linux, Windows, macOS, and Web export presets so builds are reproducible. +- `tools/build_releases.sh` — exports the desktop binaries and Web zip into `build/`, named `gig-line--.`. +- `tools/publish_release.sh` — creates a release and uploads the artifacts via the Gitea API, using `GITEA_TOKEN` or the checkout extraheader fallback. +- Packaging — NSIS builds the Windows installer; `packaging/linux/build_appimage.sh` builds the AppImage. - [`RELEASING.md`](RELEASING.md) — step-by-step guide and release checklist. -The release process is: bump the version, run the full test suite and boot smoke test, run `tools/build_releases.sh`, run `tools/publish_release.sh` (or create the release via the web UI), and verify the README "Downloads" links resolve to the new release. +The release process is: bump the version, run the full test suite and `tools/check_screenshots.sh`, run `tools/build_releases.sh`, tag and push (CI publishes), then verify the README "Downloads" links and the six artifacts. ## 8. Cross-Cutting Concepts @@ -167,7 +170,8 @@ The release process is: bump the version, run the full test suite and boot smoke - **Safety and proportionality:** The rules layer prevents ordinary noncompliance from automatically becoming a violent encounter. - **Determinism where useful:** Scenario tests should be able to use fixed seeds and scripted NPC behavior. - **Localization:** Dialogue and prompts should be externalized from logic. -- **Observability:** Debug overlays should show NPC intent, access status, escalation level, active incidents, and response timers during development. +- **Observability:** Debug overlays show NPC intent, access status, escalation level, active incidents, and response timers during development. +- **Visual regression:** Staged captures are compared against the runtime reference art (`screen_designs.py compare`) and optionally judged by a vision model; `tools/check_screenshots.sh` makes the pass repeatable. ## 9. Architecture Decisions @@ -207,6 +211,7 @@ Architecture decisions are recorded as ADRs: - Emergency response can overshadow the core game if it is too powerful or too frequent. - Mental-health-crisis scenarios require careful writing, playtesting, and respectful presentation. - The choice of engine may affect navigation, crowd scale, tooling, and content authoring. +- Reference mockups can outpace the runtime art style; compare/judge catch gross drift but not composition errors, so the staged gallery needs human review after large visual changes. ## 12. Glossary