0
0

I am having one hell of a time trying to understand how the event system works. First, I am extremely disappointed in the documentation for it. The documentation is incomplete and makes a huge assumption that you know how Events work. It provides no examples of how to implement Events properly. So, what I would like to do is open a dialog in this thread on how to properly configure events for different scenerios. Perhaps others will find this usefull and maybe it will make it into the documentation.

Here is my current scenerio:

Scene: Outer Space
There are several stationary objects (say large capital ships like carriers, freighters, etc). I want to play an engine hum. As the player flies their ship close to these ships they will hear the hum.

  1. I create a 3D Event named [i:oq90yijh]EngineHum3D[/i:oq90yijh].

  2. I set the number of [b:oq90yijh]playbacks[/b:oq90yijh].
    [b:oq90yijh]Question:[/b:oq90yijh] What does [b:oq90yijh]playbacks[/b:oq90yijh] really mean? Is this the number of [i:oq90yijh]virtual voices[/i:oq90yijh] assigned to this event? Or does this really mean that "You can assign this event as many times as you like but only [i:oq90yijh]number of playbacks[/i:oq90yijh] will play simultaenously"?

  3. [b:oq90yijh]Oneshot[/b:oq90yijh]
    I think I understand this to mean "Loop" or "Not Loop". However, I find that positional (3D) sounds will not loop. If I set the velocity parameter to "loop" I still do not get a loop.

  4. [b:oq90yijh]Question:[/b:oq90yijh] In the [i:oq90yijh]Sound Definition[/i:oq90yijh], what does [b:oq90yijh]Maximum Spawn Sounds[/b:oq90yijh] mean? Does this value need to match the value in the [i:oq90yijh]Event Playbacks[/i:oq90yijh]?

  5. [b:oq90yijh]Question:[/b:oq90yijh] Besides adding the [i:oq90yijh]sound[/i:oq90yijh] in the event editor and adding a wave table to the sound definition, what else should be done to facilitate this scenerio? Are their addtional even definitions or sound definition parameters that need to be set as well (besides effects – we are just talking about the basics right now)?

Now, on to programming….

As I build the scene, I loop through my scene objects and when I get to a capital ship I assign the [i:oq90yijh]EngineHum3D[/i:oq90yijh] event to each ship (using EventProject::getEvent() ). I then update each events position via a scene loop. However, like I said before, each 3D event plays only one time and doesn’t loop.

  1. [b:oq90yijh]Question:[/b:oq90yijh] What else should be done in code to properly handle this type of event?
  • You must to post comments
0
0

[b:1pfkfs0z]Number of playback[/b:1pfkfs0z] means the max number of instances of that event that will appear at the same time. Setting this to 1 means that you will never ever hear more than one instance of the sound. In your case I would recommend a larger number though.

[b:1pfkfs0z]Oneshot[/b:1pfkfs0z] means that when the sound has finished playing, that is when the audible content is finished, the event will stop no matter if the cursor inside the event has reached its desitnation. If your sound isn’t looping I guess it could mean a) you have to set the sound instance as looping in the sound instance properties b) set the prmary parameter to be looping.

[b:1pfkfs0z]Maximum Spawn Sounds[/b:1pfkfs0z] is as I have understood it the same as max playbacks with the difference that it works for sound definition instead of events.

You probably shouldn’t be needing anything else applied to the event than what you described to have it all up and running.

The answer to to your programming question is that it probably should be fixed once you solve the loop-issue inside the designer-tool. And don’t forget to update the eventsystem ’cause otherwise nothing will happen.

  • You must to post comments
0
0

Apparently, the guys are working on updating the Designer documentation at present.

And yeah from what I understand, you just need to change your hum sounds to looping (from the event editor tab, right click on your sound and change the loop mode parameter). In the preferences, there’s a setting to make this the default.

Then as long as your min and max distances are set up correctly for your 3d sound, it should all work as long as you’re updating your listener’s position too e.g. with the player ship’s position. And as Ljudas says, make sure update is getting called or the 3d sounds won’t work properly.

  • You must to post comments
0
0

Thank you both for your replies.

[quote="Ljudas":11hjd6zi][b:11hjd6zi]Number of playback[/b:11hjd6zi] means the max number of instances of that event that will appear at the same time. Setting this to 1 means that you will never ever hear more than one instance of the sound. In your case I would recommend a larger number though.[/quote:11hjd6zi]

Ok. So that I clearly understand this, if I designate four(4) [i:11hjd6zi]playbacks[/i:11hjd6zi] and I have six(6) ships in the scene what happens? Will only four of the six events play at one time? Right now it appears I can successfully assign an event to all six ships.

[quote="Ljudas":11hjd6zi][b:11hjd6zi]Oneshot[/b:11hjd6zi] means that when the sound has finished playing, that is when the audible content is finished, the event will stop no matter if the cursor inside the event has reached its desitnation. If your sound isn’t looping I guess it could mean a) you have to set the sound instance as looping in the sound instance properties b) set the prmary parameter to be looping.[/quote:11hjd6zi]

I did what you said and my sound doesn’t loop.

[b:11hjd6zi]Programming Question:[/b:11hjd6zi] If the event is set to [i:11hjd6zi]Oneshot[/i:11hjd6zi] and set a callback for the event ( FMOD::Event::setCallback() ) and when the Event stops, is the [i:11hjd6zi]EVENT_CALLBACKTYPE_SOUNDDEF_END[/i:11hjd6zi] fired? This is not happeneing now.

[quote="Ljudas":11hjd6zi][b:11hjd6zi]Maximum Spawn Sounds[/b:11hjd6zi] is as I have understood it the same as max playbacks with the difference that it works for sound definition instead of events.
[/quote:11hjd6zi]

This is still vague to me.

You probably shouldn’t be needing anything else applied to the event than what you described to have it all up and running.

[quote="Ljudas":11hjd6zi]And don’t forget to update the eventsystem ’cause otherwise nothing will happen.[/quote:11hjd6zi]

[code:11hjd6zi]

.. in a loop ..

// Update the listener information.
updateListener();

// Call FMOD System Update to update 3D sound.
mFMODEventSystem->update();

[/code:11hjd6zi]

So I guess I am doing that right.

[b:11hjd6zi]Question:[/b:11hjd6zi] Can I utilize the same WAV file for different [i:11hjd6zi]Sound Definitions[/i:11hjd6zi] and then use these different [i:11hjd6zi]Sound Definitions[/i:11hjd6zi] for [i:11hjd6zi]Events[/i:11hjd6zi]? Example:

Hum.Wav -> SD:EngineHumCS -> Event:EngineHumCS
Hum.Wav -> SD:EngineHumSS -> Event:EngineHumSS

  • You must to post comments
0
0

[quote="Van":vscf7xq5]Thank you both for your replies.

Ok. So that I clearly understand this, if I designate four(4) [i:vscf7xq5]playbacks[/i:vscf7xq5] and I have six(6) ships in the scene what happens? Will only four of the six events play at one time? Right now it appears I can successfully assign an event to all six ships.
[/quote:vscf7xq5]

Yes but look at ‘max playbacks behaviour’. What is happening is your other ships are silent because the new getEvent calls kicked them out and the old ones will now be getting FMOD_ERR_INVALID_HANDLE errors.
If you have 6 ships, then you need 6 maxplaybacks.

[quote:vscf7xq5]

I did what you said and my sound doesn’t loop.

[/quote:vscf7xq5]

If you want a sound to look right click on the sound definition box and set it to loop in the sound definition instance properties. The box will change from yellow to blue.

[quote:vscf7xq5]
[b:vscf7xq5]Programming Question:[/b:vscf7xq5] If the event is set to [i:vscf7xq5]Oneshot[/i:vscf7xq5] and set a callback for the event ( FMOD::Event::setCallback() ) and when the Event stops, is the [i:vscf7xq5]EVENT_CALLBACKTYPE_SOUNDDEF_END[/i:vscf7xq5] fired? This is not happeneing now.
[/quote:vscf7xq5]

Sounddef end is when the parameter value leaves the sound definition box and the sound stops.
If you have flagged your event as one shot, it will get EVENT_CALLBACKTYPE_EVENTFINISHED whenever a sound ends.
Alternatively if you have a parameter with a velocity (right click parameter properties) and its mode is ‘one shot and stop event’ it will also trigger this callback.

[quote:vscf7xq5]

[quote="Ljudas":vscf7xq5][b:vscf7xq5]Maximum Spawn Sounds[/b:vscf7xq5] is as I have understood it the same as max playbacks with the difference that it works for sound definition instead of events.
[/quote:vscf7xq5]

This is still vague to me.

You probably shouldn’t be needing anything else applied to the event than what you described to have it all up and running.
[/quote:vscf7xq5]

The max spawn thing is for the random restart feature in the sound definition properties. Nothing else.

[quote:vscf7xq5]
[quote="Ljudas":vscf7xq5]And don’t forget to update the eventsystem ’cause otherwise nothing will happen.[/quote:vscf7xq5]

[code:vscf7xq5]

.. in a loop ..

// Update the listener information.
updateListener();

// Call FMOD System Update to update 3D sound.
mFMODEventSystem->update();

[/code:vscf7xq5]

So I guess I am doing that right.

[b:vscf7xq5]Question:[/b:vscf7xq5] Can I utilize the same WAV file for different [i:vscf7xq5]Sound Definitions[/i:vscf7xq5] and then use these different [i:vscf7xq5]Sound Definitions[/i:vscf7xq5] for [i:vscf7xq5]Events[/i:vscf7xq5]? Example:

Hum.Wav -> SD:EngineHumCS -> Event:EngineHumCS
Hum.Wav -> SD:EngineHumSS -> Event:EngineHumSS[/quote:vscf7xq5]

Yes you can. A wav can be in multiple different sound definitions.

  • You must to post comments
0
0

[quote="Van":2ov7ck4c]
[code:2ov7ck4c]

.. in a loop ..

// Update the listener information.
updateListener();

// Call FMOD System Update to update 3D sound.
mFMODEventSystem->update();

[/code:2ov7ck4c]

So I guess I am doing that right.
[/quote:2ov7ck4c]

you also have to call Event::set3DAttributes for each event and EventSystem::set3DListenerAttributes for 3d sounds to work. if you are still having problems with 3d, try forcing software mixing on your wave banks (in the wave bank properties). you also might want to change the 3d rolloff type in the event properties. logarithmic has not been working for me, i’ve been having to use linear.

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.