Footsteps, one shot or reusing a EventInstance?

I’ve used FMOD for quite some time now but this question suddenly popped up in my head regarding player footsteps and I wanted to see how y’all think about it.

In my head, it makes sense to just create an EventInstance and calling start for each footstep, like reusing it I guess.

Would there be any difference in regards to keeping an EventInstance active until the player is deleted which “stores” the footstep sound versus playing one-shots each time?

Cheers guys :slight_smile:

Yes. Because the event instance would continue existing between footsteps, it would continue to take up memory even when not playing. Granted, the amount of memory required for a stopped event instance isn’t much, but it’s not zero, either.

By contrast, because you are not reegularly creating and destroying instances, re-using the same event instance will allow you to minimize the CPU time involved in those activities, as well as to minimize the amount of disk access required to load the event’s assets.

In addition, if there’s ever a situation in which you want multiple instances of the event to be playing at the same time (perhaps because both your player’s feet hit the ground at almost the same time), you will need a second instance of the event that plays at the same time as the first, which is impossible to achieve when there’s only one instance of the event that you constantly reuse.

Cool cool cool, thanks for your input! :slight_smile: