Answered
1
0

First of all, I love the marker and tempo system in Fmod Studio – it’s great! One thing I’d really like to be able to do is get access to a list of all the markers in a given EventInstance. I’m working on a music game and I want to be able to mark specific, musically relevant moments in Fmod Studio that my game code can watch for and then react to with cool particle FX, animations, etc.

I was hoping that getSyncPoints() on the Sound class might contain marker data but my testing indicates that this isn’t the case. Is there another place this information is stored that I could get at, or is it simply not accessible? All I really need is a list of markers with their names and timeline positions so that I can use getTimelinePosition() to trigger events in my game when specific markers are reached.

If anyone knows if this is possible and/or how to achieve it I would be very grateful. Thank you for your time!

  • You must to post comments
Best Answer
0
0

Currently this is not exposed to the API, but it is a good suggestion. We’ll look at exposing it in a future revision. There would be two ways of getting it, one would be from the event description, and another would be to receive a callback when passing a marker on an instance.

  • anteevy

    Is this possible right now? When loading an event, I need my game to setup the environment based on which markers (names) are used in the event. I know that the callback is implemented, but I’d need the information even before that and not only when the marker is passed.

    E.g. if I have a marker named “A” appearing throughout the event, I want to spawn an enemy that listens to markers named “A” to be triggered and then act. But if the current event only has markers B and C, I don’t want to spawn that enemy, as it could never act because of the missing “A” markers.

    My fallback solution right now is to have a separate “metadata” file where I manually store information like this. But it would reduce the overhead immensely if I just could ask FMOD for a list of all markers and their positions in the event when loading it.

    Thanks!

  • Richard Simms

    Hello Anteevy,

    You are able to get callbacks from FMOD when a marker is passed using the FMOD_STUDIO_EVENT_CALLBACK_TYPE and the FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES API calls.

    https://www.fmod.org/docs/content/generated/FMOD_STUDIO_EVENT_CALLBACK_TYPE.html
    https://www.fmod.org/docs/content/generated/FMOD_STUDIO_TIMELINE_MARKER_PROPERTIES.html

    There isn’t a way to get a list of markers from an event without playing it, but you can still use your game code to simply spawn the enemy when you get a callback from marker “A”.

    I hope this helps.
    Richard

  • anteevy

    Thanks for the quick reply! I feared as much. I’m trying to setup everything before any markers are hit. But if that’s not possible, maybe I’ll just add extra markers at the start that contain the information I need in their name. This would at least be better than extra metadata files.

  • Richard Simms

    Hi Anteevy,

    An alternative you can use is to enter all known markers into the event’s User Properties section (under the Overview on the far right hand side) and then to use Studio::EventDescription::getUserProperty to pull this information out.

    https://www.fmod.org/docs/content/generated/FMOD_Studio_EventDescription_GetUserProperty.html

    This way you will have the names of the markers without needing to play the event itself and without any extra metadata files.

    Thanks,
    Richard

  • anteevy

    Cool, that also helps a lot, didn’t know that. Thanks!

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.