Commit Graph

20 Commits

Author SHA1 Message Date
hans 85fddd3df5 feat: Add CompatibleSaveGameCodec for legacy W3DS support and enhance SaveGamePersistence with existence check
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 15:14:46 +01:00
hans de8bff1964 feat: Add original layout envelope save codec with encoding/decoding and tests
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 14:57:36 +01:00
hans db06f5f5cb feat: Implement save game functionality with encoding/decoding
- Added SaveGameCodec for encoding and decoding save game files.
- Introduced SaveGamePersistence interface for slot-based save game persistence.
- Implemented FlutterSaveGamePersistence for file-based save management on Flutter.
- Enhanced WolfEngine to support saving and loading game states.
- Updated menu manager to include save/load game options.
- Created tests for SaveGameCodec to ensure proper functionality.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 14:50:53 +01:00
hans 1a93b7d4a2 feat: Implement save and restore functionality for game session state, including player and entity states
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 14:37:58 +01:00
hans 604923618a feat: Implement player locomotion constants and update movement logic in engine
feat: Add key icons to HUD modules and implement key rendering in HUD
test: Add player movement and rotation parity tests to ensure consistency with classic Wolf3D
test: Enhance HUD rendering tests for gold and silver key icons

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 12:04:25 +01:00
hans 7941c2902c refactor: Improve formatting and readability of secret-exit transition test
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 11:36:59 +01:00
hans b0f6e865b4 feat: Update HUD rendering to display current player lives dynamically
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 11:36:07 +01:00
hans 1165e0bc44 feat: Implement map overlay toggle functionality and rendering across input and rendering systems
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 11:08:43 +01:00
hans d63b316f1b feat: Implement fizzle fade transition effects for menus and intros, enhancing visual transitions
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-23 11:00:48 +01:00
hans 3270338f44 feat: Implement Change View and Renderer Options menus
- Added functionality to display and navigate the Change View menu in SixelRenderer and SoftwareRenderer.
- Introduced methods to draw the Change View and Renderer Options menus, including handling cursor and selection states.
- Updated WolfClassicMenuArt to include a customize label for the new menu.
- Enhanced WolfMenuScreen to support new menu states.
- Created tests for Change View menu interactions, ensuring proper transitions and renderer settings toggling.
- Implemented persistence for renderer settings in Flutter, allowing settings to be saved and loaded from a local file.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 20:49:37 +01:00
hans 10417d26ba Refactor audio module to use built-in music and sound effect identifiers
- Introduced BuiltInMusicModule and BuiltInSfxModule to replace RetailMusicModule and RetailSfxModule.
- Updated RetailAssetRegistry and SharewareAssetRegistry to utilize the new built-in modules.
- Removed deprecated MusicKey and SfxKey classes, replacing them with Music and SoundEffect enums for better clarity and maintainability.
- Adjusted music and sound effect resolution methods to align with the new structure.
- Updated audio playback methods in WolfAudio and FlutterAudioAdapter to accept the new Music and SoundEffect types.
- Refactored tests to accommodate changes in audio event handling and ensure compatibility with the new identifiers.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 17:07:25 +01:00
hans 8cca66e966 feat: Add Audio Gallery screen and integrate into Debug Tools menu
feat: Implement audio playback controls and audio management in the gallery
refactor: Update audio engine interface to include stopAllAudio method

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 16:15:46 +01:00
hans e060aef3f1 feat: Add quit callback support to engine and UI components
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 10:04:01 +01:00
hans 9b053e1c02 Refactor menu rendering and state management
- Introduced _AsciiMenuTypography and _AsciiMenuRowFont enums to manage typography settings for menu rendering.
- Updated AsciiRenderer to utilize new typography settings for main menu and game select screens.
- Enhanced SixelRenderer and SoftwareRenderer to support new menu rendering logic, including sidebars for options labels.
- Added disabled text color handling in WolfMenuPalette for better visual feedback on menu entries.
- Implemented a new method _drawSelectableMenuRows to streamline the drawing of menu rows based on selection state.
- Created a comprehensive test suite for level state carry-over and pause menu functionality, ensuring player state is preserved across levels and menus.
- Adjusted footer rendering to account for layout changes and improved visual consistency across different renderers.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-20 09:58:48 +01:00
hans 4700e669ce Enhance enemy AI and area connectivity
- Introduced area grid management in WolfEngine to track player-connected areas.
- Updated enemy behavior to consider area connectivity when alerting and moving.
- Added debugging logs for enemy states and movements to assist in tracking AI behavior.
- Implemented fallback area generation for levels lacking area data.
- Enhanced patrol behavior for dogs and guards to prevent rapid direction changes after hitting walls.
- Updated tests to validate new area connectivity logic and enemy behavior under various conditions.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 18:03:01 +01:00
hans 225840f3ee feat: Implement difficulty scaling for enemy damage and enhance enemy behaviors
- Added `scaleIncomingEnemyDamage` method to `Difficulty` enum for handling damage scaling based on difficulty level.
- Introduced `lives` attribute to `Player` class with methods to manage lives.
- Updated enemy classes (`Dog`, `Guard`, `Mutant`, `Officer`, `SS`, `HansGrosse`) to utilize difficulty settings for health and damage calculations.
- Modified enemy drop logic to reflect new collectible types and behaviors.
- Created tests for verifying enemy drop parity, collectible values, and difficulty damage scaling.
- Adjusted enemy spawn logic to ensure standing enemies remain idle until alerted.
- Enhanced scoring system to reflect updated score values for different enemy types.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 16:02:36 +01:00
hans 57dde0f31c Refactor collectible handling and scoring system
- Introduced `CollectiblePickupContext` and `CollectiblePickupEffect` to streamline the collectible pickup logic in the Player class.
- Updated the `tryPickup` method in the Player class to utilize the new effect system for health, ammo, score, keys, and weapons.
- Refactored collectible classes to implement the new `tryCollect` method, returning a `CollectiblePickupEffect`.
- Enhanced enemy classes to expose score values based on their type.
- Added unit tests for scoring ownership and shareware menu module functionality.
- Updated rendering logic in various renderer classes to use the new mapped picture retrieval system.
- Improved the `WolfClassicMenuArt` class to utilize a more structured approach for image retrieval based on registry keys.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 14:25:14 +01:00
hans fcda0f9ff4 Add built-in asset modules for Wolfenstein 3D v1.4 Shareware release
- Implement RetailSfxModule to map sound effects to numeric slots.
- Create SharewareAssetRegistry to manage assets for the Shareware version.
- Introduce SharewareEntityModule to define available enemies in Shareware.
- Add SharewareMenuPicModule to handle menu pictures with runtime offset computation.
- Implement SharewareMusicModule for music routing in Shareware.
- Define keys for entities, HUD elements, menu pictures, and music tracks.
- Create abstract modules for entity, HUD, menu picture, and music assets.
- Add registry resolver to select appropriate asset registry based on game version and data version.
- Update WolfensteinData to include new asset registry exports.
- Modify tests to utilize the new asset registry structure for Shareware and Retail versions.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 13:45:19 +01:00
hans 0e143892f0 Refactor menu rendering and improve projection sampling
- Updated AsciiRasterizer to support game and episode selection menus with improved layout and cursor handling.
- Enhanced SixelRasterizer and SoftwareRasterizer to modularize menu drawing logic for game and episode selection.
- Introduced new methods for drawing menus and applying fade effects across rasterizers.
- Adjusted wall texture sampling in Rasterizer to anchor to projection height center for consistent rendering.
- Added tests for wall texture sampling behavior to ensure legacy compatibility and new functionality.
- Modified Flutter audio adapter to use nullable access for active game and adjusted game selection logic in the main class.
- Cleaned up input handling in Wolf3dFlutterInput by removing unused menu tap variables.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 20:06:18 +01:00
hans 7fe9a8bc40 Added some additional sound effects
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 02:40:53 +01:00