Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Discussion of topics that don't fit other sub-forums.
Post Reply
PersonMan
Posts: 9
Joined: 12 Jul 2022 00:22

Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by PersonMan »

Hello! I'm looking to add a visual novel plugin to handle story sequences in my game. I love the Naninovel sample project on https://naninovel.com/demo/ but I have some questions about the workflow that the demo doesn't cover. I'm an engineer so feel free to give technical answers.

Audio : I'm currently using FMOD in the other parts of my game. How does Naninovel operate with an existing FMOD plugin?

More Audio : I don't hear any voice acting in the demo scene. Does Naninovel support speech? If so, how?

Asset Bundles and Addressables : My hope is that I can use Addressables to store all the visual novel assets as AssetBundles. How well does Naninovel work using this workflow? Would it present any issues? Is there a sample project that shows how one would do this?

User avatar
Elringus
Admin
Posts: 482
Joined: 11 May 2020 18:03

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by Elringus »

Hi, We don't support FMOD out of the box, but it's possible to override the audio handler (w/o modifying the sources). Here is the guide on overriding engine services: https://naninovel.com/guide/engine-serv ... n-services For this case specifically though, it would probably be enough to provide a custom IAudioPlayer implementation (assigned in Naninovel's audio config).

Regarding voice over, Naninovel provide multiple options, including auto-playing the voices associated with printed text; here are the docs: https://naninovel.com/guide/voicing

Addressables are supported out of the box; check the docs for more info and an example project: https://naninovel.com/guide/resource-pr ... ddressable

PersonMan
Posts: 9
Joined: 12 Jul 2022 00:22

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by PersonMan »

Thank you for that information, I'll look over the documentation regarding engine services.

Since my game already saves user progress on a remote server and stores nothing locally, I won't need any built-in Save/Load functionality. Is this something that can be enabled or disabled easily?

User avatar
Elringus
Admin
Posts: 482
Joined: 11 May 2020 18:03

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by Elringus »

It's possible to provide custom serialization handlers, which are used when saving/loading the state: https://naninovel.com/guide/state-manag ... n-handlers

PersonMan
Posts: 9
Joined: 12 Jul 2022 00:22

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by PersonMan »

Looking at the interface for IAudioPlayer it unfortunately requires inputs that are specifically UnityEngine audio components, such as AudioPlayer, AudioClip, and the like. Using FMOD, the project will contain none of these things, and thus the interface isn't usable. It would seem to require a significant change. It's a little ironic in that my project already contains My.Namespace.IAudioPlayable to abstract away FMOD from UnityEngine as-is.

While I could possibly change NaniNovel.IAudioPlayer's signatures (or possibly just add signatures that don't rely on UnityEngine classes) this is not ideal since I would have to maintain these changes every time I update the library.

Since the goal of NaniNovel is to be services based, would it be possible for you to better support this by removing hard dependencies on UnityEngine's implementations in your interfaces, so that your users can more freely use middleware?

PersonMan
Posts: 9
Joined: 12 Jul 2022 00:22

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by PersonMan »

Additionally, IAudioManager appears to have the same situation inherent to it, as it too would need a new set of signatures to support a custom implementation that controls the volume, loads resources, since it also uses UnityEngine audio in its signatures. The work could be quite extensive, and might unfortunately be a showstopper.

User avatar
Elringus
Admin
Posts: 482
Joined: 11 May 2020 18:03

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by Elringus »

Thank you for the feedback! Unfortunately, removing AudioClip from interfaces will require significant breaking changes, which we can't allow in the stable stream. I'll look into addressing this in v2 release.

User avatar
Elringus
Admin
Posts: 482
Joined: 11 May 2020 18:03

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by Elringus »

I have no experience with FMOD, but it looks like it's possible to make it work with Unity's AudioClip: https://qa.fmod.com/t/load-an-audioclip ... nd/11741/2 I also remember several users mentioning they were able to use Naninovel with FMOD.

PersonMan
Posts: 9
Joined: 12 Jul 2022 00:22

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by PersonMan »

That's an interesting approach, and it could work for one-off audio like speech or sound effects that don't require randomization. Music is a different matter though, since one of the main reasons to use FMOD or other audio middleware is the variety of ways it can easily create adaptive soundtracks, loops with intros, and various other tricks that Unity do not make practical with AudioSource/AudioClip alone, and which are desirable features.

I think if you do decide to support audio middleware as options for audio services it's worth investigating how the middleware packages and bundles assets as well.

User avatar
Elringus
Admin
Posts: 482
Joined: 11 May 2020 18:03

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by Elringus »

Actually, I think it could be possible to just ignore the audio manager and use FMOD directly via custom commands. You'd probably need to manage the played FMOD audio state via either custom state or custom engine service to make it work with the built-in save-load and rollback systems, but otherwise it should be pretty straightforward.

PersonMan
Posts: 9
Joined: 12 Jul 2022 00:22

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by PersonMan »

Now that's an interesting approach. Thank you for the insight and the willingness to problem solve! I'll have a deeper look at the custom command and custom engine service.

Would dealing with custom state (or really any saving/loading) be strictly necessary if the goal is to use naninovel as a way to display brief narrative cutscenes between game segments in a non visual novel game?

User avatar
Elringus
Admin
Posts: 482
Joined: 11 May 2020 18:03

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by Elringus »

Would dealing with custom state (or really any saving/loading) be strictly necessary if the goal is to use naninovel as a way to display brief narrative cutscenes between game segments in a non visual novel game?

If you don't need rollback and save-load inside the cutscenes I guess it's not necessary.

PersonMan
Posts: 9
Joined: 12 Jul 2022 00:22

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by PersonMan »

Good news, the custom commands route is totally legit and I verified that I can play bgm using one. I think at this point it's just a matter of implementing the specific features the custom commands will need in order to play FMOD audio. The sample project and documentation showing Naninovel being used as a dropin dialogue system was very helpful.

As a side note regarding FMOD integration, the path I took included creating a NullAudioManager class to replace the standard one, mainly for logging purposes, to help remind a writer to use the custom commands instead:

Code: Select all

[InitializeAtRuntime(@override: typeof(AudioManager))]
public class NullAudioManager : IAudioManager{
...
}

What I noticed while getting things set up is that since the Naninovel video player service implicitly relies on IAudioPlayer so it too breaks due to needing the Unity AudioMixer, which is null. Fortunately I don't require the video player for this use case, but it's definitely a dependency that I think a future version would do well to untangle

User avatar
Elringus
Admin
Posts: 482
Joined: 11 May 2020 18:03

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by Elringus »

Thank you for the notice. I didn't initially consider overriding core Unity modules, hence this kind of leaking dependencies. V2 will have a standalone core w/o any references to Unity, so issues like that won't happen again.

PersonMan
Posts: 9
Joined: 12 Jul 2022 00:22

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by PersonMan »

For what it's worth, it's a really easy oversight to make, and I imagine most people just making a simple VN won't bother with audio middleware so it is slightly off the golden path. All this aside, the library is extremely interesting and the structure behind it is quite impressive alongside the active support.

Restush
Posts: 7
Joined: 31 Aug 2020 08:26

Re: Questions about what kind of workflows Naninovel supports: FMOD, Addressables

Post by Restush »

I have made custom configuration and custom service called Audio FMOD a few days ago. It's a simple service using Scriptableobject to hold eventReference. It loaded all Scriptableobject of FMOD on started. It also have basic command like @bgmf @sfxf @stopf. It also support save & load, that you can resume timeline of a music on load. I also want to add intro parameter command for looping, but FMOD already handle it. It also have dispose method, so don't worry about memory. It's quite experience to make a custom service.

If you need my help setting up FMOD with Naninovel, you can contact me on discord restush#6563.

Image

Post Reply