173 Commits

Author SHA1 Message Date
7b1ec777d3 feat: Enhance player and weapon logging for better debugging and tracking
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 17:32:45 +01:00
7e1855ebda refactor: Update audio logging for clarity and consistency
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 16:54:03 +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
6e53da7095 Refactor entity, HUD, menu, music, and SFX modules for improved readability and consistency in code formatting
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-19 13:46:00 +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
ac6edb030e Refactor SixelRasterizer and SoftwareRasterizer for improved terminal handling and menu rendering
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 20:21:35 +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
d93f467163 Refactor rasterizer classes to centralize HUD drawing and pixel decoding
- Introduced `decodePixel` method in `VgaImage` to handle pixel mapping for planar VGA images.
- Updated `AsciiRasterizer`, `SixelRasterizer`, and `SoftwareRasterizer` to utilize the new `decodePixel` method for improved clarity and reduced code duplication.
- Centralized HUD drawing logic in the `Rasterizer` base class with `drawStandardVgaHud` method, allowing subclasses to easily implement HUD rendering.
- Removed redundant HUD drawing methods from individual rasterizers, streamlining the codebase.
- Enhanced documentation for clarity on methods and their purposes.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 17:25:20 +01:00
be03bd45c8 Refactor ASCII rasterizer to support terminal ANSI mode and improve menu text rendering
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 16:06:20 +01:00
839fae700f WIP fixing menu rendering in CLI ASCII mode
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 14:08:21 +01:00
dc1acb7a2f WIP pushing menu to game engine - improving menu text clarity in ASCII mode
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 12:45:04 +01:00
e39dfd5da0 WIP moving difficulty selection to engine
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 12:25:59 +01:00
0f7c77e85a Set default CLI rasterizer to be ASCII
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 10:03:30 +01:00
3c6a4672f7 Refactor and enhance documentation across the Wolf3D project
- Updated library imports to use the correct package paths for consistency.
- Added detailed documentation comments to various classes and methods, improving code readability and maintainability.
- Refined the GameSelectScreen, SpriteGallery, and VgaGallery classes with clearer descriptions of their functionality.
- Enhanced the CliInput class to better explain the input handling process and its interaction with the engine.
- Improved the SixelRasterizer and Opl2Emulator classes with comprehensive comments on their operations and state management.
- Removed the deprecated wolf_3d.dart file and consolidated its functionality into wolf_3d_flutter.dart for a cleaner architecture.
- Updated the Wolf3dFlutterInput class to clarify its role in merging keyboard and pointer events.
- Enhanced the rendering classes to provide better context on their purpose and usage within the Flutter framework.

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 10:01:12 +01:00
28938f7301 Refactor game loop to await start and enhance Sixel rasterizer terminal support detection
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 02:43:39 +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
b040b88d8a Cleaned up cli initialization
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 02:06:07 +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
d7692ea325 Improves ASCII rasterization speed and simplifies API
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 01:37:04 +01:00
309bf5c699 Added ability to swap between ASCII and sixel renderers when pressing tab
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 01:02:46 +01:00
58838a1baa Remove ascii theme switching since we don't need it anymore with the updated ascii rasterizer
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 00:16:07 +01:00
0a2e047b65 Fix external CLI launching for vscode
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-18 00:03:51 +01:00
0647f779cd Improved hud in cli
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 23:56:21 +01:00
458c0a5d14 Double "resolution" in the CLI
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 23:41:05 +01:00
72ed1ce968 Cuter cli faces
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 23:18:23 +01:00
f9e4f08363 Added ability to switch ascii themes by pressing tab
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 23:12:35 +01:00
1b75a41cd1 Fix key rebinding
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 20:47:32 +01:00
c424e10475 Enable option to turn on mouselook
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 20:45:29 +01:00
55cf73f7f5 Moved away from singleton pattern
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 20:24:39 +01:00
4c28a66554 Corrected enemy entity mapping
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 20:06:11 +01:00
673f82108d Fix enemy difficulty spawn logic
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 18:46:44 +01:00
62fce48527 Fix dog AI and animations
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 18:24:31 +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
8cb1ea8d9b Fixed some enemy movement logic
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 17:20:24 +01:00
a2f01da515 Fix guard logic
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 16:59:02 +01:00
68dfd1a444 Document the managers
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 15:35:30 +01:00
0e77127585 Enemies now react to shots being fired in the same area
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 14:10:25 +01:00
9c60c81da5 Fix enemy idle->patrolling state transition
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 14:05:20 +01:00
6927c902a7 Fix enemy spawning
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 13:56:49 +01:00
99cca5cc10 Fix wall texture loading and improve loading times
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 13:43:30 +01:00
f282cb277f Fixed sprite rendering bug and death animations
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 13:41:54 +01:00
ff051d1f34 Update enemy sprite IDs
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 13:15:35 +01:00
1575042870 Unified asset painter and added to package. Fixes and simplifes sprite rendering.
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 13:00:04 +01:00
2ff7e04ba4 Added dartdoc comments for enemy types and sprite frame ranges. Added helper methods to enemy types to check for overlapping frames.
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 12:46:27 +01:00
556f89e076 Added the ability to exclude frames from a frame range. This will help with death animations where the sprites are out of order.
Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
2026-03-17 12:38:45 +01:00