Dungeon Wizard: Action roguelike deckbuilder in Zig

Hey, thanks for playing, glad you’re enjoying it!

Creating a release build from source with zig build --release=fast gives me a .exe to play (I’m on windows) but that version for me runs REALLY slow, at unplayable FPS. Unsure if I’m missing some parameters to building (zig build for a debug build did the same). Any tips you can give me here?

Interesting… The builds on itch use ReleaseSafe, and I build them with do-release.sh. But there’s nothing special in there, that script just zips up the files. I run that on Mac OS so it might not work on windows, but the build command is just:
zig build -Dstatic-link -Ddo-release

Then run it with "./zig-out/release/windows-x86_64/Dungeon Wizard/Dungeon Wizard.exe".

FWIW I double checked on my Windows machine to see if ReleaseFast or Debug had any issues and I didn’t see a difference in perf. Any more insight you can give into the FPS issue would be great. Are you running at full resolution? Does running at a smaller resolution help? Is it consistent or spiky? Try setting show_ups_fps=true in debug.zig to check for spikyness. How much memory/CPU is the process using?

Thank you both GigaGrunch and NunoDasNeves :slight_smile: It does run way better if I build with zig build -Dstatic-link -Ddo-release - when running a debug build or with --release=fast it takes up nearly 9gb of memory until it crashes which makes me a bit suspicious. It’s not spiky it basically crashes on load. UPS down to 3, FPS down to 0.4 - but I can at least build from source with decent performance.

1 Like

Ah! Okay well that’s a good clue - probably a memory leak that only shows up when dynamically linked, or when do_release is set. It’s just weird that I can’t repro it in that case…

Couple of things to try, if you have the time:

  1. Grab %APPDATA%\Dungeon Wizard\debug-log.txt, maybe there’s something there
  2. Compile with just -Dstatic-link. If the problem goes away, it’s some weird issue with the DLL loading, maybe? Not sure what that would be…
  3. Compile with just -Ddo-release, see if that option alone fixes it

So I tried smaller resolution for the debug build (I tried just zig build -Dstatic-link run ) and it runs a lot better with display.selected_resolution=(1440, 1080) than
(1920, 1440) I found the options.txt file because I broke it trying out (3840, 2160) and it crashed immediately for both the release (from itch) and debug builds which is probably fair enough I was just messing around :stuck_out_tongue:

compile with just -Dstatic-link: same issue, below 1fps for (1920, 1440), (1440, 1080) gives like 3fps.

compile with just -Ddo-release: Works as well as zig build -Dstatic-link -Ddo-release (although I had to mess about and enable sudo for my windows machine and turn on developer mode? was getting accessdenied errors for updating .zig-cache but I’m out of my depth here a bit, unsure why it was only giving me this error when trying to build without the static linking option)

For fun I did sudo zig build run in powershell and that also gives me below 1fps
unless I change to display.selected_resolution=(1440, 1080)

Small issue, I can play the game and play with the source just doing zig build -Ddo-release because it compiles fast enough, or I can change resolution on the debug build but I might keep playing with it to see if I can spot an issue,

Nothing special in debug-log for the non release builds that I can spot but here it is if you’re interested at all debug-log.txt - Pastebin.com