NVlabs / FPSci

Aim Training Experiments
Other
70 stars 23 forks source link

Fix target sounds not playing and add new default sounds #268

Closed jspjutNV closed 3 years ago

jspjutNV commented 3 years ago

This PR closes #267

This includes the following:

bboudaoud-nv commented 3 years ago

When targets are destroyed (i.e. damaged below 0 health w/o respawn) the hit audio isn't played. It seems like the audio play call is made, but the object is destroyed before it can complete playing. We should add a delayed destruction mechanic to prevent this from happening.

jspjutNV commented 3 years ago

When targets are destroyed (i.e. damaged below 0 health w/o respawn) the hit audio isn't played. It seems like the audio play call is made, but the object is destroyed before it can complete playing. We should add a delayed destruction mechanic to prevent this from happening.

It seems like the destroyed sound also isn't playing. If possible, we should add a fix to both of these sounds not playing issues to this pull request.

jspjutNV commented 3 years ago

Commit 34bf347 fixes the destroyed and hit sounds not playing when the target is destroyed at the same time.

bboudaoud-nv commented 3 years ago

The soundTable approach is a good one to avoid issues like the one mentioned in #267.

I will approve this for now, but for the future we should consider:

  1. Supporting loading sounds ahead of trials (i.e. in FPSciApp::updateSession()) rather than at target spawn time
  2. Storing the soundTable with the Session (rather than FPSciApp) to avoid memory bloat
  3. Clearing the soundTable between sessions if we choose to keep it in FPSciApp