Skip to content
Open

. #36

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
895 commits
Select commit Hold shift + click to select a range
de541fa
Add Mission 5 master completion summary
cliffe Jan 14, 2026
0e5d26e
Fix Mission 5 schema validation errors
cliffe Jan 14, 2026
ece1a34
Enhance Mission 5 scenario with best practices from Mission 1
cliffe Jan 14, 2026
f14a745
Fix Mission 5 critical progression blockers and complete objectives
cliffe Jan 14, 2026
49ae5e5
Add Mission 6 initial design and planning documentation
cliffe Jan 14, 2026
b439330
Complete Mission 6 implementation: Follow the Money
cliffe Jan 14, 2026
6141d43
Initialize Mission 7 design: The Architect's Gambit (branching crisis…
cliffe Jan 14, 2026
d25ad88
Restructure Mission 7 for single-location design (SAFETYNET EOC)
cliffe Jan 14, 2026
d4a1af5
Add Mission 7 scenario.json.erb with shared rooms structure
cliffe Jan 14, 2026
3321843
Add branch-specific crisis terminal room with conditional content
cliffe Jan 14, 2026
a3b6662
Fix JSON encoding: escape multi-line strings properly
cliffe Jan 14, 2026
1841d39
Fix all schema validation issues in Mission 7
cliffe Jan 14, 2026
0da6609
Add Mission 7 Ink dialogue files and development status
cliffe Jan 14, 2026
6a1e9e7
Fix Ink variable declarations and compile 4 dialogue files
cliffe Jan 14, 2026
5d0a2ba
Add session summary for Mission 7 development progress
cliffe Jan 14, 2026
40471e5
Complete all Mission 7 Ink dialogue compilation
cliffe Jan 14, 2026
eb7f058
Add Mission 7 completion summary and final status
cliffe Jan 14, 2026
fc4c52e
Add comprehensive solution guide and update development status
cliffe Jan 14, 2026
b11e7e0
Initialize Mission 8: The Mole - Internal investigation scenario
cliffe Jan 14, 2026
e68a4db
Add Mission 8 scenario.json.erb with complete SAFETYNET HQ layout
cliffe Jan 14, 2026
91fcb05
Add Mission 8 development status tracking
cliffe Jan 14, 2026
53881d5
Fix door and room loading issues with multiple paths
cliffe Jan 14, 2026
80662cf
Add fight option to Derek confrontation in Mission 1
cliffe Jan 14, 2026
d299b8e
Add objective and event emission for hostile Derek defeat
cliffe Jan 14, 2026
3fd1cdc
Remove moralizing tone from fight choice in Derek confrontation
cliffe Jan 14, 2026
6a21147
Add security audit dialogue to Mission 1: First Contact
cliffe Jan 14, 2026
1a8da6d
Add interactive tutorial system for new players
cliffe Jan 14, 2026
b7223af
Refactor MissionsController and enhance mission display
cliffe Jan 14, 2026
5c28743
Update CSS file paths and enhance tutorial system
cliffe Jan 19, 2026
0f6abd2
Moved CODEBASE_EXPLORATION.md and updated LICENSE file
cliffe Feb 10, 2026
dbede74
Move some planning files
cliffe Feb 10, 2026
6ad3cda
Remove old scenario selection HTML and testing guide files
cliffe Feb 10, 2026
321a500
Enhance object unlocking logic, add locked field to containers, and v…
cliffe Feb 10, 2026
b620430
Add locked field to Professor's briefcase in scenario.json.erb
cliffe Feb 10, 2026
95c18a7
Enhance Operation Shatter narrative and reporting mechanics
cliffe Feb 10, 2026
6847fca
Add keyboard controls for choice selection in PersonChatMinigame
cliffe Feb 10, 2026
d1e38ba
Refactor inventory handling to prevent duplicates and clean up game s…
cliffe Feb 10, 2026
fb6e9b6
Enhance character sprite loading and animation handling
cliffe Feb 11, 2026
61afc0a
Refactor character assets and player preferences
cliffe Feb 12, 2026
a84d309
Enhance player combat animations and effects with punch mechanics
cliffe Feb 13, 2026
7cdcc35
feat: Implement three-mode interaction system in HUD
cliffe Feb 13, 2026
b27e603
feat: Add punch interaction mode for player combat and prevent defaul…
cliffe Feb 13, 2026
1b7c112
feat: Enhance inventory management by preventing duplicate items and …
cliffe Feb 13, 2026
e749d70
feat: Simplify NPC hostility conversion by removing manual behavior u…
cliffe Feb 13, 2026
a28e79b
feat: Enhance combat mechanics with knockback and animation improvements
cliffe Feb 13, 2026
40551a2
feat: Improve NPC and player combat interactions with enhanced state …
cliffe Feb 13, 2026
8b97bcd
feat: Add hop effect for player when stepping over items and improve …
cliffe Feb 14, 2026
ba13b6a
feat: Adjust player movement to stop short of NPCs and objects for im…
cliffe Feb 14, 2026
a6458a9
feat: Add sprite padding constants and adjust depth calculations for …
cliffe Feb 15, 2026
6500354
feat: Add new inventory items and enhance NPC item drop logic with te…
cliffe Feb 15, 2026
8fc4321
feat: Enhance item interaction logic to always attempt adding takeabl…
cliffe Feb 15, 2026
ead3b05
feat: Implement wall-aware collision handling for NPCs to prevent pus…
cliffe Feb 15, 2026
af8b0e1
feat: Improve player movement logic to calculate direct path to NPCs …
cliffe Feb 15, 2026
f1ac7ee
feat: Enhance NPC pathfinding and line of sight checks for improved c…
cliffe Feb 15, 2026
2377029
feat: Implement door walkability marking in pathfinding for unlocked/…
cliffe Feb 15, 2026
c0f530c
feat: Update NPC sprite sheets to reflect security guard characters
cliffe Feb 16, 2026
5c4e3c6
feat: Enhance NPC hostile behavior configuration with attack damage a…
cliffe Feb 16, 2026
9b4cb8c
feat: Update NPC behavior configuration to include startHostile flag …
cliffe Feb 16, 2026
8c8fded
feat: Remove startHostile flag from NPC behavior configuration in sce…
cliffe Feb 16, 2026
e18e1d7
feat: Implement dynamic room state management with server synchroniza…
cliffe Feb 16, 2026
dbd532f
feat: Add NPC state management with server synchronization for KO and…
cliffe Feb 17, 2026
3d1570a
feat: Implement strong parameters for room state synchronization and …
cliffe Feb 17, 2026
8dfc5f0
feat: Add player preferences modal for character configuration and en…
cliffe Feb 17, 2026
a5f0b91
feat: Update NPC and avatar configurations for phone interactions and…
cliffe Feb 17, 2026
f30dd7f
Update scenario.json.erb: Change NPC sprite and add closing debrief t…
cliffe Feb 17, 2026
91d4670
fix: update event mapping structure and validation for NPCs
cliffe Feb 18, 2026
11ac3ab
fix: update item ID handling and prevent local state overwrite in roo…
cliffe Feb 18, 2026
b24d707
fix: improve item drop mechanics to ensure accessibility and prevent …
cliffe Feb 18, 2026
c40091e
fix: enhance object interaction system with proximity ghost managemen…
cliffe Feb 18, 2026
bbbe616
fix: refactor item giving and unlock handling for improved async proc…
cliffe Feb 18, 2026
f33e682
fix: enhance inventory management by properly destroying proximity gh…
cliffe Feb 19, 2026
f50fa24
fix: implement interaction range check for improved object interactio…
cliffe Feb 19, 2026
8fa5b15
fix: enhance interaction mechanics by adding player facing direction …
cliffe Feb 19, 2026
cb9be6c
fix: enhance inventory and interaction systems with immediate proximi…
cliffe Feb 19, 2026
416c0b9
fix: adjust punch range and enhance hit detection for player combat s…
cliffe Feb 19, 2026
ad544d4
fix: update module imports to latest versions for improved functional…
cliffe Feb 20, 2026
ffab352
WiP pathfinding
cliffe Feb 20, 2026
ca882f6
fix: update module imports to latest versions for improved functional…
cliffe Feb 20, 2026
16dc908
fix: update NPC pathfinding module version and adjust collision handl…
cliffe Feb 20, 2026
d4ea4cc
fix: update door and NPC pathfinding module versions for improved fun…
cliffe Feb 20, 2026
e963376
fix: update player module version and enhance teleportation cooldown …
cliffe Feb 21, 2026
921b09c
fix: update game over screen styles for consistency and improved aest…
cliffe Feb 21, 2026
9a97e4e
fix: update NPC behavior module version and improve player position h…
cliffe Feb 21, 2026
f3268f1
fix: update combat configurations and debug visuals for improved game…
cliffe Feb 21, 2026
1657520
fix: enhance NPC timed message scheduling with event-based triggering…
cliffe Feb 22, 2026
61d65b6
fix: implement event-based triggering for NPC timed conversations to …
cliffe Feb 22, 2026
d164db4
fix: enhance key drawing by adding a hole in the handle for improved …
cliffe Feb 22, 2026
98a64ee
fix: correct sprite naming inconsistencies and remove unused mappings…
cliffe Feb 22, 2026
aceef91
Add event mapping for locked office door and introduce Crypto Analysi…
cliffe Feb 23, 2026
f1bd9cf
feat: implement server-side TTS for NPC dialogue with caching and val…
cliffe Feb 23, 2026
f29b729
feat: enhance TTS service with language support and update NPC dialog…
cliffe Feb 23, 2026
4adea4a
feat: update NPC voice styles to include regional accents for enhance…
cliffe Feb 23, 2026
67170cf
feat: enhance TTS integration with server fallback, add voice configu…
cliffe Feb 23, 2026
1d25116
Refactor mission briefing dialogue and player name; streamline missio…
cliffe Feb 24, 2026
75a117a
feat: add guard against stale minigame instances in complete method
cliffe Feb 25, 2026
270ba62
Fix RuboCop linter errors to pass CI
cliffe Feb 25, 2026
6fa2807
test: add TTS endpoint and PlayerPreferences controller tests
cliffe Mar 2, 2026
c5537bf
chore: update test log and database after running test suite
cliffe Mar 2, 2026
83da8a5
test: add cross-user authorization and policy unit tests
cliffe Mar 2, 2026
a1acead
chore: untrack generated test log and database files
cliffe Mar 2, 2026
69b4a8c
test: add security tests covering unexercised attack surfaces and bugs
cliffe Mar 2, 2026
bb38840
fix: remove type/name fallbacks from check_container_unlocked (bug 1)
cliffe Mar 2, 2026
67e06ed
fix: strip targetFlags from all client-facing scenario/objectives res…
cliffe Mar 2, 2026
e759c4a
Security: block submittedFlags pre-injection and add locked-room sync…
cliffe Mar 2, 2026
2089ff3
Fix JS CSP violations for Hacktivity platform integration
cliffe Mar 2, 2026
7ce23cd
Add nonces to inline <style> blocks for strict style-src CSP
cliffe Mar 2, 2026
0c65ce2
Document required CSP directives in HACKTIVITY_INTEGRATION.md
cliffe Mar 2, 2026
3f92199
Update Phase 11 CSP guidance in planning notes integration guide
cliffe Mar 2, 2026
75903e7
Add CSP troubleshooting and updated verification checklist to integra…
cliffe Mar 2, 2026
d7e3598
Fix Hacktivity integration bugs in Game model
cliffe Mar 2, 2026
f0147e2
feat: TTS mouth animation via Web Audio API noise gate
cliffe Mar 2, 2026
04e9255
refactor: switch mouth animation to 2×2 talk spritesheet
cliffe Mar 2, 2026
18ded30
feat: add missing sound effects to minigames and expose playUISound g…
cliffe Mar 2, 2026
b91b64c
feat: add CC0 Wilhelm scream and body fall sounds for KO events
cliffe Mar 2, 2026
f910138
feat: add 3 CC0 sounds for keypad beep, hit impact, and card scan
cliffe Mar 2, 2026
99601a4
feat: add punch swipe sounds for jab and cross attacks
cliffe Mar 2, 2026
0b5502b
feat: add gender-matched grunt sounds on hit for NPCs and player
cliffe Mar 2, 2026
372de76
feat: play item pickup sound when receiving item from NPC
cliffe Mar 2, 2026
d97f49e
fix: improve lockpicking sound design using existing sounds better
cliffe Mar 2, 2026
238d0e2
fix: remove binding pin highlight sound
cliffe Mar 2, 2026
c6626fd
fix: use playUISound for HUD mode cycle click sound
cliffe Mar 2, 2026
50a1670
Add Agent 0x99 reactions to NPC attacks and KOs in mission 1
cliffe Mar 2, 2026
b64dffe
Extend NPC attack/KO reactions to Sarah and Maya in mission 1
cliffe Mar 2, 2026
2468992
Add planted evidence, Kevin confrontation, and wrongful-arrest path f…
cliffe Mar 2, 2026
cbc587c
Fix scenario validation errors: task type and missing conversationMode
cliffe Mar 2, 2026
d8c8247
Fix anomaly report sign-off to be technically accurate
cliffe Mar 2, 2026
5870df6
Fix report sign-off to reflect actual org structure
cliffe Mar 2, 2026
51bd7f2
feat: allow scenario to define items on specific tables via tableItems
cliffe Mar 2, 2026
38003fa
feat: support dynamic table creation with custom sprite and coordinates
cliffe Mar 2, 2026
7e16569
fix: correct table item vertical positioning; handle floor-layer item…
cliffe Mar 2, 2026
6b14b10
feat: allow explicit x/y coordinates on any scenario item
cliffe Mar 2, 2026
9ac4fde
fix: update sprite references for female spy and office worker animat…
cliffe Mar 3, 2026
ccc108f
fix: prevent ghost sprite re-creation after item pickup
cliffe Mar 3, 2026
3bfc4e8
docs: warn that rooms.js import version must match across all files
cliffe Mar 3, 2026
cdf44b3
Fix north/south door collision to match wall profile
cliffe Mar 3, 2026
bb2ed36
fix: clamp task progress to be within [0, maxProgress] bounds
cliffe Mar 3, 2026
612e989
fix: update room types and adjust item positions for better gameplay …
cliffe Mar 3, 2026
8eb42fa
fix: adjust door sprite depth calculations for accurate positioning
cliffe Mar 3, 2026
42c0a75
feat: add new sound effects and update character sprites for improved…
cliffe Mar 4, 2026
86ac95e
Refactor room assets and NPC dialogue for improved gameplay experience
cliffe Mar 4, 2026
88d049e
feat: add new session functionality to create a fresh game record whi…
cliffe Mar 4, 2026
9a7596a
feat: add mission session tracking and update game session loading logic
cliffe Mar 4, 2026
a9a639c
Add new office room variants and update room types
cliffe Mar 4, 2026
a8f4edc
Refactor scenario elements and enhance room definitions
cliffe Mar 6, 2026
6b46d4e
Server room move
cliffe Mar 6, 2026
afe35ca
Remove the wonky teleport effect through side doors
cliffe Mar 6, 2026
195537a
fix: clean up input blockers and re-enable interactivity for key sele…
cliffe Mar 6, 2026
a8cf2fe
fix: update interaction distance calculation and adjust NPC position …
cliffe Mar 6, 2026
9f584eb
fix: enhance door corridor handling with direction support and unlock…
cliffe Mar 6, 2026
42ac66b
fix: update collision handling for side doors to use thin bars and pr…
cliffe Mar 6, 2026
859d010
fix: enhance note removal process by destroying proximity ghosts and …
cliffe Mar 6, 2026
4243af2
fix: implement session persistence for notes and global variables, en…
cliffe Mar 6, 2026
5d4d2c1
fix: adjust volume for keypad beep sound in UI sound manager
cliffe Mar 6, 2026
3145939
fix: enhance room state synchronization by using correct room IDs for…
cliffe Mar 6, 2026
49f1c2b
fix: adjust timing for talk frame animation in portrait rendering
cliffe Mar 6, 2026
c4181b2
fix: update female scientist talk animation image
cliffe Mar 6, 2026
2321678
fix: update room versioning across modules to ensure consistency and …
cliffe Mar 7, 2026
5d1764f
fix: update room versioning across modules to ensure consistency and …
cliffe Mar 7, 2026
3af2a88
fix: update room versioning across modules to ensure consistency and …
cliffe Mar 7, 2026
c528743
fix: remove male nerd talk animation and add server room ventilation …
cliffe Mar 7, 2026
ad80df2
Add music widget and controller for enhanced audio management
cliffe Mar 7, 2026
87cada9
feat: implement music widget to replace Spotify button for enhanced a…
cliffe Mar 7, 2026
66ec28c
feat: add scenario music event handling for dynamic audio management
cliffe Mar 8, 2026
e1d277b
feat: enhance music event conditions to utilize global variables for …
cliffe Mar 9, 2026
fb5aac4
feat(music): add victory playlist and visualiser toggle
cliffe Mar 9, 2026
28f868a
feat: update RFID icon references to use NFC waves icon and add new m…
cliffe Mar 9, 2026
6807e8d
Update audio files
cliffe Mar 9, 2026
86ce2ef
style(minigames): adjust positioning and remove border from minigame …
cliffe Mar 9, 2026
b230503
feat: enhance button styles and add CRT effect for session overlay bu…
cliffe Mar 9, 2026
39aa9b7
feat(music): add multiple new music tracks to enhance game atmosphere
cliffe Mar 9, 2026
ddd95cc
Enhance first contact scenario with new tasks, aims, and NPC interact…
cliffe Mar 11, 2026
bc357ad
Enhance scenario tasks with optional attributes and unlock conditions
cliffe Mar 12, 2026
747af01
Refactor scenario.json.erb: Update takeable status for security repor…
cliffe Mar 12, 2026
03fdd61
Add event handling for framing evidence seen in first contact scenario
cliffe Mar 12, 2026
1b1a8e2
Refactor message for event_framing_evidence_seen: Simplified language…
cliffe Mar 12, 2026
1deeced
Refactor event mappings in scenario.json.erb to remove unnecessary co…
cliffe Mar 12, 2026
4498406
Refactor event mapping validation in validate_scenario.rb: Remove tar…
cliffe Mar 12, 2026
6f82b51
Refactor container minigame styles: Add flexbox layout for desktop ic…
cliffe Mar 12, 2026
965b5ad
Refactor container image URL handling: Introduce getContainerImageUrl…
cliffe Mar 12, 2026
58b1efa
Enhance TTS functionality: Add scenario name support in TtsService fo…
cliffe Mar 12, 2026
6454c65
Add quota exhaustion handling in TtsService and TtsBatchProcessor
cliffe Mar 12, 2026
b4273b6
Implement pagination for "OTHER SESSIONS" in game view
cliffe Mar 12, 2026
a976102
Refactor interaction system: Simplify interaction scoring by removing…
cliffe Mar 12, 2026
51f4a11
Enhance interaction system: Modify consider function to accept a cust…
cliffe Mar 12, 2026
14d8d19
Add door signs to various rooms in scenario.json.erb for improved nav…
cliffe Mar 12, 2026
112341a
Adjust door rendering depth for E/W doors to align with wall-layer, e…
cliffe Mar 12, 2026
0d2cd41
Remove unnecessary whitespace for cleaner code and improved readabili…
cliffe Mar 12, 2026
13ba8b1
Refactor scenario.json.erb: Remove trailing whitespace from text fiel…
cliffe Mar 13, 2026
8d74b3c
Add door interaction handling: Implement logic to check for door spri…
cliffe Mar 13, 2026
6522e03
Enhance objectives management: Unlock parent aims upon task completio…
cliffe Mar 13, 2026
008bf7d
Add HUD info label: Implement dynamic label for displaying door signs…
cliffe Mar 13, 2026
0d15d06
Add N/S door corner block handling: Implement logic to track and appl…
cliffe Mar 13, 2026
96257a4
Refactor HUD tooltip handling: Remove tooltip elements from inventory…
cliffe Mar 13, 2026
b83cec9
Enhance HUD info label styling: Add max-width, overflow handling, and…
cliffe Mar 13, 2026
e03bcd7
Remove music button label from MusicWidget for cleaner UI presentation.
cliffe Mar 13, 2026
0e0a4b0
Enhance lockpicking minigame responsiveness: Adjust canvas size and c…
cliffe Mar 13, 2026
e46f750
Remove music button label styles for cleaner UI presentation
cliffe Mar 13, 2026
7ac5962
Adjust player door interaction positioning: refine target Y calculati…
cliffe Mar 13, 2026
03e5e5e
Refactor door interaction range: centralize DOOR_INTERACTION_RANGE co…
cliffe Mar 13, 2026
ad3d5b8
Update NPC sprite and email text: change spriteSheet for security gua…
cliffe Mar 13, 2026
bad74a3
Update NPC sprite and clear email text: change spriteSheet from offic…
cliffe Mar 13, 2026
1a35ba7
Update TTS controller tests: Modify mock service expectations to incl…
cliffe Mar 13, 2026
1fe0fdd
Refactor CyberChef task and messaging flow
cliffe Mar 16, 2026
f76df28
Enhance ObjectivesPanel: Implement collapsible aim sections with togg…
cliffe Mar 16, 2026
dd3b692
Adjust keypad beep volume in playUISound function for improved audio …
cliffe Mar 16, 2026
6857b34
Implement direct interaction for previously unlocked objects, bypassi…
cliffe Mar 16, 2026
0d69f1e
Filter out phone NPCs from processing in TtsBatchProcessor
cliffe Mar 16, 2026
3857517
Revise Maya's dialogue for clarity and detail in the informant reveal…
cliffe Mar 16, 2026
e98bbd2
Add comprehensive Minigame System Design Reference documentation
cliffe Mar 18, 2026
b296e01
Refactor notes structure in scenario.json.erb to group related items …
cliffe Mar 18, 2026
796ba84
Increase bottom padding for file content and observations sections to…
cliffe Mar 19, 2026
fd40733
Increase maximum text length limit for NPC interactions from 500 to 1…
cliffe Mar 19, 2026
cb156ff
Add ambientVolume to room data and enhance cipher message handling in…
cliffe Mar 19, 2026
b66c918
Clear stale container return state on cleanup to prevent incorrect na…
cliffe Mar 19, 2026
22c680d
Enhance NPC dialogue options and update scenario text for clarity and…
cliffe Mar 19, 2026
52df668
Refactor scenario objects: Rename Patricia's Safe to Briefcase, updat…
cliffe Mar 19, 2026
256f74a
Add multiple audio files for first contact TTS cache
cliffe Mar 20, 2026
debfd58
Refactor conversation options in Agent 0x99's dialogue for clarity an…
cliffe Mar 20, 2026
a2b8d71
Add new audio files for first contact in TTS cache
cliffe Mar 21, 2026
f105ee6
Refactor small office room JSON and TMJ files: update object position…
cliffe Mar 21, 2026
056144d
Enhance first contact scenario with new tasks and narrative elements
cliffe Mar 21, 2026
b9f8119
Add multiple new audio files for first contact TTS cache
cliffe Mar 21, 2026
795c98d
Adjust object positions in small office room JSON and TMJ files for i…
cliffe Mar 21, 2026
819786a
Enhance flag submission and validation system
cliffe Mar 21, 2026
642d0e1
Refactor player preferences CSS: remove body styles for improved cust…
cliffe Mar 21, 2026
a77543c
Enhance minigame framework: prevent player movement when a minigame o…
cliffe Mar 21, 2026
3cdeb17
Enhance NPC interaction logic: prevent interaction with hostile NPCs …
cliffe Mar 21, 2026
8683946
Add first contact scenario and enhance debriefing mechanics
cliffe Mar 23, 2026
c4ee050
Add new audio files for first contact TTS cache
cliffe Mar 23, 2026
ef85add
Enhance flag reward processing and update launch code references in s…
cliffe Mar 23, 2026
acbb131
Enhance sprite handling in room creation: allow scenario-specific tex…
cliffe Mar 23, 2026
6d73346
Implement NPC removal functionality: add server-side and client-side …
cliffe Mar 23, 2026
e6c6b1c
Refactor opening briefing dialogue for clarity and consistency
cliffe Mar 24, 2026
d49903c
Update NPC dialogue and scenario details: correct Sarah's name, clari…
cliffe Mar 24, 2026
743a6d0
Enhance scenario details and task mechanics in m01_first_contact
cliffe Mar 24, 2026
a23d720
Refactor scenario tasks and unlock conditions in m01_first_contact
cliffe Mar 24, 2026
b9b0cf3
Add new audio files for m01_first_contact scenario
cliffe Mar 24, 2026
b26ee19
Refactor scenario tasks and update character assets in m01_first_contact
cliffe Mar 25, 2026
e4f8738
Add new audio files for m01_first_contact scenario
cliffe Mar 25, 2026
1a3a0d0
Refactor agent name from "Agent 0x99" to "Agent HaX" in briefing dial…
cliffe Mar 26, 2026
34250e6
Refactor character names and dialogue for consistency
cliffe Mar 27, 2026
636e324
Add new audio files for m01_first_contact scenario
cliffe Mar 27, 2026
2ff82c9
Refactor task completion logic in first contact scenario
cliffe Mar 27, 2026
1c7b44b
Update target flags and enhance event conditions for task completion …
cliffe Mar 27, 2026
acfff56
Enhance scenario schema and validation script
cliffe Mar 27, 2026
ca983e4
Update card names and safe combination details in m01_first_contact s…
cliffe Mar 27, 2026
5c5d4c2
Refactor text formatting in scenario.json.erb for improved readabilit…
cliffe Mar 27, 2026
fcbb200
Add narrator support with voice configuration and text validation adj…
cliffe Mar 27, 2026
fd15d3d
Remove redundant notes on Network Backdoor Analysis from m01_first_co…
cliffe Mar 27, 2026
4771f12
Improve choice selection handling by ensuring only visible options ar…
cliffe Mar 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
196 changes: 196 additions & 0 deletions .claude/skills/break-escape-dungeon-graph/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
---
name: break-escape-dungeon-graph
description: Produces a Boss Keys-style dungeon dependency graph from a Break Escape scenario file (.json or .json.erb). Use this skill whenever the user pastes or uploads a Break Escape scenario file and asks for a diagram, graph, map, dependency chart, or visual overview of the level structure. Also trigger when the user asks to "visualise the mission", "show the lock and key structure", "draw the dungeon graph", or "update the diagram" after editing a scenario. The skill analyses rooms, objects, locks, keys, NPCs, items, objectives, and VM challenges, then renders an interactive scrollable SVG using the GMTK Boss Keys notation adapted for Break Escape.
---

# Break Escape dungeon graph skill

Produces a scrollable, interactive Boss Keys-style dependency graph from a Break Escape scenario file. Every lock shows what it requires; every key/item shows what it unlocks; VM challenges appear as obstacles with flag keys.

## Step 0 — parse the scenario

The user will paste or upload a scenario file. It may be JSON or JSON with ERB template tags (`<%= ... %>`). Strip ERB tags before parsing — replace `<%= ... %>` expressions with a readable placeholder (e.g. `"[ERB: base64_encode(...)]"`). Then extract:

**Rooms** (`scenario.rooms`) — each room has:
- `id`, `locked`, `lockType`, `requires`, `door_sign`, `connections`
- `objects` array — safes, PCs, filing cabinets, terminals, notes, items
- `npcs` array — characters who hold items or act as locks/keys

**Objects to classify:**
- `type: "safe"` or `type: "pc"` with `locked: true` → **lock nodes**
- `type: "key"` → **key node**
- `type: "lockpick"` / `type: "keycard"` → **key nodes**
- `type: "notes"` / `type: "text_file"` with meaningful content → **item nodes** (amber)
- `type: "workstation"` (CyberChef etc.) → **tool node** (amber diamond)
- `type: "vm-launcher"` → **VM obstacle node** (blue rect)
- `type: "flag-station"` → used to identify flag keys (purple diamonds)

**NPCs to classify:**
- NPCs with `itemsHeld` → each held item is a key node reachable by talking to or KO-ing the NPC
- NPCs with `storyPath` → conversation gate (treat as a soft lock if tied to an objective task)

**Objectives** (`scenario.objectives`) — extract:
- `unlockCondition: { aimCompleted }` → hard **objective gate** bars (amber)
- `tasks` with `type: "enter_room"` → room entry depends on prior aim
- `tasks` with `type: "submit_flags"` → VM flag submissions
- `tasks` with `status: "locked"` and `unlockCondition` → sequenced VM challenges

**VM flag dependencies** (`scenario.objectives → capture_technical_evidence → tasks`):
- Each `submit_flags` task maps to a VM challenge obstacle + flag key pair
- If a task has `unlockCondition: { flagSubmitted }`, it is sequentially gated on a prior flag

## Step 1 — build the dependency graph (mental model)

Before drawing, construct a logical dependency list:

```
For each room R:
If R.locked:
create LOCK node for R's door
requires: R.requires (key_id or PIN or rfid)
find the object/NPC that provides that key → create KEY node pointing to LOCK

For each object O in each room:
If O.locked:
create LOCK node for O
requires: O.requires
find source of that requirement → feed arrow from KEY to LOCK
If O is a key/lockpick/keycard/workstation/notes (takeable):
create ITEM/KEY node
draw arrow from ROOM (or NPC) to ITEM

For each NPC N with itemsHeld:
create KEY diamond for N
label with NPC name + items held
connect to: room that NPC is in (player must reach room first)

For objective gates:
place GATE bar above the node it gates
label with the aim name that must complete
```

## Step 2 — assign visual roles

Use GMTK Boss Keys notation adapted for Break Escape:

| Element | Shape | Colour class |
|---|---|---|
| Room / location | Ellipse | `c-teal` |
| Key / item / NPC unlock | Diamond (`<polygon>`) | `c-coral` |
| Physical lock (door, safe, PC) | Rectangle | `c-coral` |
| Physical item (notes, wordlist, tool) | Diamond | `c-amber` |
| CyberChef / decode tool | Diamond | `c-amber` |
| VM challenge (obstacle) | Rectangle | dark blue (`fill:#0c2040 stroke:#4a90d9`) |
| VM flag (key from VM) | Diamond | `c-purple` |
| Objective gate bar | Thin rect | dark amber (`fill:#2a1800 stroke:#e89030`) |
| Optional node | Any shape with `stroke-dasharray="4 2"` | same ramp, dashed |

**Subtitle rule:** every lock rect must show `requires: [what unlocks it]` as a 12px subtitle. Every key diamond must show the item name + brief note. Keep subtitles ≤ 5 words.

## Step 3 — layout rules

This diagram is always wide. Use a **scrollable HTML wrapper** around a wide SVG:

```html
<style>.sw{overflow-x:auto;width:100%}</style>
<div class="sw">
<svg width="[W]" viewBox="0 0 [W] [H]" style="min-width:[W]px">
...
</svg>
</div>
```

**Width guidelines:**
- Simple linear mission (1 main path): 800px
- Hub-and-spoke with 3 branches: 1100px
- Full mission with VM section + optional branches: 1300px

**Column placement:**
- Main flow runs down the centre column (cx ≈ W/2)
- Left branch (e.g. IT room): cx ≈ 150–200
- Right branch (e.g. manager's offices): cx ≈ W − 200 to W − 150
- Far-right optionals: cx ≈ W − 120
- VM section: spans full width, enclosed in a dashed blue container rect

**Row spacing:** 80px between row centres. Each node is either:
- Ellipse: ry=20, so top=cy−20, bottom=cy+20
- Rect (two-line): height=36, so top=y, bottom=y+36
- Diamond: polygon with half-height 22, so top=cy−22, bottom=cy+22

**Arrow routing rules:**
- Direct vertical connection: `<line>`
- Cross-column feed (dashed, no gate): `<path d="M x1 y1 L x1 ymid L x2 ymid L x2 y2" fill="none">`
- Shortcut (e.g. keycard bypasses main flow): blue dashed `stroke="#4a90d9" stroke-dasharray="5 3"`
- Never route an arrow through a node's interior — use L-bends to route around

**Dashed lines mean:** item feeds a lock elsewhere without gating the main flow. Solid lines mean required dependency.

## Step 4 — VM section layout

Place the VM section below the server room ellipse. Draw a dashed blue container rect around all VM nodes:

```svg
<rect x="[left]" y="[top]" width="[w]" height="[h]" rx="8"
fill="none" stroke="#4a90d9" stroke-width="0.8" stroke-dasharray="6 3"/>
<text class="ts" x="[left+16]" y="[top+14]" dominant-baseline="central" fill="#4a90d9">
SecGen VM environment
</text>
```

For each VM challenge, place:
1. A dark-blue **VM obstacle rect** (`fill:#0c2040 stroke:#4a90d9`) labelled with the challenge name and `requires:` subtitle
2. A vertical arrow down to a **purple flag diamond** labelled with flag number + what it reveals
3. If flag N gates challenge N+1, draw a dashed purple cross-arrow from flag N diamond to challenge N+1 rect

All VM flags converge at the bottom with arrows into the objective gate bar, then into the ENTROPY archive lock.

## Step 5 — legend

Always include a legend bar at the top (y=10–40):

```svg
<g class="c-gray"><rect x="16" y="10" width="[W-32]" height="30" rx="4" stroke-width="0.5"/></g>
```

Legend items (left to right): location oval, key diamond, lock rect, item diamond, VM obstacle rect, VM flag diamond, obj. gate rect, dashed line label, shortcut line label.

## Step 6 — interactivity

Wrap every node group in `<g class="node" onclick="sendPrompt('Tell me about [node name] in this scenario')">`. This lets the user click any node to ask follow-up questions.

## Step 7 — render

Use the `show_widget` visualiser tool with:
- `loading_messages`: 3 messages describing parsing → layout → rendering
- `title`: `[mission_id]_dungeon_graph`
- `widget_code`: the full HTML+SVG string

## Common patterns to recognise

**Kevin Park pattern** — NPC holds lockpick + keycard. The keycard enables a shortcut to the server room (blue dashed line). The lockpick enables picking a lock elsewhere (grey dashed line). Both are separate paths from the same diamond.

**Patricia's briefcase pattern** — locked container inside a room. The container itself is a lock (requires lockpick). Contents are multiple keys (office key + tool). Both content items need separate diamond nodes with arrows going to their respective locks.

**CyberChef pattern** — workstation item that is required to decode encoded notes. Draw an amber diamond for CyberChef. Draw dashed arrows from the encoded item to the CyberChef diamond, and from CyberChef to the decoded result (another item or a PIN).

**Encoded credential pattern** — a note/file whose content is encoded (Base64/ROT13). The raw note is an amber diamond. CyberChef is required to decode it. The decoded output is another amber diamond (e.g. "SSH username (decoded)") which feeds the VM challenge.

**Dual-PIN pattern** — if two locks share the same PIN source, note this in the subtitle of both lock rects. If they have distinct PINs, make sure each lock's subtitle cites its own source.

**Objective gate placement** — place the gate bar immediately above the node it blocks, not above the whole section. Label it: `obj. gate: [aim name] must complete`.

## Output checklist

Before rendering, verify:
- [ ] Every room is an ellipse
- [ ] Every lock rect has a `requires:` subtitle
- [ ] Every key diamond has a name + brief source note
- [ ] No two nodes overlap (check rightmost x + width < next node's x in same row)
- [ ] All arrows route around nodes, not through them
- [ ] VM section has a dashed container rect
- [ ] Flag diamonds show what they reveal/unlock
- [ ] Optional nodes have `stroke-dasharray="4 2"`
- [ ] Objective gate bars appear above the correct node
- [ ] Legend is present and complete
- [ ] Canvas is wide enough — if more than 4 nodes in any row, increase width
- [ ] `fill="none"` on all connector paths
9 changes: 9 additions & 0 deletions .cursor/rules/hacktivity-rules.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
description:
globs:
---

# Your rule content

- You can @ files here
- You can use markdown but dont have to
186 changes: 186 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
# Break Escape: AI Coding Agent Instructions

## Project Overview
Break Escape is a Rails Engine implementing a web-based educational game framework combining escape room mechanics with cyber-physical security learning. Players navigate 2D top-down environments (powered by Phaser.js), collect items, and solve security-themed mini-games aligned to the Cyber Security Body of Knowledge (CyBOK).

### Deployment Modes
Break Escape always runs as a Rails Engine, but operates in two distinct modes:
1. **Standalone Mode**: Local Rails instance with demo user support (development/testing)
2. **Mounted Mode**: Integrated into parent Rails applications like Hacktivity for course management and secure assessment delivery

**Server-Side Validation**: Solution validation is enforced server-side. Client-side validation is for UX and gameplay only; solutions (such as passwords and pins) are verified against solutions on the backend before further game content such as rooms can be accessed.

## Architecture

### Rails Engine Integration
Break Escape is always a Rails Engine, operating in one of two modes:

**Standalone Mode** (Local Development):
- Runs as a self-contained Rails app with demo user support
- Uses `break_escape_demo_users` table for test players
- Scenarios rendered on-demand with ERB template substitution (randomized passwords/PINs)
- State persisted in `break_escape_games` JSONB column

**Mounted Mode** (Production/Hacktivity):
- Mounts into host Rails application (e.g., Hacktivity) via `config/routes.rb`
- Uses host app's `current_user` via Devise for player authentication
- Game frontend served from `app/views/` and `public/` assets
- Scenario data and player progress persisted via Rails models (`app/models/`)
- Solution validation endpoints exposed as Rails controllers (`app/controllers/`)
- Admin/instructor UI for scenario management runs in the host application
- **Server-side validation of all solutions** prevents client-side tampering and ensures assessment integrity

### Core Systems (Sequential Initialization)
1. **Game Engine** (`js/core/game.js`): Phaser.js initialization, scene management (preload → create → update)
2. **Rooms** (`js/core/rooms.js`): Dynamic room loading from JSON scenarios, depth layering by Y-position + layer offset
3. **Player** (`js/core/player.js`): Character sprite with pathfinding, keyboard/mouse controls, animation system
4. **Systems** (`js/systems/`): Modular subsystems (interactions, inventory, doors, collisions, biometrics)
5. **Mini-games** (`js/minigames/`): Framework-based educational challenges (lockpicking, password, biometrics, etc.)

### Data Flow
- **Scenarios** (JSON) → loaded into `window.gameScenario` → populate rooms/objects → create interactive environment
- **Player Actions** → interaction system checks proximity → triggers object interactions or mini-games
- **Game State** stored in `window.gameState`: `{ biometricSamples, bluetoothDevices, notes, startTime }`

### Global Window Object
Break Escape attaches critical runtime objects to `window` for cross-module access (no complex bundling):
```javascript
window.game // Phaser game instance
window.gameScenario // Current scenario JSON
window.player // Player sprite
window.rooms // Object of room data
window.gameState // Persistent game state
window.inventory // Player's collected items
```

## Key Patterns & Conventions

### Room System & Depth Calculation
**Every object's depth = worldY + layerOffset** (not Z-index). This ensures correct perspective in top-down view:
- Walls: `roomY + 0.2`
- Interactive Objects: `objectBottomY + 0.5`
- Player: `playerBottomY + 0.5`
- Doors: `doorY + 0.45`

See `js/core/rooms.js` (lines 1-40) for detailed depth hierarchy documentation.

### Object Interactions
1. Objects must have `interactable: true` and `active: true` in scenario JSON
2. Interaction distance: `INTERACTION_RANGE = 64px` (checked every 100ms)
3. Interaction handlers in `js/systems/interactions.js` dispatch to specialized systems:
- Locks: `unlock-system.js` (key-based, password, PIN, biometric)
- Doors: `doors.js` (movement triggers)
- Inventory: `inventory.js` (item collection)
- Biometrics: `biometrics.js` (fingerprint collection/scanning)

### Mini-game Framework
All mini-games extend `MinigameScene` (`js/minigames/framework/base-minigame.js`):
```javascript
// Registration in js/minigames/index.js
MinigameFramework.registerScene('game-name', GameClass);

// Usage
window.MinigameFramework.startMinigame('game-name', { data });
```
Mini-games handle modal display, pause/resume, and return callbacks automatically.

### Inventory System
- Items stored as objects with `id`, `name`, `texture` properties
- Item identifiers created via `createItemIdentifier()` for UI display
- Starting items defined in `startItemsInInventory` array at scenario root level
- Starting items automatically added to inventory on game initialization

### Scenario JSON Structure
```json
{
"scenario_brief": "Mission description",
"endGoal": "What player must accomplish",
"startRoom": "room_id",
"startItemsInInventory": [
{
"type": "object_type",
"name": "Display name",
"takeable": true,
"observations": "Item description"
}
],
"rooms": {
"room_id": {
"type": "room_type",
"connections": { "north": "next_room" },
"objects": [
{
"type": "object_type",
"name": "Display name",
"takeable": false,
"interactable": true,
"scenarioData": { /* unlock conditions */ }
}
]
}
}
}
```

## Essential Development Workflows

### Adding a New Security Challenge
1. Create mini-game class in `js/minigames/{challenge-name}/`
2. Extend `MinigameScene` base class (see `js/minigames/framework/base-minigame.js`)
3. Register in `js/minigames/index.js` and export
4. Trigger from interactions via `window.MinigameFramework.startMinigame()`

### Adding Scenario Content
1. Create `scenarios/{name}.json` with room/object definitions
2. Use existing room types from `assets/rooms/*.json` Tiled files
3. Objects must match registered texture names (loaded in `game.js` preload)
4. Reference scenarios from `scenario_select.html`

### Debugging Game Issues
- **Player stuck/pathfinding**: Check `STUCK_THRESHOLD` (1px) and `PATH_UPDATE_INTERVAL` (500ms) in `constants.js`
- **Object not interactive**: Verify `interactable: true`, `active: true`, and `INTERACTION_RANGE` distance in scenario JSON
- **Depth/layering wrong**: Recalculate depth = `worldY + layerOffset` in `rooms.js` hierarchy
- **Mini-game not loading**: Verify registered in `minigames/index.js` and exported from minigame class

## Project-Specific Patterns

### Tiled Map Integration
Rooms use Tiled editor JSON format (`assets/rooms/*.tmj`). Key workflow:
- Objects stored in `map.getObjectLayer()` collections
- Tiled object GID → texture lookup via tileset registry
- `TiledItemPool` class manages available objects to prevent duplicates

### External Dependencies
- **Phaser.js v3.60**: Game engine (graphics, physics, input)
- **EasyStar.js v0.4.4**: Pathfinding (A* algorithm for player movement)
- **CyberChef v10.19.4**: Embedded crypto tools (iframe-based in laptop minigame)

### URL Versioning Convention
Assets use query string versioning: `import { x } from 'file.js?v=7'` to bust browser cache during development.

### CSS Styling Conventions
Maintain pixel-art aesthetic consistency:
- **Avoid `border-radius`** - All UI elements use sharp, 90-degree corners
- **Borders must be exactly 2px** - This matches the pixel-art tile size (32px tiles = 2px scale factor)
- Examples: buttons, panels, modals, and input fields in `css/*.css`

## Quick Command Reference

### Local Development
```bash
python3 -m http.server # Start local web server (root dir)
# Access: http://localhost:8000/scenario_select.html
```

### Scenario Testing
- Edit scenario JSON directly
- Reload browser (hard refresh if using version queries)
- Test from `scenario_select.html` dropdown

## Files to Read First When Onboarding
1. `README.md` - Project overview and feature list
2. `js/main.js` - Game initialization and global state setup
3. `js/core/game.js` - Phaser scene lifecycle and asset loading
4. `js/core/rooms.js` - Room management and depth layering documentation
5. `scenarios/biometric_breach.json` - Full example scenario structure
6. `js/minigames/framework/minigame-manager.js` - Mini-game architecture
Loading
Loading