CI / headless-tests (push) Canceled after 49s
- Godot 4.3 project scaffold with first-person guard, procedural world, interaction HUD, access inspection, radio forms, debug overlay, shift review - Simulation core: ShiftCoordinator, VenueScenario, EventScheduler, NPCController/FSM, AccessVerifier, EscalationManager, RadioSystem, IncidentRecorder, ReputationEvaluator, CrowdSystem, EventBus - Three authored scenarios (Hollywood Blvd building, The Joke Shop, TV studio) - Custom headless test runner (25 tests) replacing editor-dependent GUT, plus GitHub Actions CI - Documentation workflow live: README, PLAN (tech stack), TODO/DONE, MEMORY
342 lines
20 KiB
Markdown
342 lines
20 KiB
Markdown
# Step Line
|
||
|
||
Step Line is a workplace security simulation about observation, communication, access verification, and proportionate escalation. The player works security at public-facing venues around Hollywood Boulevard, managing stairs, entrances, crowds, guests, staff, and occasional serious threats.
|
||
|
||
The central design goal is simple:
|
||
|
||
> The player wins by choosing the lowest level of escalation that keeps everyone safe.
|
||
|
||
The project is under active development. The design and architecture are documented, and a playable prototype vertical slice exists (Godot 4.3 + GDScript): a procedural Hollywood Boulevard entrance, a first-person guard, simulated NPCs with intents and reactions, the six-level escalation model, access inspection and admission decisions, radio calls with credibility checks, reputation, crowd mood, and an end-of-shift review.
|
||
|
||
## Game Overview
|
||
|
||
A typical shift lasts 10–15 minutes. The player:
|
||
|
||
1. Watches the entrance, steps, queue, and surrounding sidewalk.
|
||
2. Determines why each person is approaching.
|
||
3. Uses simple gestures or polite directions first.
|
||
4. Verifies authorized access using recognition, wristbands, credentials, tickets, or guest lists.
|
||
5. Escalates only when a person refuses directions, attempts unauthorized entry, or presents a genuine threat.
|
||
6. Records the incident through body-camera and radio systems.
|
||
7. Finishes the shift with a performance review based on safety, judgment, and professionalism.
|
||
|
||
The game rewards calm resolutions rather than aggressive behavior. Emergency assistance and armed responders are rare last-resort systems with meaningful consequences.
|
||
|
||
## Planned Venues
|
||
|
||
### Hollywood Boulevard Building
|
||
|
||
The original scenario places the guard at the top of the steps outside a fictional building. Tourists, street performers, influencers, confused visitors, intoxicated pedestrians, trespassers, people experiencing a mental-health crisis, and rare violent threats may approach the entrance.
|
||
|
||
Authorized people must either be recognized by the guard or present a valid wristband. Wristbands can have different colors, patterns, dates, or event markings. They may be valid, expired, counterfeit, or missing.
|
||
|
||
### The Joke Shop
|
||
|
||
The Joke Shop is a comedy-club scenario. The door person checks IDs, tickets, reservations, and guest-list status, then uses a handheld security wand according to venue policy. The player must interpret wand alerts rather than treating every alert as proof of a weapon; keys, belts, phones, and other harmless objects can trigger false alarms.
|
||
|
||
### Hollywood Boulevard Late Night TV Studio
|
||
|
||
This scenario combines the previously defined NPC types with a busy television-studio entrance. The player manages audience members, production staff, performers, guests, deliveries, celebrity arrivals, tourists, street performers, influencers, confused visitors, intoxicated pedestrians, trespassers, people experiencing a mental-health crisis, and rare violent threats.
|
||
|
||
The studio uses wristbands, credentials, tickets, guest-list confirmation, and personal recognition to authorize entry. Crowd control, filming boundaries, following authorized guests through the door, and counterfeit credentials are key events.
|
||
|
||
## Escalation Model
|
||
|
||
The common escalation model has six levels:
|
||
|
||
0. **Observation** — Decide whether intervention is necessary.
|
||
1. **Simple deterrence and polite direction** — Raise an open hand, make eye contact, point toward the sidewalk or check-in area, shake the head, or give a short instruction.
|
||
2. **Formal warning** — Clearly explain the rule and request compliance.
|
||
3. **Blocking and physical positioning** — Secure the entrance, maintain distance, preserve an escape route, and deny access without starting a fight.
|
||
4. **Radio for security assistance** — Request a supervisor, second guard, building management, or other appropriate support.
|
||
5. **Emergency response** — Hold the emergency-radio button and confirm only when there is an immediate threat, such as a weapon, assault, forced entry, or serious threat to occupants.
|
||
|
||
An off-duty law-enforcement officer or armed emergency responder may arrive during a valid emergency. This character is not intended to be a routine stronger attack. Their role is crisis control, evacuation, restraint, arrest, or other appropriate intervention, with force governed by the situation and meaningful consequences for unjustified calls.
|
||
|
||
## Core Systems
|
||
|
||
- **NPC behavior:** NPCs have different motivations, temperaments, compliance levels, and reactions to the player’s approach.
|
||
- **Access verification:** Recognition, wristbands, IDs, tickets, credentials, and guest lists determine who may enter.
|
||
- **Nonverbal deterrence:** Small actions such as raising a hand can resolve low-risk situations without dialogue or force.
|
||
- **Dialogue and tone:** Professional, friendly, firm, or suspicious approaches affect outcomes.
|
||
- **Escalation:** The player chooses the lowest effective response.
|
||
- **Radio assistance:** Calls require useful information and may take time to arrive.
|
||
- **Evidence:** Body-camera records support shift review and accountability.
|
||
- **Crowd reaction:** Aggressive behavior, visible weapons, and emergency response can create panic or attract a crowd.
|
||
- **Reputation:** Peaceful resolutions, accurate reports, low property damage, and justified calls improve performance; unnecessary confrontations and false reports reduce it.
|
||
- **Shift review:** The player receives feedback on access decisions, escalation choices, public complaints, injuries, and security outcomes.
|
||
|
||
## 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.
|
||
|
||
```text
|
||
Venue Scenario / Rules
|
||
|
|
||
v
|
||
Shift Coordinator -----> Event Scheduler
|
||
| |
|
||
v v
|
||
NPC Simulation <---------- Interaction System
|
||
| |
|
||
v v
|
||
Access Verification ----> Escalation / Response
|
||
| |
|
||
+-------------> Reputation / Evidence
|
||
|
|
||
v
|
||
Shift Review
|
||
```
|
||
|
||
The architecture maps onto Godot 4 nodes, scenes, and custom resources as described in [Tech Stack](#tech-stack). See the full arc42-style outline in [Architecture](#architecture) and the decisions in [`docs/adr/`](docs/adr/).
|
||
|
||
## Tech Stack
|
||
|
||
- **Engine:** Godot Engine 4.x
|
||
- **Language:** GDScript
|
||
- **Architecture:** Venue-driven simulation using nodes, scenes, and custom `Resource`-based scenario data
|
||
- **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
|
||
- **Testing:** GUT (Godot Unit Test) in headless mode
|
||
- **Source control:** git with GitHub Actions for headless tests and later desktop exports
|
||
- **Targets:** Windows, Linux, and macOS desktop first; web later
|
||
|
||
### Setup
|
||
|
||
1. Download the Godot 4.3 editor (official build) and put `godot` on your PATH.
|
||
2. Open or run the project from this directory.
|
||
|
||
### Run and Test
|
||
|
||
```bash
|
||
# Open in the editor
|
||
godot --editor --path .
|
||
|
||
# Run the game
|
||
godot --path .
|
||
|
||
# Headless smoke boot (120 frames then exit)
|
||
godot --headless --path . --quit-after 120
|
||
|
||
# Run all unit tests headlessly (exit code 0 = pass)
|
||
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
|
||
```
|
||
|
||
The unit test runner is the project's own lightweight harness (no editor plugin required) so CI can run it without the editor.
|
||
|
||
### Controls
|
||
|
||
| Input | Action |
|
||
|---|---|
|
||
| W/A/S/D + mouse | Move and look |
|
||
| Esc | Release / capture mouse |
|
||
| Q | Polite direction (Level 1) |
|
||
| 1 / 2 / 3 | Simple gestures: raise hand, point, head shake (Level 1) |
|
||
| 4 | Formal warning (Level 2) |
|
||
| 5 | Blocking and positioning (Level 3) |
|
||
| 6 | Security assistance radio (Level 4) |
|
||
| R | Emergency radio, hold on-screen button ~1.6s (Level 5) |
|
||
| E | Inspect access artifacts / close inspection |
|
||
| A / D | Allow / deny entry during inspection |
|
||
| F | Toggle debug overlay |
|
||
|
||
## Architecture
|
||
|
||
This section follows the structure of the arc42 architecture documentation template.
|
||
|
||
### 1. Introduction and Goals
|
||
|
||
#### Functional goals
|
||
|
||
- Simulate believable security work at multiple public-facing venues.
|
||
- Provide clear, low-pressure deterrence options before verbal or physical escalation.
|
||
- Make access verification a meaningful gameplay decision.
|
||
- Support distinct NPC behaviors and scenario events.
|
||
- Make emergency response rare, consequential, and justified by observable danger.
|
||
- Provide shift-level feedback so players can learn from decisions.
|
||
|
||
#### Quality goals
|
||
|
||
- **Clarity:** Players should understand why an NPC is allowed, denied, or escalated.
|
||
- **Extensibility:** New venues should reuse shared systems and primarily provide configuration and content.
|
||
- **Testability:** Rules and outcomes should be testable without rendering or real-time input.
|
||
- **Consistency:** Similar situations should follow predictable venue and escalation rules.
|
||
- **Respectful representation:** Mental-health crises and public interactions should not be reduced to stereotypes or treated as automatic threats.
|
||
|
||
### 2. Constraints
|
||
|
||
- The first implementation should be small enough for a playable vertical slice.
|
||
- The engine is Godot 4 with GDScript; the prototype has not yet been implemented.
|
||
- Venue-specific policies must be configurable rather than hard-coded into individual NPCs.
|
||
- The game must preserve the de-escalation-first design described in [`PLAN.md`](PLAN.md).
|
||
- The project uses the repository workflow described in [`AGENTS.md`](AGENTS.md).
|
||
|
||
### 3. Context and Scope
|
||
|
||
The player interacts with NPCs, venue entrances, access artifacts, equipment, staff, and response services. The game itself owns the simulated world, rules, scoring, events, and shift review. External services are currently out of scope; radio, body camera, and emergency response are simulated systems.
|
||
|
||
### 4. Solution Strategy
|
||
|
||
- Use a shared simulation core with venue-specific scenario data.
|
||
- Represent NPC behavior using state machines or behavior trees with configurable traits.
|
||
- Model escalation as explicit, auditable state transitions.
|
||
- Separate access verification from NPC identity and presentation details.
|
||
- Keep scoring and reputation event-driven so every action can be reviewed.
|
||
- Use authored scenario events alongside procedural routine traffic.
|
||
- Make the first playable target one venue and one complete shift before adding breadth.
|
||
|
||
### 5. Building Block View
|
||
|
||
#### Level 1: Major components
|
||
|
||
- **Presentation layer:** Camera, UI, prompts, interaction feedback, queues, and shift review.
|
||
- **Input and interaction layer:** Player gestures, dialogue choices, access checks, equipment use, and radio controls.
|
||
- **Simulation layer:** NPC movement, perception, intent, navigation, crowd behavior, and venue state.
|
||
- **Rules layer:** Access policy, escalation policy, prohibited items, response thresholds, and venue configuration.
|
||
- **Incident layer:** Incident lifecycle, evidence, radio reports, consequences, reputation, and review.
|
||
- **Content layer:** Venue definitions, NPC profiles, dialogue, events, visual/audio assets, and shift schedules.
|
||
|
||
#### Level 2: Key components
|
||
|
||
- `ShiftCoordinator` starts, advances, and ends a shift.
|
||
- `VenueScenario` provides venue rules, locations, event pools, and access policies.
|
||
- `NPCController` manages an NPC’s intent, movement, compliance, and reaction.
|
||
- `InteractionSystem` resolves gestures, dialogue, warnings, and physical positioning.
|
||
- `AccessVerifier` evaluates recognition, wristbands, IDs, tickets, credentials, and guest lists.
|
||
- `EscalationManager` tracks the current response level and available actions.
|
||
- `RadioSystem` receives reports and schedules security or emergency responses.
|
||
- `IncidentRecorder` stores actions, observations, evidence, and outcomes.
|
||
- `ReputationEvaluator` converts incidents and shift outcomes into performance feedback.
|
||
- `CrowdSystem` models queues, attention, congestion, and public reaction.
|
||
- `ShiftReview` presents decisions, consequences, and improvement opportunities.
|
||
|
||
### 6. Runtime View
|
||
|
||
#### Routine interaction
|
||
|
||
1. An NPC selects or receives an intent such as taking a photo, entering, waiting, or trespassing.
|
||
2. The player observes the NPC and chooses whether to intervene.
|
||
3. A gesture or verbal interaction changes the NPC’s state.
|
||
4. The NPC complies, negotiates, refuses, or escalates.
|
||
5. The rules layer validates access and determines available next actions.
|
||
6. The incident recorder stores the interaction.
|
||
7. Reputation and crowd systems react to the outcome.
|
||
|
||
#### Access check
|
||
|
||
1. The player stops or receives an approaching person.
|
||
2. The player recognizes the person or inspects a wristband, ID, credential, ticket, or guest-list record.
|
||
3. The access verifier checks the artifact against the venue policy.
|
||
4. The player admits, redirects, holds, or refuses entry.
|
||
5. The decision is recorded for shift review.
|
||
|
||
#### Emergency response
|
||
|
||
1. NPC behavior crosses the configured immediate-threat threshold.
|
||
2. The player holds and confirms the emergency-radio action.
|
||
3. The player submits a concise report describing location and behavior.
|
||
4. The response system dispatches an appropriate responder.
|
||
5. Crowd, venue, reputation, and incident systems apply consequences.
|
||
6. The shift review evaluates whether the call was justified.
|
||
|
||
### 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.
|
||
|
||
Future options include external analytics, cloud saves, or replay sharing, but they are not part of the initial architecture.
|
||
|
||
### 8. Cross-Cutting Concepts
|
||
|
||
- **Event-based incident recording:** Important actions emit records consumed by evidence, reputation, and review systems.
|
||
- **Data-driven venue rules:** Access, escalation, equipment, and event differences live in scenario data.
|
||
- **State transitions:** NPCs, incidents, and shifts expose explicit states for debugging and testing.
|
||
- **Accessibility:** Input alternatives should exist for gestures, dialogue, visual alerts, and audio cues.
|
||
- **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.
|
||
|
||
### 9. Architecture Decisions
|
||
|
||
Architecture decisions are recorded as ADRs:
|
||
|
||
- [ADR-0001: Venue-driven simulation architecture](docs/adr/0001-venue-driven-simulation-architecture.md)
|
||
- [ADR-0002: De-escalation-first escalation model](docs/adr/0002-de-escalation-first-escalation-model.md)
|
||
- [ADR-0003: Explicit access-verification system](docs/adr/0003-explicit-access-verification-system.md)
|
||
- [ADR-0004: Local single-player first](docs/adr/0004-local-single-player-first.md)
|
||
- [ADR-0005: Event-based incident recording](docs/adr/0005-event-based-incident-recording.md)
|
||
- [ADR-0006: Godot 4 with GDScript](docs/adr/0006-godot-4-gdscript.md)
|
||
|
||
### 10. Quality Requirements
|
||
|
||
| Requirement | Target |
|
||
| --- | --- |
|
||
| Player comprehension | Players can identify the reason for an access or escalation decision through UI and feedback. |
|
||
| Response proportionality | Routine NPC behavior should be resolvable without emergency response. |
|
||
| Extensibility | A new venue can be added primarily through scenario data and content. |
|
||
| Performance | The target venue should support a believable crowd without harming input or simulation responsiveness. |
|
||
| Testability | Access and escalation rules can be tested independently of presentation. |
|
||
| Accessibility | Core actions are available through clear input alternatives and readable feedback. |
|
||
|
||
### 11. Risks and Technical Debt
|
||
|
||
- NPC behavior may feel artificial if traits and reactions are too deterministic.
|
||
- Crowd simulation may become expensive around busy studio or comedy-club entrances.
|
||
- Access verification can become frustrating if the UI does not clearly show what the player is checking.
|
||
- 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.
|
||
|
||
### 12. Glossary
|
||
|
||
- **Access artifact:** A wristband, ID, ticket, credential, or other item used to verify entry.
|
||
- **Authorized person:** Someone permitted to enter under the current venue policy.
|
||
- **Door person:** The entrance security worker in The Joke Shop scenario.
|
||
- **Incident:** A recorded interaction or event requiring player judgment.
|
||
- **NPC:** Non-player character.
|
||
- **Scenario:** A venue-specific configuration of rules, content, locations, and events.
|
||
- **Shift:** One playable work period, normally 10–15 minutes.
|
||
- **Simple deterrence:** A low-pressure gesture such as raising a hand, making eye contact, or pointing.
|
||
|
||
## Project Documentation
|
||
|
||
- [`PLAN.md`](PLAN.md) — Game design plan and scenario details.
|
||
- [`AGENTS.md`](AGENTS.md) — Development and collaboration workflow.
|
||
- [`TODO.md`](TODO.md) — Active checkbox task list, when created.
|
||
- [`DONE.md`](DONE.md) — Completed task sections, when created.
|
||
- [`MEMORY.md`](MEMORY.md) — Persistent session notes, when created.
|
||
- [`docs/adr/`](docs/adr/) — Architecture Decision Records.
|
||
|
||
## Development Status
|
||
|
||
Implemented so far:
|
||
|
||
- Godot 4.3 project scaffold, input map, procedural world builder
|
||
- Venue-driven simulation core: `ShiftCoordinator`, `VenueScenario`, `EventScheduler`, `NPCController` + FSM, `AccessVerifier`, `EscalationManager`, `RadioSystem`, `IncidentRecorder`, `ReputationEvaluator`, `CrowdSystem`
|
||
- Three authored scenarios (Hollywood Boulevard building, The Joke Shop, Late Night TV Studio) with access policies, NPC archetypes, and event pools
|
||
- Headless unit tests: 25 passing (access rules, escalation, radio cooldown/battery, NPC reaction determinism, scenario data, full-shift simulation)
|
||
- First-person prototype with interaction HUD, access inspection, radio report form (incl. emergency hold-to-confirm), debug overlay, and shift review
|
||
|
||
Not yet implemented: wand-screening interaction, dispatched responder avatar in the world, dialogue tone picker, localization, audio, editor-based tooling.
|
||
|
||
### Smoke Test Checklist
|
||
|
||
1. `godot --path .` starts the game without script errors.
|
||
2. The guard moves and looks around; the building, steps, and sidewalk are visible.
|
||
3. NPCs spawn and approach the entrance during the first minutes.
|
||
4. Aiming at an NPC shows its archetype and intent in the HUD.
|
||
5. Pressing `Q` produces a reaction log entry and reputation feedback.
|
||
6. `E` opens access inspection showing artifacts and policy result; `A`/`D` record a decision.
|
||
7. `6` opens the assistance form; submitting shows dispatch feedback.
|
||
8. `R` opens the emergency form; the button must be held ~1.6s or the call cancels.
|
||
9. `F` toggles the debug overlay with NPC states and shift stats.
|
||
10. When the shift timer reaches 0, the shift review screen shows grade and incident summary.
|
||
|
||
## Development Workflow
|
||
|
||
Follow [`AGENTS.md`](AGENTS.md): inspect the repository first, record work as checkbox tasks in `TODO.md`, move completed sections to `DONE.md`, update `MEMORY.md` with durable context, and keep this README synchronized with setup and architecture changes.
|