13 Commits

Author SHA1 Message Date
c62ea013ba feat: Implement patrol path markers and enhance enemy movement logic
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 18:48:11 +01:00
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
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
8bf0dbd57c Add shareware HUD module and integrate with asset registry for improved HUD handling
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 14:29:12 +01:00
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
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
de0d99588e Refactor enemy state handling to change standing variants from ambushing to idle
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 11:43:47 +01:00
786ba4b450 Refactor rendering architecture and replace rasterizer with renderer
- Introduced SoftwareRenderer as a pixel-accurate software rendering backend.
- Removed the obsolete wolf_3d_rasterizer.dart file.
- Created a new wolf_3d_renderer.dart file to centralize rendering exports.
- Updated tests to accommodate the new rendering structure, including pushwall and projection sampling tests.
- Modified the WolfAsciiRenderer and WolfFlutterRenderer to utilize the new SoftwareRenderer.
- Enhanced enemy spawn tests to include new enemy states.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 11:38:07 +01:00
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
7fe9a8bc40 Added some additional sound effects
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 02:40:53 +01:00
806c9b6966 Refactor enemy sound handling and improve enemy type definitions
- Updated enemy classes to include alert and attack sound IDs.
- Refactored checkWakeUp and attack logic to play sounds appropriately.
- Enhanced enemy type definitions with sound mappings.
- Added unit tests for enemy spawn and validation.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 02:26:44 +01:00
7ee1d0704d Fixes pushwalls and a bunch of ASCII/sixel rasterizer issues
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 02:02:39 +01:00
815ca4a13e Added tests for validating enemy sprite ranges
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 17:30:56 +01:00