Commit Graph

602 Commits

Author SHA1 Message Date
Z. Cliffe Schreuders
f0ffb3fdfd Refactor code to remove trailing whitespace and improve readability
- Cleaned up trailing whitespace in `games_controller.rb`, `game.rb`, and `validate_scenario.rb` to enhance code quality and maintain consistency across the codebase.
- Updated migration file `remove_unique_game_constraint.rb` to remove unnecessary whitespace, ensuring a cleaner migration history.
- Improved overall readability of the code by eliminating redundant blank lines in various files.
2025-12-04 23:17:34 +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
996a4ab6ce Add lab conversion prompt documentation for Break Escape scenarios
- Introduced a comprehensive guide for converting existing lab Ink files into Break Escape scenarios, detailing each step of the process.
- Included instructions for determining lab configuration, creating new scenario directories, and editing Ink files to align with gameplay requirements.
- Provided guidelines for updating scenario JSON, managing objectives, and ensuring compliance with best practices for dialogue and influence tracking.
- Emphasized the importance of validating scenarios and maintaining consistency with SecGen XML metadata for CyBOK entries.
2025-12-04 23:13:50 +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
5a89ce945c Update INK best practices and instructor scenarios for influence tracking
- Added critical requirements for including `#influence_increased` and `#influence_decreased` tags after modifying influence variables to ensure visual feedback in the game.
- Enhanced documentation on best practices for dialogue formatting, emphasizing the importance of avoiding lists and keeping exit conversations brief.
- Updated multiple instructor scenarios to include the necessary influence tags, ensuring consistent feedback for player actions.
- Corrected room connection direction in scenario.json.erb for improved navigation.
2025-12-04 14:13:21 +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
7ac541a286 Enhance NPC encounter tracking and logging in GamesController
- Added logging for the number of NPCs in a room when loading it, improving visibility into game state.
- Ensured NPC encounters are tracked when unlocking doors, even when using cached room data, to maintain accurate encounter statistics.
2025-12-01 17:42:28 +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
0cf9e0ba62 Add scenario schema and validation script for Break Escape scenarios
- Introduced `scenario-schema.json` to define the structure and requirements for scenario.json.erb files.
- Implemented `validate_scenario.rb` to render ERB templates to JSON and validate against the schema.
- Created a comprehensive `SCENARIO_JSON_FORMAT_GUIDE.md` to outline the correct format for scenario files, including required fields, room definitions, objectives, and common mistakes.
2025-12-01 15:45:24 +00:00
Z. Cliffe Schreuders
47eaffa4c3 Scenario development WiP 2025-12-01 08:48:43 +00:00
Z. Cliffe Schreuders
2b766c6000 Add SecGen Scenario Summaries for BreakEscape mission design
- Created a comprehensive document detailing various SecGen lab scenarios, including setup, user accounts, vulnerabilities, and CTF steps.
- Each scenario provides insights into player experiences and objectives, aiding mission designers in understanding gameplay dynamics.
- Scenarios cover a range of topics, including Linux and Windows security labs, malware exploitation, information gathering, and post-exploitation techniques.
2025-11-30 02:26:28 +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
19db2f530d Refactor whitespace and comments for consistency in BreakEscape controllers and models
- Cleaned up unnecessary whitespace in `games_controller.rb`, `missions_controller.rb`, `game.rb`, `mission.rb`, `routes.rb`, `seeds.rb`, and migration files to enhance code readability.
- Standardized comment formatting across various files to maintain consistency and improve clarity.
2025-11-30 00:06:54 +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
bca619aeac Add Lock Scenario and System Architecture Documentation
- Introduced `LOCK_SCENARIO_GUIDE.md` to provide a comprehensive reference for implementing locks in scenarios, detailing room and object lock configurations, lock types, and quick examples.
- Added `LOCK_SYSTEM_ARCHITECTURE.md` to outline the data flow from scenario definition to server validation, including steps for scenario definition, server bootstrap filtering, client lock checks, and server validation processes.
- Included security notes and references for various lockable object types and items related to the locking system.
2025-11-29 23:46:39 +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
0d250d71f0 Refactor game redirection and VM context handling
- Updated `MissionsController` to use explicit paths for redirection to ensure compatibility in engine context.
- Enhanced `Game` model to build VM context conditionally based on mission requirements and Hacktivity mode.
- Adjusted `show.html.erb` to reflect explicit API base paths and improved handling of player state for JSON responses.
2025-11-28 16:28:25 +00:00
Z. Cliffe Schreuders
ea079b11c9 WiP implementing VM integration 2025-11-28 15:36:10 +00:00
Z. Cliffe Schreuders
3a64ffe8f1 Finalize implementation plan for VM and CTF Flag Integration following Review 4
- Updated last modified date and added new review document reference.
- Added policy methods for `GamePolicy#submit_flag?` and `MissionPolicy#create_game?`.
- Fixed authorization in `games#create` to use `:create_game?` and removed redundant `VmSet` authorization.
- Clarified loading of `hacktivity-cable.js` with CSP nonce.
- Included fallback for non-Hacktivity mode in VM set validation.
- Documented minor amendments and verification checklist for implementation readiness.
2025-11-28 15:00:13 +00:00
Z. Cliffe Schreuders
0c25124967 feat: Update VM console integration to use ActionCable for async file delivery 2025-11-28 14:23:39 +00:00
Z. Cliffe Schreuders
752fb2c4f9 Implement Review 3 updates for VM and CTF Flag Integration
- Added detailed review documentation for Hacktivity compatibility.
- Addressed critical issue: implemented missing `games#create` action in GamesController.
- Updated `MissionsController#show` to handle VM-required missions differently.
- Clarified deployment order for migration to remove unique index.
- Added recommendations for strong parameters in `games#create`.
- Documented necessary changes for flag submission and VM set display.
- Verified compatibility of model structures and updated flag submission logic.
2025-11-28 14:00:27 +00:00
Z. Cliffe Schreuders
dd720130c7 update plans 2025-11-27 23:44:51 +00:00
Z. Cliffe Schreuders
a3690b6a68 Implementation plan for VMs 2025-11-27 23:28:44 +00:00
Z. Cliffe Schreuders
ddbe707182 feat: Update project overview and deployment modes in AI coding agent instructions 2025-11-26 23:02:51 +00:00
Z. Cliffe Schreuders
613ac6d4e7 feat: Update license information to AGPL v3 and clarify in README 2025-11-26 22:47:50 +00:00
Z. Cliffe Schreuders
f412d9ba25 feat: Add comprehensive Objectives and Tasks Guide with examples and best practices 2025-11-26 22:42:19 +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
6b1d73f987 feat: Enhance objectives system with new NPC interactions and Ink dialogue integration 2025-11-26 11:18:25 +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
575dc9aad0 Add updated TODO checklist and corrected code snippets for objectives system
- Created an updated TODO checklist outlining phases and tasks for the objectives system implementation.
- Added corrected code snippets for critical fixes, including door unlock event emission and key pickup event handling.
- Documented necessary changes to ensure proper event emissions for objectives tracking.
- Reviewed and approved the implementation plan with minor corrections regarding door unlock events.
2025-11-25 23:13:58 +00:00
Z. Cliffe Schreuders
26fc297ad8 Refactor tests and improve NPC handling
- Updated NPC ink loading tests to ensure proper handling of missing story files.
- Adjusted lazy loading tests for rooms to enhance clarity and maintainability.
- Enhanced unlock system tests by adding inventory checks for keys.
- Refined filtered scenario tests to ensure accurate preservation of game state.
- Improved game model tests to validate unlock functionality with various inventory scenarios.
2025-11-25 16:28:18 +00:00
Z. Cliffe Schreuders
b317103c83 fix: Update CI test command and adjust RuboCop configuration for string literals 2025-11-25 16:14:46 +00:00
Z. Cliffe Schreuders
6d06a33a07 Add rubocop-rails-omakase to Gemfile for CI linting
The CI workflow was failing because rubocop was not available in the bundle.
Adding rubocop-rails-omakase which provides the omakase Ruby styling rules
that are configured in .rubocop.yml.
2025-11-25 16:07:05 +00:00
Z. Cliffe Schreuders
50e262c15d Fix GitHub CI configuration for Rails engine
- Fix test command syntax: change 'bin/rails db:test:prepare test' to 'bin/rails test:prepare'
- Remove unnecessary dependencies: google-chrome-stable, curl, libjemalloc2, libvips
- Remove unused screenshot upload step (no system tests)
- Remove commented Redis service configuration
- Simplify to only install sqlite3 for testing
2025-11-25 16:07:05 +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
3cc9fafcec feat: Enhance mission management with CyBOK integration and collection filtering
- Added `Cybok` model to manage CyBOK entries associated with missions.
- Implemented `by_collection` scope in `Mission` model for filtering missions by collection.
- Updated `missions_controller` to filter missions based on the selected collection.
- Introduced `CybokSyncService` for syncing CyBOK data from mission metadata to the database.
- Created new views and partials for displaying CyBOK information with tooltips using Tippy.js.
- Added metadata fields to `break_escape_missions` for `secgen_scenario` and `collection`.
- Enhanced mission seeding logic to support new metadata and CyBOK entries.
- Added multiple new mission scenarios with associated metadata.
2025-11-25 15:20:05 +00:00
Z. Cliffe Schreuders
797b075cbe feat: Add mission metadata and CyBOK integration with JSON schema and example files 2025-11-25 14:59:57 +00:00
Z. Cliffe Schreuders
9cad11a853 fix: Correct key pin values for CEO office key to ensure proper unlocking 2025-11-25 14:59:49 +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