FMOD Haptics instrument issues

I’m having trouble figuring how to get a haptics instrument to loop, and also how to set the length of the Haptics Instrument on the timeline to the length of the .haptic clip. So far I have everything working, and can successfully:

  • Author a .haptic file in Meta Haptics Studio
  • Add it to the timeline of an FMOD event
  • Play the haptic instrument (the controller vibrates correctly)
  • Play the haptics at runtime in Unity

Essentially everything is working on the technical end, but in FMOD Studio, it appears that a some basic/necessary functionality is not showing up?

The TL;DR is:

  • It seems like Haptics Instruments’ playback behavior is always Async (not necessarily what I expected but ultimately not a big deal)
  • It seems like there is no way to loop the .haptics asset within a Haptics Instrument
  • It also seems like you can’t use “Resize to Content’s Length” on a Haptics Instrument, which means you can’t easily put a loop region around the Haptics Instrument on the timeline either
  • I’m pretty certain that looping behavior isn’t specified when creating the actual .haptic asset file

And so my question is:
How do you author basic looping behavior for haptics?
(And also how do you make a Haptics Instrument on a timeline be the duration of the .haptic that it plays?)

Is looping just done in a different way that I don’t know about? Because with where I’ve gotten so far, it looks like you can’t loop a controller vibration until you tell it to stop in the same way you often need to be able to do with sounds. I thought it was supposed to be as easy as clicking a single button.

Ok, that was the TL;DR. You can absolutely not read the rest of this in order to understand my question. Nevertheless, the following is the short novel I wrote at first about how I investigated all the ways I thought I could be overlooking a slightly different implementation of that feature, which after writing I realized it would practically be rude to not add a TL;DR. The above it really all there is to my actual question, but feel free to experience the journey I went on trying to figure out how to loop haptics:


First, dragging a .haptic file onto the timeline directly from the assets browser will create a Haptics Instrument as expected (just as dragging an audio clip will create a Single Instrument), except no matter which .haptic clip I drag into the timeline, the created Haptics Instrument is always one second long, regardless of the duration of the .haptic clip, so it is always longer or shorter than the actual haptic feedback that it plays.

This wouldn’t normally be an issue at all, except when right clicking on the Haptics Instrument, the context menu is missing the “Resize to Content’s Length” option that you find when right clicking a Single Instrument or Multi-Instrument.

Another issue is looping a .haptics clip or Haptics Instrument. From initially trying to contain the Haptics Instrument clip on the timeline within a Loop Region, it quickly becomes obvious that the Haptics Instrument is treated as Async. That’s totally fine, but often when working with Async you also set the content of the Async instrument to loop. There are essentially no controls in the Deck for a Haptics Instrument that affect playback behavior at all, which is where I would expect to find the option to loop the .haptic asset within the Haptics Instrument that’s on the timeline.

And then this brought me back to the previous issue, because my next idea was to at least put the Haptics Instrument inside of a loop region. But that is essentially guaranteed to be imperfect, because unless I author a .haptics clip that’s exactly 1 second long, I can’t reliably set the length of the Haptics Instrument to match the length of the .haptics clip that it’s playing without the “Resize to Content’s Length” operation that is absent from the Haptics Instrument’s context menu.

So my next assumption was that looping isn’t meant to be handled in FMOD, but rather in Meta Haptics Studio when authoring the .haptic asset. That seems to not be the case either, because over there as well there doesn’t seem to be anywhere to define loop points either. Eventually I found an example project with a .haptic clip that was meant to be used as a loop, and between that and some of that project’s documentation I concluded that looping is not defined in the authoring of a .haptic asset, but rather it is handled when that asset is implemented. That example project was assuming the use of their SDK for the relevant game engine, which implies that the loop behavior must be intended to be created in Unity with their Unity Haptics SDK. Buuuut…

Isn’t the whole point of the Haptics Instrument supposed to be that FMOD can be used for haptics implementation as an alternative to the Unity Haptics SDK? The Meta Haptics website has an entire page about how it can be used with FMOD or Wwise which includes a paragraph under the heading “Work entirely within FMOD or Wwise”.

The example project I found with a loop .haptic clip also had a matching "start’ and “stop” clip with it, which means the intended implementation is almost certainly to have all three in their own Haptics Instruments, with at least the start Instrument being the exact length of the .haptic asset, so that the playback can go seamlessly from the start sound to the loop sound as soon as the playback reaches the exact end of the start clip. And looping the loop clip would either use a loop region for the Haptics Instrument or loop the .haptic asset within the Instrument.

But without “Resize to Content’s Length” I don’t see how this implementation could be done in a way that isn’t excessively time consuming and clearly a workaround, and even still, there are many circumstances where the expected way to do it is by looping the contents of the Async Haptics Instrument clip rather than using a loop region for the Instrument itself.

So anyway, yeah. How do you loop haptics?

Hi, thank you for reaching out and the detailed post.

You are correct, that the haptics instrument currently does not support the looping behavior of a normal async instrument which is being fixed in our up coming major release 2.04. Unfortunately, this behavior will not be backwards compatible with 2.03. So using a loop region is the only way to get it to loop currently.

I have passed this onto our development team to investigate further.

As you have discovered, currently to loop a Haptic instrument it will need to be within a loop region. Hopefully, with the Resize to Content's Length function this will become easier.
Again, thank you for the detailed post.

As you have discovered, currently to loop a Haptic instrument it will need to be within a loop region.As you have discovered, currently to loop a Haptic instrument it will need to be within a loop region.

Ok. But since the Haptics Instruments don’t have the rest of the Async options, in this case Cut, that means that the vibration will play out until the end of the entire clip specified in the .haptics asset. I guess this means that my question is now:

What is the intend way for developers to implement vibrations that go with sounds and game events that need to stop based on something that happens at runtime? Or in other words: How do we handle haptics with transition regions or magnet regions?

We are encouraged to set up the haptics the same way as the audio, as a clip of the same length as the audio loop clip, and use a loop and transition region also of the same length, but that means that the vibrations will continue for the duration of whatever the remainder of the loop region was from when playback was transitioned by the transition region.

For example, if the event has a 5 second loop region, and it is stopped 1 second into that loop region, the loop sound will immediately stop, and it will play any stopping sounds positioned at the destination marker, but since haptic instruments are additive meaning they don’t override each other when a new one is played (which is definitely how it should work in general), the vibrations for the loop will continue for another 4 seconds longer than they were supposed to. For a 5 second loop region, which is probably not that extreme of an example, this means that it’s even likely that the vibrations for the stop sound will finish playing before the loop clip vibrations even stop playing.

The other option is to make the looping haptics clip very short so the loop region can have the shortest remaining length that will still play after it should have stopped, but that’s just minimizing the effect of the problem rather than solving it. But more importantly, that would restrict you to having the audio loop be the same short length as the haptics loop, or only using async audio. async is probably fine most of the time, but it is still not uncommon to need looping audio that is not async.

The next workaround idea I’ve come up with for this is to put the haptics as well as its loop region into a nested event. Hopefully stopping a nested event will cut off the remainder of the haptics clip, but it’s very possible it doesn’t. I will have to test it tomorrow. If that doesn’t work, I think the only other option would be to cut up the haptics clip into very short chunks and export them from Haptics Studio as individual .haptics assets to be played back to back within the loop region just so the length of it that continues playing when it should have stopped is as short as possible.

The need for this playback behavior is so common, and these workarounds feel like such extreme compromises, that I feel like I’m just not aware of the intended workflow. Can you really not stop a haptics clip while it’s still playing?

You completely right, I have made another task to add Cut behavior to the haptic instruments as well. Thank you for bringing this to our attention.

Another workaround which may require less implementation

You can add automation on the intensity of the haptic instrument using the timeline position so set the value. This way it will appear as though the instruments are stopping and starting as then play head moves over them. Again, this is still not ideal and only a workaround for the moment.

If you need to move the audio and haptic instruments, you won’t have to reauthor the curves:

Haptics

As well as resizing:

Length

Hopefully these workarounds will make it easier to work with haptic instruments in the mean time.

Once there are updates on both the tasks, I will update this thread.

Oh duh, that should have been an obvious thing to try. I’m actually surprised and a little disappointed in myself that I didn’t think of that already. That is a completely functional workaround and is not even that inconvenient or time consuming to do. Thank you very much for this solution.

Nevertheless, I am still very interested in the next major update for many reasons. Do you know approximately when that will be released, or is it more of a just "when it’s ready? type of thing?

Thank you again. That’s a fantastic workaround (and I totally should have tried it already lol).