We used the “Volumetric Fog & Mist 2” package for mist rendering, using its fog-of-war feature, we were able to paint mist into our level exactly where we wanted it, and also dynamically create or destroy mist. This works by writing to a texture that gets sampled and multiplied with the mist density. Reading that texture, we can determine how much mist surrounds any object, which we use for dynamically muffling audio. Specifically, all sounds are put through a low pass filter modulated by the player’s mist density, and every sound produced by the player or enemies has its volume and range reduced based on the mist density.
We also use this system to affect enemies' detection of the player. Our basic guard enemy can hear the player’s footsteps; louder footsteps (such as when falling or sprinting) can be heard from farther away. Upon detecting the player, enemies scream to alert each other. The range of this scream is also reduced if the enemy is in mist, giving the player another avenue of skill expression.
The mist clearly blocks vision for the player, but it also blocks vision for the enemies. We raymarch from an enemy to the player to determine the amount of mist between them. When there’s less mist, the enemies can see the player more easily.
I made useful editor-only gizmos to help us visualize enemy sense range and help us with their placement.