Version 1.0.1: sound that stays on
Version 1.0.1 is out for Apple Silicon and Intel Macs, and both downloads carry the same number from now on. I plan to write a short post like this for every build.
What was wrong with the sound
The first time I got into combat, most of the sound stopped a few seconds after every load. Menu clicks still worked. Hits and switches did not, and after a while it all came back. The frame rate stayed at the game's own 30.
The game plays most effects once, in a fresh sound buffer, and then keeps asking whether each one has finished. When it hears that it has, it throws the buffer away. My sound code never answered "finished" while the speakers were running. It worked out where playback was by subtracting the audio still queued in the device, and it kept subtracting the full queue even after the effect had run out of samples. So every effect looked like it was still playing, for as long as the game cared to ask. The game keeps a count of busy voices and stops starting new ones around a hundred, so new sounds were dropped until the game cleared everything at once.
I only saw this after adding a small log to the app that records what the game does to its sound buffers. In the log, one 12 KB effect had been asked about more than 34,000 times and never released. Now an effect reports finished about 30 ms after its last sample plays. In my last session the most sounds playing at once was 10, against about 90 before, and about a thousand effects played in five minutes.
Two other sound bugs
I also fixed two smaller things I found while reading the code. One flag the game can pass when it writes into a streaming buffer was mixed up with another, and DuplicateSoundBuffer did nothing. I do not know whether this game hits either one. They were wrong and they are fixed.
macOS 13
The Intel build already ran on macOS 13. Apple Silicon 1.0.0 said it needed macOS 15, because one library called a macOS 15 function without checking. That is fixed, so both builds now say macOS 13. Nobody has run either one on macOS 13 or 14 yet, so I would like to hear from anyone who does.
Three small log files
The app now writes audio-last-session.txt, audio-trace.txt and frame-hitches.txt next to the launcher log when you quit. They hold counts and times, such as how long each frame took and which sound buffers were played. They hold no audio and no account details, and nothing is sent anywhere. If you report a sound or stutter problem, attach them. The launcher has an Open Logs Folder button.
Still not right
There is a short delay at the start of a mission before all the sound is there. I have not looked at it yet.
The game also stalls for 300 to 500 ms now and then, often around loading. It is not the drawing or the network. During those frames the game falls back to a slow path for code my translation did not cover, up to 1,800 times in one frame, and that is my next suspect.
The Intel build still has not run on a real Intel Mac.