mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-21 11:18:08 +00:00
30f0e686d99f91370e1fdf1b785ab66ef204f13a
Created 8 comprehensive Ink scripts for Mission 2 "Ransomed Trust": 1. m02_opening_briefing.ink - Act 1 emergency briefing with Agent 0x99 - Player choice tracking (cautious/aggressive/adaptable approach) - Mission objectives and stakes establishment (47 patients, 12-hour window) - 3-line dialogue rule adherence throughout 2. m02_npc_sarah_kim.ink - Dr. Kim (Hospital CTO) NPC with hub dialogue pattern - Guilt revelation about budget cuts ($85K security vs $3.2M MRI) - Trust/influence system (0-100 scale) - Ransom decision input and scapegoating protection options 3. m02_npc_marcus_webb.ink - Marcus Webb (IT Admin) social engineering target - Trust-based access (keycard vs lockpicking paths) - Password hints and server room access progression - Vindication storyline (protect from scapegoating) 4. m02_terminal_dropsite.ink - VM flag submission interface (4 flags) - Hybrid architecture integration (VM → in-game unlocks) - Progressive intel unlocking system - Ghost manifesto horror reveal integration 5. m02_terminal_ransom_interface.ink - Critical moral choice interface (pay ransom vs manual recovery) - Ghost's persuasion vs Agent 0x99's analysis - Consequence visualization (1-2 vs 4-6 patient deaths) - Secondary decision: hospital exposure - Global variable tracking for debrief callbacks 6. m02_phone_agent0x99.ink - Handler support and tutorial guidance - Contextual hints (guard patrols, lockpicking, passwords, PIN safe) - Encoding tutorial (Base64, ROT13) - Ransom decision counseling (neutral presentation) - Event-triggered knots for game events 7. m02_phone_ghost.ink - Antagonist communication (cold, calculated ideology) - ENTROPY philosophy explanation - Patient death calculation justification - Unrepentant true believer characterization - Post-decision responses (paid vs refused ransom) 8. m02_closing_debrief.ink - Comprehensive outcome acknowledgment - Patient death statistics (2 vs 6 fatalities) - NPC fate tracking (Dr. Kim, Marcus protected/unprotected paths) - Ransom choice validation (utilitarian vs consequentialist ethics) - Hospital exposure consequences - Mission 3 setup (Zero Day Syndicate) - The Architect tease Key Features: - All scripts follow 3-line dialogue rule for pacing - Hub patterns for replayable conversations - Trust/influence systems for NPCs - Proper #exit_conversation tags - Variable tracking for choice callbacks - External variable integration - Event-triggered knot support - Moral complexity without "right" answers Stage 7 Complete: All narrative content ready for implementation.
BreakEscape Rails Engine
Cybersecurity training escape room game as a mountable Rails Engine.
Features
- 24+ cybersecurity escape room scenarios
- Server-side progress tracking with 2-table schema
- Randomized passwords per game instance via ERB
- JIT Ink script compilation for NPC dialogue
- Polymorphic player support (User/DemoUser)
- Pundit authorization
- RESTful API for game state management
- Session-based state persistence
Installation
In your Gemfile:
gem 'break_escape', path: 'path/to/break_escape'
Then:
bundle install
rails break_escape:install:migrations
rails db:migrate
rails db:seed # Optional: creates missions from scenarios
Mounting in Host App
In your config/routes.rb:
mount BreakEscape::Engine => "/break_escape"
Usage
Standalone Mode (Development)
export BREAK_ESCAPE_STANDALONE=true
rails server
# Visit http://localhost:3000/break_escape/
Mounted Mode (Production)
Mount in Hacktivity or another Rails app. The engine will use the host app's current_user via Devise.
Configuration
# config/initializers/break_escape.rb
BreakEscape.configure do |config|
config.standalone_mode = false # true for development
config.demo_user_handle = 'demo_player'
end
Database Schema
break_escape_missions- Scenario metadata (name, display_name, published, difficulty)break_escape_games- Player state + scenario snapshot (JSONB)break_escape_demo_users- Standalone mode only (optional)
API Endpoints
GET /games/:id/scenario- Scenario JSON (ERB-generated)GET /games/:id/ink?npc=X- NPC script (JIT compiled from .ink)GET /games/:id/bootstrap- Initial game dataPUT /games/:id/sync_state- Sync player statePOST /games/:id/unlock- Validate unlock attemptPOST /games/:id/inventory- Update inventory
Architecture
ERB Scenario Generation
Scenarios are stored as .json.erb templates and rendered on-demand with randomized values:
<%= random_password %>- Generates unique password per game<%= random_pin %>- Generates unique 4-digit PIN<%= random_code %>- Generates unique hex code
JIT Ink Compilation
NPC dialogue scripts compile on first request (~300ms):
- Check if
.jsonexists and is newer than.ink - If needed, run
inklecateto compile - Cache compiled JSON for subsequent requests
State Management
Player state stored in JSONB column:
- Current room and unlocked rooms
- Inventory and collected items
- NPC encounters
- Global variables (synced with client)
- Health and minigame state
Testing
rails test
License
AGPL v3 - See LICENSE file for details
Documentation
See HACKTIVITY_INTEGRATION.md for integration guide.
Description
Languages
JavaScript
86.5%
Ink
7%
HTML
2.9%
CSS
2.5%
Ruby
0.9%
Other
0.2%