Page 1 of 1

3D models and effects during dialogue

Posted: Sun Jul 09, 2023 3:27 am
by alsoknownas-stefan
Hi there,

It has been a while. Greeting to you too, Tony, if you are here. I am trying to improve my dialogue with some nice visuals and effects. I am trying to accomplish something similar to this scene (starting at 13 minutes):



This boils down to the following elements:
-switch to different scene
-fade in from black
-objects/animations in background pausing
-3d models slide in from left and right and play their animations
-UI fades in a few seconds later and dialogue starts
-Typing effect of the dialogue (like on a type writer)
-Press button to continue dialogue
-Change to different animation on 3d model
-Play a sound during a certain dialogue line
-Having 2nd character slide in from the right, the 1st character on the right moves over a bit
-Camera shake effect / other camera effects
-Slide characters out of frame (left and right)
-fade to black
-switch back to original scene

Could someone give me some pointers, some broad strokes, on how to achieve this look?

Re: 3D models and effects during dialogue

Posted: Sun Jul 09, 2023 9:48 am
by Tony Li
Hi,

> -switch to different scene
> -fade in from black


If you want to do this inside a conversation, you can use the save system and the LoadLevel() sequencer command. Assuming you've configured the save system to use the scene transition manager, it will fade to black before changing scenes and then fade in from black after loading the new scene. You can download a preconfigured SaveSystem prefab from the Dialogue System Extras page (direct download). If you use this prefab, make sure not to add a SaveSystem component to your Dialogue Manager, since there should only be one SaveSystem component in the scene.

> -objects/animations in background pausing

Tick the Dialogue System Trigger's Pause Game During Conversation checkbox.

> -3d models slide in from left and right and play their animations
> -UI fades in a few seconds later and dialogue starts


The Dialogue System Extras page has a Render Texture Subtitle Portrait Example scene (direct download) that shows how to use 3D models for portrait images.

I recommend starting with the VN Template Standard Dialogue UI and customizing it. (Dialogue UI Tutorials)

> -Typing effect of the dialogue (like on a type writer)

This is built into all of the provided dialogue UI templates. If you make your own dialogue UI, add a TextMeshProTypewriterEffect or UnityUITypewriterEffect (depending on whether you're using TMPro or UI Text).

Related: > -Press button to continue dialogue

Inspect the Dialogue Manager GameObject. Set Display Settings > Subtitle Settings > Continue Button to Always.

Related: How To: Bypass Response Menu When Player Has One Choice

> -Change to different animation on 3d model

Use the AnimatorPlay() sequencer command to control the 3D model's animation.

> -Play a sound during a certain dialogue line

Put the sound in a folder named Resources. Drag the sound into the dialogue entry node's Sequence field. Then click the "+" button to the right of the Sequence field and select "Include Dialogue Manager's Default Sequence". This is part of a larger topic. See:
> -Having 2nd character slide in from the right, the 1st character on the right moves over a bit

You can play animations on the subtitle panels to adjust portrait positions.

> -Camera shake effect / other camera effects

This isn't built into the Dialogue System, but you can write custom sequencer commands to do it. Or use the Feel integration.

> -Slide characters out of frame (left and right)

Like above, use subtitle panel animations.

> -fade to black
> -switch back to original scene


Use LoadLevel() again or the Fade() sequencer command.

I recognize that this is a lot of info. If you have questions about any specific point, please let me know.

Re: 3D models and effects during dialogue

Posted: Sun Jul 09, 2023 11:34 am
by alsoknownas-stefan
Hi Tony,

Thank you for your very detailed answer like always. :D
This will get me up and running in no time. You have saved me a lot of struggle.

So, If I understand correctly, basically I am using a portrait camera and showing whatever is inside the frustum on a flat raw image that is inside the UI. Ok, that should not be too hard to cook up. I will get to work and I will document my findings in this thread for the next person.

I also found this thread, which has some more clues: https://www.pixelcrushers.com/phpbb/vie ... php?t=4144

See ya soon

Re: 3D models and effects during dialogue

Posted: Sun Jul 09, 2023 11:45 am
by Tony Li
Glad to help!

Re: 3D models and effects during dialogue

Posted: Fri Jul 14, 2023 8:11 pm
by alsoknownas-stefan
Hi there,

As for the good news, I got the 3d model portraits / render textures working. :D For the bad news, I got two problems.

#1: I am using the text animator / feel integrations. When I tick the Dialogue System Trigger's Pause Game During Conversation checkbox, the text animator also halts. How do I fix this?

#2: With the feel integration, in BundleDemos > Integrations > TalkingTrees > TalkingTrees demo scene, the camera shakes and other feedbacks are not working. How do I fix this?

Anyone got a solution?

Re: 3D models and effects during dialogue

Posted: Fri Jul 14, 2023 9:19 pm
by Tony Li
alsoknownas-stefan wrote: Fri Jul 14, 2023 8:11 pm#1: I am using the text animator / feel integrations. When I tick the Dialogue System Trigger's Pause Game During Conversation checkbox, the text animator also halts. How do I fix this?
Inspect the Text Animator component and change Main Settings > Time Scale to Unscaled.
alsoknownas-stefan wrote: Fri Jul 14, 2023 8:11 pm#2: With the feel integration, in BundleDemos > Integrations > TalkingTrees > TalkingTrees demo scene, the camera shakes and other feedbacks are not working. How do I fix this?
Are you using the latest versions of everything (Dialogue System, Feel, Text Animator, and the demo scene asset)?

Are there any errors or warnings in the Console window?

Re: 3D models and effects during dialogue

Posted: Sat Jul 15, 2023 5:39 am
by alsoknownas-stefan
>>Inspect the Text Animator component and change Main Settings > Time Scale to Unscaled.

That solves the problem, but also freezes my portrait render textures, which makes sense. To solve my problem of wanting the background to freeze during the conversation and letting the portrait render textures animate, I will write a custom function that grabs and freezes all animators in the scene, except for the animators that are used on the characters that the render texture cameras are pointed on. There is no way around that, I guess. But that is okay, since I am sufficiently skilled to make this.

>>Are you using the latest versions of everything (Dialogue System, Feel, Text Animator, and the demo scene asset)?

Yes. Clean project.

Installation order:
2.2.38.2 dialogue system for unity
feel 3.12, asks to update some files to new Unity API, I apply this.
text animator 2.0.1
feel support integration package
text animator support package
TMP essentials and extras
bundles demo feel / text animator / dialogue system

Seems it does work to some degree, but I cannot figure out why.

Consider the Bundles demo scene, TalkingTree dialogue database, conversation named Trees.

Because it’s too easy to get<?suspenseStart><shake a=.1 f=.1>...</><?suspenseStop> <?jokeDelivered><b><swing><bounce>stumped</></b>!

I would expect that <?jokeDelivered> executes a camera shake, since the Joke Delivered gameobject has an MMF player component and a Camera shake component (and the main camera a MMCameraShaker component). Here, it does not work.

In the sequence of the final line,
<wiggle>Too true</wiggle>! I always have trouble getting to the <b><swing>root</></b> of the problem.
there is a line in the sequence MMF(play, CallToActionReveal)@6.5;

The MMF(play, CallToActionReveal) does work and the CallToActionReveal gameobject also has an MMF Player and a Camera Shake component. There is no difference between settings between the Camera Shake components on the MMF Players and the Camera Shake components on the Joke Delivered gameobject and the CallToActionReveal gameobject. The only difference is the Initialization mode on the MMF player, which is set to Awake on the Joke Delivered gameobject and set to Start on the CallToActionReveal gameobject. Changing Awake on the MMF player component on the Joke Delivered gameobject to Start has no effect.

I would say the conclusion is that tags like <?jokeDelivered> in the dialogue text do not work and tags like MMF(play, CallToActionReveal)@6.5; in the sequence do work.

Can you confirm?

Re: 3D models and effects during dialogue

Posted: Sat Jul 15, 2023 10:21 am
by Tony Li
I think the custom actions got reset when I updated the scene to Text Animator 2. I'll ask the dev (Febucci) to update the scene since I don't remember exactly what those were supposed to do. I'll post here when it's been updated on the Asset Store.