Commit Graph

83 Commits

Author SHA1 Message Date
Z. Cliffe Schreuders
f1ac7ee383 feat: Enhance NPC pathfinding and line of sight checks for improved chase behavior across rooms 2026-02-15 23:14:13 +00:00
Z. Cliffe Schreuders
af8b0e1cb3 feat: Improve player movement logic to calculate direct path to NPCs and objects, ensuring precise stopping distance 2026-02-15 22:49:42 +00:00
Z. Cliffe Schreuders
ead3b05799 feat: Implement wall-aware collision handling for NPCs to prevent pushing through obstacles 2026-02-15 03:18:47 +00:00
Z. Cliffe Schreuders
8fc432164c feat: Enhance item interaction logic to always attempt adding takeable items to inventory and improve notification handling 2026-02-15 00:56:13 +00:00
Z. Cliffe Schreuders
6500354400 feat: Add new inventory items and enhance NPC item drop logic with texture validation and notifications 2026-02-15 00:49:02 +00:00
Z. Cliffe Schreuders
a6458a9ff2 feat: Add sprite padding constants and adjust depth calculations for player and NPC sprites 2026-02-15 00:30:24 +00:00
Z. Cliffe Schreuders
ba13b6aa73 feat: Adjust player movement to stop short of NPCs and objects for improved interaction precision 2026-02-14 01:11:45 +00:00
Z. Cliffe Schreuders
8b97bcdfb1 feat: Add hop effect for player when stepping over items and improve visual overlay management 2026-02-14 00:44:32 +00:00
Z. Cliffe Schreuders
40551a2eae feat: Improve NPC and player combat interactions with enhanced state management and safety checks 2026-02-13 23:34:37 +00:00
Z. Cliffe Schreuders
a28e79bd6d feat: Enhance combat mechanics with knockback and animation improvements
- Added knockback functionality for both player and NPCs, allowing for dynamic interactions during combat.
- Implemented new animations for player and NPC hit reactions, including 'taking-punch' and 'death' animations.
- Updated player and NPC behavior to prevent animation interruptions during attacks and knockouts.
- Improved player health system to trigger death animations and disable movement upon KO.
- Refactored NPC combat to manage attack states and ensure animations play correctly.
- Introduced utility functions for applying knockback effects and checking knockback states.
2026-02-13 23:26:09 +00:00
Z. Cliffe Schreuders
e749d705c6 feat: Simplify NPC hostility conversion by removing manual behavior updates 2026-02-13 16:53:27 +00:00
Z. Cliffe Schreuders
b27e603668 feat: Add punch interaction mode for player combat and prevent default context menu on right-click 2026-02-13 16:44:27 +00:00
Z. Cliffe Schreuders
7cdcc354c1 feat: Implement three-mode interaction system in HUD
- Added hand frames PNG for interaction modes.
- Updated HUD CSS to support new player HUD buttons and styles.
- Enhanced combat configuration to define interaction modes: interact, jab, and cross.
- Integrated player HUD creation and management in the game core.
- Improved player combat system to handle interaction modes and associated animations.
- Modified interaction handling to auto-switch modes for chairs and hostile NPCs.
- Updated health UI to always display health status.
- Created a new HUD JavaScript module to manage avatar and interaction mode toggle.
- Added a test HTML file for the three-mode toggle functionality.
2026-02-13 16:04:02 +00:00
Z. Cliffe Schreuders
a84d309809 Enhance player combat animations and effects with punch mechanics 2026-02-13 09:53:58 +00:00
Z. Cliffe Schreuders
61afc0a666 Refactor character assets and player preferences
- Deleted unused character images: woman_in_science_lab_coat.png and woman_with_black_long_hair_bow_in_hair_long_sleeve_(1).png.
- Added new padlock icon asset for UI.
- Introduced player_preferences.css for styling the player preferences configuration screen.
- Updated game.js to load new character atlases with simplified filenames.
- Enhanced player.js to create custom idle animations for characters.
- Implemented sprite-grid.js for sprite selection UI, including a preview feature.
- Updated database schema to include break_escape_player_preferences table for storing player settings.
- Modified convert_pixellab_to_spritesheet.py to map character names to simplified filenames and extract headshots from character images.
2026-02-12 14:35:14 +00:00
Z. Cliffe Schreuders
fb6e9b603c Enhance character sprite loading and animation handling
- Updated the game to support new character sprite atlases for both male and female characters, allowing for a wider variety of NPC designs.
- Improved player sprite initialization to dynamically select between atlas-based and legacy sprites, enhancing flexibility in character representation.
- Refined collision box settings based on sprite type, ensuring accurate physics interactions for both atlas (80x80) and legacy (64x64) sprites.
- Enhanced NPC behavior to utilize atlas animations, allowing for more fluid and diverse animations based on available frames.

Files modified:
- game.js: Added new character atlases and updated sprite loading logic.
- player.js: Improved player sprite handling and collision box adjustments.
- npc-behavior.js: Updated animation handling for NPCs to support atlas-based animations.
- npc-sprites.js: Enhanced NPC sprite creation to accommodate atlas detection and initial frame selection.
- scenario.json.erb: Updated player and NPC configurations to utilize new sprite sheets and animation settings.
- m01_npc_sarah.ink: Revised dialogue options to include new interactions related to NPCs.
2026-02-11 00:18:21 +00:00
Z. Cliffe Schreuders
d1e38bad29 Refactor inventory handling to prevent duplicates and clean up game state
- Updated the games_controller to remove starting items from the inventory response, ensuring no duplicates are sent to the client.
- Enhanced the inventory processing logic in JavaScript to check for existing items by ID, type, or name before adding new items, preventing duplicate entries in the player's inventory.

Files modified:
- games_controller.rb: Adjusted inventory response handling.
- inventory.js: Added duplicate item check during inventory processing.
2026-02-10 16:17:36 +00:00
Z. Cliffe Schreuders
6847fca429 Add keyboard controls for choice selection in PersonChatMinigame
- Implemented keyboard event handling to allow players to use the spacebar to continue and number keys (1-9) to select choices in the minigame.
- Updated UI to display choice buttons with number prefixes for easier selection.

Files modified:
- person-chat-minigame.js: Added keyboard event listener for choice selection.
- person-chat-ui.js: Updated choice button creation to include number prefixes.
2026-02-10 16:07:28 +00:00
Z. Cliffe Schreuders
5c28743144 Update CSS file paths and enhance tutorial system
- Changed CSS file paths in index.html and show.html.erb to reflect new directory structure under public/break_escape.
- Added a new tutorial.css file with styles tailored for the tutorial system, ensuring a cohesive pixel-art aesthetic.
- Enhanced the tutorial manager to track player interactions, including clicks to move and inventory item usage, improving the tutorial experience for new players.
- Updated tutorial steps to dynamically include objectives based on the current scenario.

Files modified:
- index.html: Updated CSS links.
- show.html.erb: Updated CSS links.
- tutorial.css: New styles for the tutorial system.
- player.js: Added notifications for player actions.
- tutorial-manager.js: Enhanced logic for tracking tutorial progress and objectives.
- interactions.js: Added notifications for inventory interactions.
2026-01-19 09:54:15 +00:00
Z. Cliffe Schreuders
1a8da6df23 Add interactive tutorial system for new players
Implements a comprehensive tutorial system that:
- Prompts first-time players with option to take tutorial
- Detects device type (mobile vs keyboard) for appropriate instructions
- Shows interactive steps with objectives for basic controls:
  * Keyboard: WASD movement, Shift to run, E to interact
  * Mobile: Click/tap to move and interact
- Tracks player actions to progress through tutorial steps
- Saves completion status in localStorage
- Includes polished UI with animations and responsive design

Files added:
- tutorial-manager.js: Core tutorial logic and state management
- tutorial.css: Styled UI components with animations

Files modified:
- game.js: Integrated tutorial check on first load
- player.js: Added tutorial notifications for movement/running
- interactions.js: Added tutorial notification for interactions
- main.js: Imported tutorial manager system
- index.html: Added tutorial CSS stylesheet
2026-01-14 10:10:12 +00:00
Z. Cliffe Schreuders
53881d5767 Fix door and room loading issues with multiple paths
Fixes two critical issues when multiple doors lead to the same room:

1. Room reloading: Added checks in loadRoom() and createRoom() to prevent
   reloading/recreating rooms that are already loaded. This prevents the
   room from being unnecessarily recreated when opening a second door to
   the same room.

2. Door location detection: Updated removeMatchingDoorSprite() to use
   position and direction when finding the matching door. Previously it
   only checked connectedRoom, which caused it to remove the wrong door
   when multiple doors connected the same two rooms at different locations.
   Now it checks:
   - Opposite direction matches
   - Position matches within tolerance (X for N/S doors, Y for E/W doors)

This ensures that opening different doors to the same room works correctly
without causing room reloads or removing the wrong door sprites.
2026-01-14 10:02:08 +00:00
Z. Cliffe Schreuders
d2b78b9d54 Clean up trailing whitespace in migration and CSS files
- Removed unnecessary trailing whitespace from `remove_unique_game_constraint.rb`, `flag-station-minigame.css`, `vm-launcher-minigame.css`, and `hacktivity-cable.js` to enhance code quality and maintain consistency across the codebase.
2026-01-13 09:39:14 +00:00
Z. Cliffe Schreuders
aad985ee98 Add new functionality to open workstations in new tabs
- Introduced buttons in the Crypto and Lab Workstation title bars to allow users to open the respective workstations in new tabs.
- Implemented JavaScript functions `openCryptoWorkstationInNewTab` and `openLabWorkstationInNewTab` to handle the new tab functionality.
- Updated CSS styles for the new buttons to ensure proper positioning and visual appeal.
- Made necessary imports and exports in helper files to integrate the new functionality across the application.
2025-12-05 15:37:31 +00:00
Z. Cliffe Schreuders
c7d9f5e3cf Update migration and CSS files to remove trailing whitespace
- Cleaned up trailing whitespace in migration file `remove_unique_game_constraint.rb` to maintain code quality.
- Removed unnecessary whitespace from CSS files for `flag-station-minigame.css` and `vm-launcher-minigame.css`, ensuring cleaner stylesheets.
- Tidied up JavaScript file `hacktivity-cable.js` by eliminating trailing whitespace, improving readability and consistency across the codebase.
2025-12-04 23:15:38 +00:00
Z. Cliffe Schreuders
d327380fac Enhance scenario validation and improve timed conversation structure
- Updated `validate_scenario.rb` to enforce correct usage of `targetKnot` in timed conversations, ensuring compliance with new requirements.
- Added checks for missing properties in timed conversations, including `delay` and `targetKnot`, to improve scenario integrity.
- Enhanced logging for validation issues, providing clearer feedback on scenario configuration errors.
- Updated relevant scenarios to align with the new validation rules, ensuring consistency across gameplay elements.
2025-12-04 23:15:03 +00:00
Z. Cliffe Schreuders
629aa229b3 Enhance inventory and container management for improved gameplay experience
- Added functionality to include current player inventory in game state for page reload recovery, allowing players to restore their inventory seamlessly.
- Implemented filtering of container contents to exclude items already in the player's inventory, enhancing user experience and gameplay clarity.
- Updated game mechanics to support both type-based and ID-based matching for inventory items, improving task validation and objectives tracking.
- Enhanced logging for better visibility into inventory processing and container content loading, aiding in debugging and game state management.
- Updated scenarios to reflect changes in item identification and task requirements, ensuring consistency across gameplay elements.
2025-12-04 15:42:01 +00:00
Z. Cliffe Schreuders
333ea39c56 Implement submit_flags task functionality and enhance game mechanics
- Added support for submit_flags tasks in GamesController, allowing players to submit flags for validation and task completion.
- Updated game state management to track submitted flags and validate against required flags for task completion.
- Enhanced ObjectivesManager to handle flag submissions, including syncing progress with the server and managing task states.
- Introduced a new locksmith NPC for lockpicking tutorials, expanding gameplay elements and player engagement.
- Updated scenario schema to include submit_flags task type and associated properties, ensuring proper integration into the game mechanics.
- Improved logging and debugging information for flag submissions and task progress updates, enhancing visibility into game state changes.
2025-12-04 14:00:26 +00:00
Z. Cliffe Schreuders
e1d3b1ff2c Enhance FlagStationMinigame and scenario structure
- Added functionality to complete tasks via the objectives manager in FlagStationMinigame, improving gameplay interaction.
- Updated scenario.json.erb to replace flags_submitted with specific SSH and privilege flag submissions, enhancing clarity in task objectives.
- Introduced new task types in the scenario schema to support task completion mechanics, ensuring better integration of gameplay elements.
2025-12-04 08:40:25 +00:00
Z. Cliffe Schreuders
289c0ce1c7 Add lab workstation functionality and integrate into gameplay
- Introduced a lab workstation popup in the game interface for accessing lab sheets via an iframe.
- Implemented JavaScript functions to create, open, and close the lab workstation, enhancing user interaction.
- Updated CSS styles for the lab workstation popup to ensure a seamless visual experience.
- Enhanced interaction handling to allow players to open lab workstations from inventory items.
- Added new scenario files for the Linux Fundamentals and Security Lab, including detailed instructions and objectives for players.
- Updated scenario schema to include the new lab workstation type, ensuring proper integration into the game mechanics.
2025-12-04 02:10:35 +00:00
Z. Cliffe Schreuders
49fc995cb3 Enhance scenario schema and validation scripts
- Updated scenario-schema.json to include "tutorial" as a valid difficulty level.
- Changed position coordinates from integer to number for better precision.
- Added new item types ("id_badge", "rfid_cloner") in scenario schema with descriptions.
- Improved validate_scenario.rb to check for common issues, including room connection directions and NPC configurations.
- Added suggestions for gameplay improvements based on scenario features.
- Updated SCENARIO_JSON_FORMAT_GUIDE.md to clarify valid directions and bidirectional connections.
- Introduced guidelines for lock type variety and progression in room layout design.
- Established dialogue pacing rules in Ink scripting to enhance player engagement.
- Included validation steps in scenario assembly documentation to ensure structural integrity.
2025-12-02 10:37:57 +00:00
Z. Cliffe Schreuders
a4606f596c Enhance NPC encounter logging and fix item type references in scenario scripts 2025-12-01 17:31:12 +00:00
Z. Cliffe Schreuders
ce53d60ff1 Reduce duration of failure and success messages in PasswordMinigame for improved user experience
- Decreased the display time for various failure and success messages from 3000ms to 1000ms or 1500ms, enhancing responsiveness during gameplay.
- Adjusted the cancellation message display time from 2000ms to 800ms for quicker feedback.
2025-11-30 00:23:56 +00:00
Z. Cliffe Schreuders
5d9f83192d Implement keyboard input pause for text entry in FlagStationMinigame
- Added functionality to disable WASD key capture during text input, enhancing user experience.
- Implemented a fallback mechanism to dynamically import the pauseKeyboardInput method if not available on the window object, ensuring compatibility across different environments.
2025-11-30 00:04:42 +00:00
Z. Cliffe Schreuders
a8c4f6576f Enhance standalone mode with VM IP handling and UI updates
- Updated `GamesController` to parse and store VM IPs from JSON input, improving player state management.
- Modified `Game` model to include VM IPs in the context for better integration with gameplay.
- Enhanced `Mission` model's `vm_object` method to override IPs from the context when available.
- Revamped `new.html.erb` to provide a clearer interface for entering VM IP addresses and flag hints.
- Improved `vm-launcher-minigame.js` to display VM IPs and provide connection instructions in standalone mode.
2025-11-30 00:02:08 +00:00
Z. Cliffe Schreuders
ef8e2f294a Refactor RFID handling and enhance game logic
- Updated `GamesController` and `Game` model to include RFID lock types in the filtering logic for 'requires' attributes, ensuring proper handling of biometric, bluetooth, and RFID types.
- Improved `RFIDMinigame` to standardize card ID retrieval, supporting both `card_id` and `key_id`.
- Enhanced `unlock-system.js` to prioritize physical keycard checks and streamline the unlocking process with detailed logging.
- Adjusted scenario JSON files to replace `keyId` with `card_id` for consistency and added new lock requirements for various rooms.
2025-11-29 23:43:30 +00:00
Z. Cliffe Schreuders
92330b04dc Enhance flag handling and XML integration for standalone mode
- Updated `GamesController` to support XML flag hints for standalone mode, improving backward compatibility with legacy flag input.
- Introduced `parse_flag_hints_xml` method in `Mission` model to extract flags from XML content.
- Enhanced `Game` model to incorporate `flags_by_vm` from player state for better flag management.
- Modified `new.html.erb` to update UI for flag hints input, replacing the previous comma-separated flags format.
- Improved `FlagStationMinigame` to display accepted VM flags and handle flag submissions more effectively.
- Adjusted scenario JSON to include flag stations with VM-specific flag handling.
2025-11-29 20:57:39 +00:00
Z. Cliffe Schreuders
bb2b0c206e Implement VM object retrieval and enhance game visuals
- Added `vm_object` method in `mission.rb` to fetch VM details from context or return a fallback.
- Introduced new images for VM launchers and flag stations in the assets directory.
- Updated `game.js` to preload new VM launcher and flag station images.
- Refactored `vm-launcher-minigame.js` to streamline VM handling and improve UI messaging.
- Adjusted scenario JSON to utilize the new `vm_object` method for VM data retrieval.
2025-11-29 01:35:20 +00:00
Z. Cliffe Schreuders
ca44cef068 Enhance game setup for VM and standalone modes
- Updated `GamesController` to use `current_player` for VM set retrieval.
- Improved `MissionsController` to handle redirection for both Hacktivity and standalone modes.
- Modified `new.html.erb` to include UI for standalone flag input alongside VM set selection.
- Added new CSS styles for standalone mode instructions and flags input form.
- Introduced new mission configuration for the SecGen VM Lab, integrating VM and flag capture elements.
2025-11-28 17:41:17 +00:00
Z. Cliffe Schreuders
ea079b11c9 WiP implementing VM integration 2025-11-28 15:36:10 +00:00
Z. Cliffe Schreuders
f4aef2a561 feat: Improve NPC dialogue and objectives handling with global variable synchronization and task unlocking 2025-11-26 14:49:30 +00:00
Z. Cliffe Schreuders
9aaec1a970 feat: Enhance NPC dialogue and objectives system with event mappings for secret mission completion 2025-11-26 13:02:55 +00:00
Z. Cliffe Schreuders
412cebb65c feat: Add objectives system with policy methods and test scenarios 2025-11-26 09:43:06 +00:00
Z. Cliffe Schreuders
9d6d7709c3 feat: Implement Objectives System with UI and Server Sync
- Added ObjectivesManager to track mission objectives and tasks.
- Created ObjectivesPanel for displaying objectives in a collapsible HUD.
- Integrated objectives state restoration from the server during game initialization.
- Implemented task completion and unlocking mechanisms via game actions.
- Added CSS styles for the objectives panel with a pixel-art aesthetic.
- Developed a test scenario to validate the objectives system functionality.
- Updated database schema to include fields for tracking completed objectives and tasks.
2025-11-26 00:50:32 +00:00
Z. Cliffe Schreuders
150518b4c4 feat: Include objectives state in server response and implement event emissions for door unlocks and key pickups 2025-11-25 23:19:11 +00:00
Z. Cliffe Schreuders
659644b3da feat: Update CyBOK logo and enhance mission index styles with new CSS files 2025-11-25 16:03:09 +00:00
Z. Cliffe Schreuders
0d7ba1f2fc feat: Enhance key selection process by storing original inventory keys and correct key ID for retries 2025-11-24 13:52:07 +00:00
Z. Cliffe Schreuders
5ecfa5db27 feat: Implement KeyCutCalculator utility for consistent key cut depth calculations across the game
refactor: Update key-lock system and minigame starters to utilize KeyCutCalculator for cut depth generation
chore: Normalize keyPins in scenario data to align with new cut depth calculations
2025-11-24 13:41:35 +00:00
Z. Cliffe Schreuders
b4b95928da feat: Enhance inventory management with server-side validation and CSRF protection 2025-11-24 11:17:39 +00:00
Z. Cliffe Schreuders
2c8757de3e Add character registry and NPC management features
- Implemented a global character registry to manage player and NPC data.
- Added methods for setting the player, registering NPCs, and retrieving character information.
- Integrated character registry updates into the NPC manager for seamless NPC registration.
- Created test scenarios for line prefix speaker format, including narrator modes and background changes.
- Developed comprehensive NPC sprite test scenario with various NPC interactions and items.
2025-11-24 02:21:31 +00:00
Z. Cliffe Schreuders
5a997e38f7 Enhance NPC collision detection: add checks for table objects in NPC behavior and log successful collisions for better debugging. 2025-11-23 10:39:44 +00:00