Resources and Event Instruments


(James) #1

When it comes to resources and efficiency what are some good rules to follow? Is it best to keep Events to a minimum? What about referenced events, event track count?

Example:

Using one event for multiple types of melee weapon attacks, instead of separate events.

Melee attack event with 4 nested event instruments on parameter timeline.

  • Nested event punch - Nested event sword, etc.

versus

using one event and just placing the different weapon multis on a parameter timeline (track count can get out of hand if each weapon has multiple layers).

Just looking for some general thoughts - Fmod does allow multiple solutions so perhaps it just comes down to preference?


(Joseph Harvey) #2

As you’ve guessed, there’s no One True Way to arrange your project. Still, there are a few pieces of general advice we can give you that might help you optimize for performance:

  • Adding events and assets to a project increases the size of your built banks, but won’t meaningfully change the amount of CPU and memory your game will require at run time. Don’t be afraid to add events to your project if it makes your project easier to use.
  • The more complex an event is and the more content it has, the more CPU and memory each instance of that event will need at run time. This is true even if an event only plays a small fraction of its content when triggered. This means it’s usually better to have “a bunch of events that each do exactly one thing when triggered” than it is to have “one giant event that can do all those things, and chooses which to do based on its parameter values when triggered.”
  • An effect on a track in an event instance requires the same amount of CPU and memory as that effect would require on a bus in the mixer. However, because you can easily have multiple contemporaneous instances of an event but never have more than one instance of a given mixer bus, putting effects on mixer buses instead of event tracks can save a lot of resources.
  • Streaming audio assets is a great way to avoid having to load large files into memory. However, each streaming audio file requires constant disk I/O in order to work, and most platforms can only handle a single-digit number of simultaneous I/O streams. Try to avoid having more than one or two streaming audio files playing at a time.
  • You can put instruments onto the master track as well as onto audio tracks, reducing the number of audio tracks your events need. Admittedly, event tracks are already very cheap - but a minute saving is still a saving, and this one is fairly easy to arrange.

Of course, there are many good reasons to make events that don’t obey the above guidelines, and if you can make a your game sound fantastic