Skip to content

Adding Duke3D#289

Open
DynaMight1124 wants to merge 3 commits intoducalex:devfrom
DynaMight1124:Duke3D
Open

Adding Duke3D#289
DynaMight1124 wants to merge 3 commits intoducalex:devfrom
DynaMight1124:Duke3D

Conversation

@DynaMight1124
Copy link
Contributor

@DynaMight1124 DynaMight1124 commented Feb 19, 2026

Hi

Just to be upfront, this is entirely AI completed! Its insane on how well it can do things like this. I took your old Duke3D branch for IDF4.x (I got a crazy amount of warnings and compile errors on 5.x) and told AI what I wanted and little by little is all started working.

Tested on:
ESP32 - Not amazing performance, possibly some small gains to be had but may never be full speed! It does technically play. Didnt try any overclocking, which may help.
ESP32-S3 - Actually a very surprising increase, gets a good 30fps and very playable.
ESP32-P4 - Better again, gets a solid 60+fps. In the future, it could probably power through 640x480 res but left at 320x240 to match most RetroGo displays.

  • ESP32: ~16 FPS (at 240x160 internal). Tanks during intense scenes.
  • ESP32-S3: ~30 FPS (at 320x240).
  • ESP32-P4: ~60 FPS (at 320x240).

I tried to keep AI close the Retro-Go 'eco-system' by referencing existing apps like prboom and using RG_x as much as possible so its future proof. I kept it away from making any amendments to existing Retro-Go system (it gets out of the control sometimes!)

It'll need a human eye to cast over it, but it runs well for me!

I'll paste some AI generated stuff below:

Core Enhancements (All Devices)

  • Filesystem Integration: Full integration with Retro-Go path management. Save files, screenshots, and configurations are now organized in system-managed subdirectories (/sd/retro-go/saves/duke3d/ and
    /sd/retro-go/config/).
  • Engine Stability: Modified the sprite spawning logic to gracefully handle limit overflows. Instead of crashing with a "Too many sprites" error during intensive combat (like rapid kicking), the engine now
    logs a warning and skips the non-essential sprite, allowing gameplay to continue.
  • Control Refinement: Updated mappings for a more intuitive handheld experience:
  • Audio Optimization: The audio task was pinned to Core 0 with high priority (15) and tuned to 11,000Hz to ensure stable sound mixing without impacting game logic on Core 1.

Device-Specific Adjustments

ESP32

  • Memory Management: Strictly limited to 4,096 total sprites and 256 maximum on-screen sprites to fit within available RAM.
  • Performance: Configured with an internal resolution of 240x160 (upscaled) to maintain playable frame rates on the original ESP32 architecture. Music is also disabled.
  • Stability: Enabled specific BSS memory segment mapping to PSRAM to prevent internal DRAM overflows. Requires CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y set in sdkconfig

ESP32-S3

  • Enhanced Rendering: Increased maximum on-screen sprites to 512 for more complex visual scenes.
  • Native Resolution: Runs at a native 320x240 internal resolution for crisp visuals.
  • Hardware Support: Compiled and verified across multiple S3 targets

ESP32-P4

  • Maximum Detail: Leverages the P4's power with 1,024 maximum on-screen sprites, allowing for the most detailed rendering of dense environments and debris.
  • Networking: Configured with networking disabled to ensure system stability during the current development phase.
  • Native Resolution: Native 320x240 rendering with high-speed processing.

Content Compatibility (.GRP Files)
The port features an auto-adaptive version system that identifies your game files via CRC32 checksums. The following versions are fully compatible:

  1. v1.3d Shareware (11MB, CRC32: 983AD923)
  2. v1.3d Full / Retail (26MB, CRC32: BBC9CE44)
  3. v1.4 Plutonium Pak (44.34MB, CRC32: F514A6AC)
  4. v1.5 Atomic Edition (44.35MB, CRC32: FD3DCFF1)

Note: I've personally tested Atomic v1.5 and Shareware v1.3D and both work fine. Some shareware versions are v0.99, v1.0 and v1.1, which dont work.

Setup: Simply place your duke3d.grp file in /sd/roms/duke3d/. The engine will automatically detect the version.

Adding Duke3D to supported systems
Some slight ESP32 improvements, moves certain actions to internal ram rather than the much slower PSRAM. Helps a little but still not amazing. Some other cosmetic fixes.
Adds support for additional grp files, tested Plutonium and seems to work fine with the limited testing (first level)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant