Fixed all player_name references to use function call syntax player_name().
Also removed invalid === END knot definitions from hub files.
Changes:
- Fixed player_name -> player_name() in all ongoing_conversations.ink files
- Removed === END knot definitions (END is a built-in directive)
- chen_hub.ink now compiles successfully with only warnings
- netherton_hub.ink and haxolottle_hub.ink still have some structural issues to resolve
Status:
✓ chen_hub.ink - compiles successfully
⚠ netherton_hub.ink - has choice nesting errors
⚠ haxolottle_hub.ink - has missing knot targets and variable errors
When using INCLUDE in ink, all knots are brought into the same namespace.
Divert statements should reference knots directly without the file prefix.
Changed:
- chen_hub.ink: -> dr_chen_ongoing_conversations.phase_X_hub
to -> phase_X_hub
- netherton_hub.ink: -> netherton_ongoing_conversations.phase_X_hub
to -> phase_X_hub
- haxolottle_hub.ink: -> haxolottle_ongoing_conversations.phase_X_hub
to -> phase_X_hub
This fixes the "Divert target not found" compilation errors.
Fixed multiple Ink compilation errors:
1. Removed duplicate EXTERNAL and VAR declarations from hub files:
- chen_hub.ink: Removed player_name(), current_mission_id(),
total_missions_completed, and professional_reputation declarations
(already declared in dr_chen_ongoing_conversations.ink)
- netherton_hub.ink: Same removals for netherton context
- haxolottle_hub.ink: Same removals for haxolottle context
2. Fixed EXTERNAL function call syntax in dr_chen_ongoing_conversations.ink:
- Changed {player_name} to {player_name()} in phase hubs and conversation ends
- Fixed 6 instances across phase_2_hub, phase_3_hub, phase_4_hub,
conversation_end_phase2, and conversation_end_phase3
3. Fixed conditional syntax in chen_hub.ink:
- Changed `current_mission_id == "ghost_in_machine"` to
`current_mission_id() == "ghost_in_machine"` with proper brace structure
4. Fixed jump_to_personal_conversations in all hub files:
- Removed non-existent `_with_return` tunnel calls
- Changed to direct diverts to phase_hub knots
- Removed unreachable "return" dialogue
All hub files now properly include the ongoing conversations file and only
declare EXTERNAL variables unique to the hub context.
Fixed two compilation errors:
1. dr_chen_ongoing_conversations.ink line 478: Fixed conditional structure
in phase_2_hub to use proper opening brace and hyphenated first condition
2. chen_hub.ink line 522: Removed invalid '=== END' knot definition
(END is a built-in directive, not a knot to define)
These syntax errors were preventing ink compilation.
All three NPCs (Netherton, Dr. Chen, Haxolottle) are now positioned in the
hq_briefing_room starting room so they are immediately visible when the
scenario loads. Previously they were in separate rooms which caused them
not to appear since the game only loads NPCs for the starting room initially.
Changes:
- Moved all NPC definitions from individual rooms to hq_briefing_room
- Updated npc_location context to "briefing_room" for all NPCs
- Positioned NPCs at (3,3), (6,5), and (7,3) respectively
CRITICAL FIXES:
- Add empty parentheses to all EXTERNAL declarations
* EXTERNAL player_name() instead of EXTERNAL player_name
* EXTERNAL current_mission_id() instead of EXTERNAL current_mission_id
* Fixed in all hub files and personal conversation files
- Fix conditional syntax to require explicit else clauses
* Changed from implicit multi-condition to explicit {- condition: ... - else: ...}
* Fixed in all entry points and hub menus
- Fix player_name references throughout to use function call syntax
* {player_name()} instead of {player_name}
- Fix remaining double-prefix bug in dr_chen file
* npc_npc_chen_rapport -> npc_chen_rapport
FILES UPDATED:
- netherton_hub.ink
- netherton_ongoing_conversations.ink
- chen_hub.ink
- dr_chen_ongoing_conversations.ink
- haxolottle_hub.ink
- haxolottle_ongoing_conversations.ink
These changes fix Ink compiler errors:
- 'Expected declaration of arguments for EXTERNAL, even if empty'
- 'Expected an '- else:' clause here rather than an extra condition'
All files should now compile successfully with inklecate.
NEW SCENARIO: npc-hub-demo-ghost-protocol.json
Comprehensive demonstration scenario featuring:
SAFETYNET HQ LAYOUT:
- Briefing Room (hub with connections to all NPCs)
- Director Netherton's Office (north)
- Dr. Chen's Technical Lab (east)
- Haxolottle's Handler Station (west)
THREE NPCs WITH HUB INTEGRATION:
1. Director Netherton
- Uses netherton_hub.json entry point
- Location: office, Phase: planning
- Respect: 65 (growing trust)
- Has discussed: handbook, leadership
- Holds: Ghost Protocol mission packet
2. Dr. Chen
- Uses chen_hub.json entry point
- Location: lab, Phase: planning
- Rapport: 58, Equipment status: needs_upgrade
- Has discussed: tech philosophy, ENTROPY tech
- Holds: Experimental equipment for Ghost Protocol
* Active Network Camouflage Device
* Quantum-Encrypted Comm Unit
* Enhanced Data Exfiltration Tools
* Technical specifications document
3. Haxolottle (Agent 0x99)
- Uses haxolottle_hub.json entry point
- Location: handler_station, Phase: planning
- Friendship: 35, Operational stress: moderate
- Has discussed: hobbies, axolotl obsession, music
- Holds: Handler support plan + personal note
CONTEXT VARIABLES DEMONSTRATED:
- current_mission_id: "ghost_in_machine"
- mission_phase: "planning" (can change to active/debriefing)
- npc_location: Different for each NPC
- total_missions_completed: 3
- professional_reputation: 15
- equipment_status: needs_upgrade (triggers Chen priorities)
- operational_stress_level: moderate
SCENARIO FEATURES:
- Player starts in briefing room with mission notes
- Can visit each NPC to experience context-aware conversations
- Each NPC shows different topics based on mission phase
- Personal conversations available during planning phase
- Mission-specific briefings ready for Ghost Protocol
- Persistent variables track relationship progression
TESTING THE HUB PATTERN:
This scenario allows testing:
✓ Context-aware topic menus
✓ Personal vs. mission content mixing
✓ Equipment priority system (Chen)
✓ Handler coordination (Haxolottle)
✓ Mission briefing system (Netherton)
✓ Relationship persistence across conversations
✓ Navigation between different NPCs and conversation types
Change mission_phase to "active" to see tactical support options
Change to "debriefing" to see post-mission conversations
Change to "downtime" to focus on personal relationship building
CRITICAL BUG FIXES:
- Fixed double-prefix variable naming bugs in all three NPC files
* npc_npc_netherton_* → npc_netherton_*
* npc_npc_chen_* → npc_chen_*
* npc_chen_npc_chen_* → npc_chen_*
* npc_haxolottle_npc_haxolottle_* → npc_haxolottle_*
NEW ARCHITECTURE:
- Created central hub files for each NPC that mix personal + mission content
* netherton_hub.ink - Director hub with mission briefings & tactical support
* chen_hub.ink - Tech support hub with equipment & experimental tech
* haxolottle_hub.ink - Handler hub with crisis support & coordination
FEATURES:
- Context-aware conversation menus based on:
* current_mission_id - What mission is active
* mission_phase - Planning, active, debriefing, downtime
* npc_location - Where conversation happens
* operational_stress_level - Crisis prioritization (Haxolottle)
* equipment_status - Repair/upgrade priority (Dr. Chen)
- Hybrid approach combines:
* Separate files for modularity (personal vs mission content)
* Context-aware presentation (right topics at right time)
* Helper functions to check topic availability
* Priority-ordered option menus
EXAMPLES:
- Created netherton_mission_ghost_example.ink showing:
* Mission briefing system
* Tactical support during active operations
* Emergency extraction coordination
* Post-mission debriefing with performance evaluation
DOCUMENTATION:
- NPC_HUB_ARCHITECTURE.md - Comprehensive documentation including:
* File structure and organization
* How hub pattern works
* Variable scoping (PERSISTENT, GLOBAL, EXTERNAL)
* Context-aware conversation flow examples
* Pros/cons of different architectural approaches
* Best practices and naming conventions
* Integration requirements for game engine
* Instructions for adding new missions
BENEFITS:
✓ Clean separation of personal vs mission content
✓ Reusable personal conversations across all missions
✓ Easy to add new missions without touching personal files
✓ Version control friendly (different writers, different files)
✓ Context-aware topic presentation
✓ Scalable to dozens of missions
✓ Natural conversation flow mixing personal & professional
Related to previous work:
- Builds on three-tier variable persistence system
- Uses npc_<npcname>_<variable> scoping convention
- Leverages total_missions_completed for progression
Updated all three ongoing conversation files (Netherton, Chen, Haxolottle) with
clear PERSISTENT/GLOBAL/LOCAL variable annotations and proper scoping:
PERSISTENT variables:
- Save/load between game sessions
- Use scoped naming (npc_netherton_*, npc_chen_*, npc_haxolottle_*)
- Include all relationship stats, discussed topics, and special moments
GLOBAL variables:
- Session-only, span across NPCs
- total_missions_completed (replaces sequential mission tracking)
- professional_reputation
LOCAL variables:
- Conversation-specific EXTERNAL variables
- player_name, current_mission_id
This enables order-independent mission completion while maintaining
persistent conversation state across game sessions.
Convert all ink files from #speaker: tag format to inline speaker prefixes:
- "Narrator: " for narration/descriptions
- "Netherton: " for Director Netherton dialogue
- "Haxolottle: " for Agent 0x99 dialogue
- "Dr. Chen: " for Dr. Chen dialogue
Changes:
- agent_0x00_cyber_division_intro.ink: Multi-character scene with Netherton and Haxolottle
- haxolottle_ongoing_conversations.ink: Single-NPC conversations (Phases 1-2)
- haxolottle_ongoing_conversations_advanced.ink: Single-NPC conversations (Phases 3-4)
- lore_exploration_hub.ink: Conversations with multiple possible NPCs
Preserves all functional tags (#exit_conversation, etc.)
Follows Break Escape ink best practices for speaker attribution
- Add agent_0x00_cyber_division_intro.ink: Introduction cutscene for Agent 0x00 joining SAFETYNET's CYBER-PHYSICAL division
* Introduces Director Netherton and Agent 0x99 "Haxolottle"
* Player makes meaningful choices affecting relationships
* Tracks influence with netherton_respect and haxolottle_trust variables
* Establishes player_attitude and specialization_interest
* Multiple branching paths based on player responses
- Add lore_exploration_hub.ink: Reusable dialogue system for exploring ENTROPY and SAFETYNET lore
* Hub-based conversation pattern with multiple NPCs
* Tracks influence with handler, tech support, director, and fellow agents
* Progressive revelation system (deeper topics unlock with higher influence)
* Covers ENTROPY origins, philosophy, cells, and tactics
* Covers SAFETYNET mission, methods, shadow war, and field operations
* Deep lore unlocks: Berlin Crisis, handler backstory, moral complexity
* Works with different speakers (Haxolottle, Dr. Chen, Director Netherton)
* Mission-agnostic design for reusability
- Add comprehensive README.md documenting:
* File purposes and when to use them
* Variables reference and influence tracking system
* Character voice guidelines for each NPC
* Integration examples and usage guidelines
* Testing checklist and quality standards
* Future expansion ideas
All dialogue follows established character voices from universe bible and
implements influence-based relationship progression system.
Add comprehensive prompts for all 9 stages of Break Escape scenario development:
- Stage 0: Scenario Initialization - Technical challenges and narrative themes
- Stage 1: Narrative Structure - Three-act story arc development
- Stage 2: Storytelling Elements - Characters, atmosphere, dialogue
- Stage 3: Moral Choices - Player agency and ethical decisions
- Stage 4: Player Objectives - Goals and win conditions
- Stage 5: Room Layout - Physical design with technical constraints
- Stage 6: LORE Fragments - Collectible universe-building content
- Stage 7: Ink Scripting - Interactive dialogue and cutscenes
These prompts guide AI agents (or human designers) through a structured
process to create complete, validated Break Escape scenarios that combine
cybersecurity education with compelling narrative gameplay.
Each prompt includes:
- Role definition and responsibilities
- Required inputs from previous stages
- Essential reference documentation
- Process guidelines and templates
- Quality checklists
- Common pitfalls to avoid
- Tips for success
This completes the story development prompt system alongside the previously
committed README.md and Stage 8 (Review) prompt.
Add comprehensive scenario review and validation prompt (Stage 8) plus
README overview for the story development prompt system.
Note: Files for stages 0-7 need to be recreated - they appear to have
not persisted despite Write tool calls during the session.
This commit transforms the single universe bible document into a comprehensive,
organized set of reference materials across 74 files in 10 major sections.
Major Changes:
- Split original universe bible into chapter-based documents
- Expanded all content by 50-100% with additional lore and details
- Created modular directory structure for easy navigation
- Added extensive cross-referencing between documents
New Structure:
01. Universe Overview - Setting, premise, and tone
02. Organisations - SAFETYNET and ENTROPY detailed profiles
03. ENTROPY Cells - All 11 cells with expanded operations
04. Characters - SAFETYNET operatives and ENTROPY antagonists
05. World Building - Rules, technology, society, timeline
06. Locations - Environment types and notable locations
07. Narrative Structures - Mission types, arcs, player agency
08. LORE System - Collectibles, progression, writing guides
09. Scenario Design - Framework, templates, and examples
10. Reference - Quick reference, checklists, glossary, style guide
Content Expansions:
- SAFETYNET: 28 Field Operations Handbook rules (from 3)
- ENTROPY Cells: 8 key members per cell (from 4)
- Characters: 8 additional SAFETYNET agents created
- Locations: 7 environment type guides
- Scenario Templates: 4 complete templates + 3 full examples
- LORE System: 220 fragments mapped across 6 categories
- Reference: Comprehensive glossary, checklists, and CyBOK guide
Benefits:
- Easier to find specific information
- Consistent universe across all scenarios
- Supports continuous discovery as players progress
- Comprehensive reference for scenario designers
- Expanded lore enables richer storytelling
Total Documentation: ~500KB across 74 markdown files
This commit fixes several issues with East/West side doors:
1. **Sprite Flipping**: Changed flip direction - East doors are now flipped
horizontally instead of West doors (opposite direction as requested)
2. **Door Positioning**: Updated E/W door placement from 2 tiles to 3 tiles
from the top corner for better alignment with room layout
3. **Wall Passage Cutout**: Increased wall tile removal area for side doors
from 1 tile to 3 tiles vertically, creating a wider passage (matching the
inset spacing used for N/S doors)
4. **Side Door Animation**:
- Added `isSideDoor` property to doorProperties to track door type
- Created new 'door_side_open' animation using frames 1-4 (frames 2-5
in 1-indexed notation) of door_side_sheet_32 sprite
- Updated animated door creation to use side door sprite and animation
for E/W doors
5. **Sprite Alignment**: Door sprites now properly align with the tile grid
at 3 tiles from corner position
Changes made in:
- js/systems/doors.js: Door placement, sprite creation, and animations
- js/systems/collision.js: Wall tile removal for wider passages
- js/core/game.js: Side door animation definition
Tested with: scenarios/test_horizontal_layout.json
- Modified createSpriteAtRandomPosition() to accept map parameter
- Items now use actual room dimensions based on tilemap (respects room GU)
- Applied correct padding constraints:
* 1 tile (32px) from left and right sides
* 2 tiles (64px) from top and bottom
- Random item placement now works correctly with variable room sizes
- Ensures items stay within playable room bounds
Related to new room layout system (Grid Unit based positioning)
Updated room positioning to verify overlap for EACH connected room
after grid alignment, not just the group as a whole. This fixes
layouts like:
122
00
Where room 1 was previously positioned with no overlap to room 0.
Changes:
- positionNorthMultiple/positionSouthMultiple: After centering and
aligning group, check first and last room overlap. If insufficient,
shift entire group to ensure minimum overlap for each room.
- positionEastMultiple/positionWestMultiple: Same approach for
vertical stacking along east/west edges.
The algorithm now:
1. Centers the group of connecting rooms over parent
2. Aligns starting position to grid
3. Checks if first room has >= 1 GU overlap, adjusts if not
4. Checks if last room has >= 1 GU overlap, adjusts if not
5. Positions all rooms from the adjusted aligned start
This guarantees each connecting room overlaps with the parent room
by at least one Grid Unit, ensuring proper door placement and room
connectivity.
Updated room positioning algorithm to ensure all connecting rooms are
properly aligned to the grid and have at least one Grid Unit overlap
with the connecting edge of the parent room.
Changes:
- positionNorthMultiple/positionSouthMultiple: Position rooms as a group,
align the starting position to grid, then place rooms side-by-side
without individual alignment to prevent gaps
- positionEastMultiple/positionWestMultiple: Similar approach for vertical
stacking of rooms along east/west edges
This ensures:
- All rooms maintain proper grid alignment
- Connected rooms have guaranteed minimum overlap
- No gaps between adjacent rooms in multi-room connections
- Room layouts match the examples in planning notes
Addresses alignment issues described in new_room_layout documentation
where rooms need to be positioned against the connecting edge with
at least one GU overlap.
This commit addresses three critical issues identified during testing:
1. **Fixed mixed room size door alignment (Issue #1)**
- Updated room positioning logic in positionNorthMultiple, positionSouthMultiple,
positionEastMultiple, and positionWestMultiple functions
- Rooms are now positioned centered on their corresponding door positions
- Ensures doors align properly between different-sized rooms (e.g., 1×1 GU closet
connecting to 2×1 GU hallway)
- Uses same door spacing logic as door placement (edgeInset + doorSpacing)
2. **Implemented East/West single-tile doors (Issue #2)**
- Changed door_side_sheet_32 from image to spritesheet (6 frames, 32×32px each)
- Updated door sprite creation to use single tile per room for east/west doors
- West-facing doors (left room) now properly flip horizontally
- Doors positioned 3 tiles down from top (TILE_SIZE * 2) as specified
- Updated wall tile removal and animated door creation to use correct dimensions
- Both sides of east/west connections now use matching door system
3. **Added connection limit validation (Issue #3)**
- Created validateMultipleConnections function to check if connections fit
- Validates that multiple connections won't cause rooms to overhang excessively
- Logs detailed error messages with recommendations when connections don't fit
- Example: 2GU room can't have 3 north connections (not enough width)
- Helps developers identify invalid room layouts during scenario design
Files modified:
- js/core/game.js: Load door_side_sheet_32 as spritesheet
- js/core/rooms.js: Fix positioning, add validation
- js/systems/doors.js: Single-tile east/west doors with flipping
- js/systems/collision.js: Update wall tile removal for single-tile doors
Fixed issue where test scenarios couldn't load rooms:
1. Added new room types to game preload:
- small_room_1x1gu (1×1 GU closet)
- hall_1x2gu (2×1 GU wide hallway)
2. Corrected room type keys in all test scenarios:
- room_reception2 → room_reception
- room_office2 → room_office
- room_ceo2 → room_ceo
- room_servers2 → room_servers
The issue was that scenarios referenced room file names (room_reception2)
instead of the Phaser cache keys (room_reception). The game preloads rooms
with specific keys that map to the JSON files:
this.load.tilemapTiledJSON('room_reception', 'assets/rooms/room_reception2.json')
Scenarios must use the key ('room_reception'), not the filename.
Files updated:
- js/core/game.js: Added preload for new variable-sized rooms
- scenarios/test_vertical_layout.json
- scenarios/test_horizontal_layout.json
- scenarios/test_complex_multidirection.json
- scenarios/test_multiple_connections.json
- scenarios/test_mixed_room_sizes.json
All test scenarios should now load correctly.
Updated test_mixed_room_sizes.json to use the new room files merged from main:
- Changed hall from placeholder to hall_1x2gu.json (2×1 GU - 10×6 tiles)
- Changed closet from placeholder to small_room_1x1gu.json (1×1 GU - 5×6 tiles)
- Updated all scenario text to reflect actual room dimensions
- Corrected layout diagram (hall is 2×1 GU wide hallway, not 1×2 GU vertical)
Updated TEST_SCENARIOS_README.md:
- Marked small_room_1x1gu.json and hall_1x2gu.json as available (✓)
- Updated scenario #5 description with actual rooms used
- Clarified that this scenario now demonstrates real size variety
This scenario now provides a complete test of the grid system with:
- 1×1 GU closet (smallest valid room)
- 2×1 GU wide hallway (horizontal connector)
- 2×2 GU standard rooms (reception, CEO office)
- Proper door alignment between all different sizes
Updated README_scenario_design.md with new grid-based room layout system:
- Documented Grid Unit (GU) system: 5×4 tiles base unit
- Added valid room size specifications (widths: multiples of 5, heights: 2+4N)
- Replaced old north/south-only constraints with four-direction support
- Updated door placement rules for N/S/E/W connections
- Added room positioning algorithm documentation
- Revised scenario design guidelines for grid system flexibility
Created 5 comprehensive test scenarios:
1. test_vertical_layout.json - Traditional N/S stacking
2. test_horizontal_layout.json - E/W connections
3. test_complex_multidirection.json - All four directions
4. test_multiple_connections.json - Multiple doors per direction
5. test_mixed_room_sizes.json - Different room sizes (1×1, 1×2, 2×2 GU)
Added TEST_SCENARIOS_README.md documenting:
- Grid system overview and room size specifications
- Detailed test scenario descriptions with layout diagrams
- Testing procedures and validation checks
- Expected console output examples
- Troubleshooting guide
Note: Scenarios reference hall_1x2gu.json and small_room_1x1gu.json which
need to be created in assets/rooms/. Currently using 2×2 GU placeholders.
All test scenarios include:
- Visual layout diagrams in scenario_brief
- Progressive difficulty with locks and keys
- Documentation of what each scenario tests
- Notes explaining grid system concepts
- Export calculateDoorPositionsForRoom from doors.js for reuse
- Import and use shared function in collision.js
- Remove duplicate door positioning logic (130+ lines)
- Ensures perfect alignment between door sprites and wall tile removal
- Both systems now use identical door placement calculations
This eliminates code duplication and guarantees that wall tiles are
removed at exactly the same positions where door sprites are created.
- Add grid unit constants (5x4 tiles) to constants.js
- Create comprehensive grid conversion helper functions
- Implement 4-direction room positioning (N/S/E/W) with breadth-first algorithm
- Add door placement functions with CRITICAL fixes:
* Negative modulo fix: ((sum % 2) + 2) % 2 for deterministic placement
* Asymmetric alignment fix: single-door rooms align with multi-door rooms
* Consistent grid alignment using Math.floor() for negative coordinates
- Rewrite calculateRoomPositions to support variable room sizes
- Update createDoorSpritesForRoom to use new placement system
- Store room dimensions globally for cross-system access
This implements the comprehensive room layout redesign as specified in
planning_notes/new_room_layout with all critical fixes from review2.
Addresses: Variable room sizes, proper door alignment, and grid-based positioning
- Updated door sprite creation to support lock properties from both doors and connected rooms.
- Added RFID cloner interaction logic to handle minigame initiation from inventory.
- Implemented inventory variable synchronization for NPC conversations, including RFID card details.
- Introduced new scenarios for RFID guards with varying security levels and interactions.
- Revised test scenarios to include comprehensive RFID protocol testing with detailed notes and NPC interactions.