the more there's basic ship, the more each shot sound produced is louder, fix this #229
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Done in
885f977.Every hull owns its gun and asks for its own shot sound, so eight ships firing on the same cooldown started eight voices playing the same sample in the same frame. Those amplitudes add, which is exactly the "louder the more ships there are" in the title — a full fleet was the loudest thing in the game by a wide margin.
Sfx.play()now takes a per-sound coalescing window. A volley is one event to the ear, so it gets one voice. 70ms, which the test checks is inside the fastest gun's 500ms cooldown — it collapses "six guns at once", never "six shots in a row".PICKUPandASTEROID_BREAKgot one too: ore arrives in bursts when a rock breaks, and a burst is one pickup to the ear. Deaths and the boss scream are deliberately left alone — several things dying together really is several events.One existing case had to move rather than be weakened:
test_sfx's pool-saturation check was driven by shots, which by design can no longer saturate anything. It is driven by deaths now — what the pool actually has to absorb — and gained a case asserting a volley takes exactly one voice, measured against the real pool rather than the gate.Verified in reverse: without the window, "8 ships firing together started 8 shot sounds".