When enabled, audio acoustic simulation appears to severely degrade the performance of AudioEmitters in my game, cutting my framerates by three quarters, from 120 to 30.
Thanks a bunch! This was a very confusing issue for me to narrow down – for weeks I’d been thinking it was the fault of a private beta I’ve been helping test.
Acoustic simulation uses physics queries under the hood; the most common one checks how dense the parts within a region are. Since this placefile uses MeshParts that are fairly close together, that ended up being slow – both because it has to scan more parts, and the parts themselves aren’t simple convex shapes. So one fix is to make that density-in-region query faster (but more approximate). This could also be made faster by using simpler Parts or toggling some of the meshes to AudioCanCollide = false
The other thing is that we’re doing these queries asynchronously on background threads, but updating the physics data structures on a foreground thread. Those background threads need to coordinate with the foreground thread so that there isn’t a data-race/crash. That coordination mechanism was giving equal priority to all threads – but in this case we need the foreground thread to “always win”, because it impacts the framerate
I’m seeing vastly improved framerates than what I had been seeing, but there’s still a noticeable jump in frame time. But yes, situation very much improved at the moment.