branchrust_reboot/main/animalfootsteps_optimscancel
12 Commits over 0 Days - Infinitycph!
Set rabbit animation events culling range to 20
Added AnimatorEventLOD component, disables animation events past a distance
Applied to all animals, 100m for most, 20 to 60m for critters
For 10 wolves roaming 150m away, all events are now off:
339 B -> 0 per frame
Animation update ~0.05ms per frame cheaper
Only create the sound fade modulator once the sound starts fading, saves the allocation for sounds that never fade
So we never pay useless modulator allocation
Fixed animal footstep sounds not playing until its first idle animation finished
Fixed boars bulls cows and wolves having 4 left foot
Well actually lets drop the sounds from missed rays because that meant all the shit at 0,0,0 would be audible now
Fixed missed rays spawning the footstep sounds at 0,0,0 🙃
Animal footsteps raycast optims:
- On dry terrain, we read the terrain splat map instead of raycasting, one ray every 2 meters to check the animal is still on terrain
- If not on terrain (rocks, base, water) we just do one ray instead of 4
- If the animal is in water, we still play the effect past the audible range to make sure you can see the water splash effects
5 wolves running around on grass, 80% less raycasts
~0.115 -> ~0.08 ms
Skip footstep effect spawning and only keep the sound if they're fully invisible
It cuts all the effect spawning on grass for all animals
Wolf footstep playing in editor: ~0.15ms -> ~0.11ms
(this is not applied if music is enabled because aggressive animals footstep effects increase music intensity when nearby)
Fixed all wild animals in network range casting rays for their footsteps effects regardless of distance (if occlusion culling disabled)
We now match the footstep sound def max hearing distance before casting the ray (around 50 meters)
Was spending 0.5ms and 1.2KB every frame for 4 animals