Page 2 of 4

Re: Portrait Flashing on Conversation Start

Posted: Wed Dec 20, 2023 4:52 pm
by lcn_mc
Tony,

Ah, that seems to have fixed it. There's a very brief pause (0.25sec, I'd guess) before the portrait panel appears now, but that's not too big an issue. (I'm going to tinker with the timings on things where possible, and may make a separate thread about it depending on what I find.)

Many thanks for the quick reply and the insight on addressing this edge case.

Cheers!

Re: Portrait Flashing on Conversation Start

Posted: Wed Dec 20, 2023 7:19 pm
by Tony Li
Glad to help!

Re: Portrait Flashing on Conversation Start

Posted: Thu Dec 21, 2023 3:18 pm
by lcn_mc
Tony,

I think I spoke too soon in my last reply, as I noticed this morning that the fix of setting the Dialogue Panel's Visibility to 'Always From Start' has introduced a new issue that I didn't catch yesterday when testing. Here's what I'm observing while 'Always From Start' is set:

At the start of a conversation, the default animation for the speaker's Dialogue Portrait will play until the current line of dialogue finishes, after which the correct animation gets played. (As if the Sequence Commands are not being run until after the first step in the conversation finishes displaying its text.)

Example:
  • Character 'Sally' has two animations for her Dialogue Portrait: Normal and Angry
  • I have a conversation where Sally is angry in the first step, so I use a Sequencer Command to play her 'angry' portrait animation in that step.
  • When this first step occurs, Sally's portrait is using her default animation ('Normal', in this example) until all of the text in the first dialogue step is displayed, after which her Dialogue Portrait begins using the correct 'angry' animation
I didn't see any settings that immediately seemed relevant here (neither within the Dialogue Manger nor the Subtitle Panel), so I figured I'd outline what I'm seeing and get your input.

Appreciate the help as always, Tony.

Re: Portrait Flashing on Conversation Start

Posted: Thu Dec 21, 2023 3:57 pm
by Tony Li
Hi,

It sounds like it could either be an animator controller issue or an issue with the sequence not playing right away.

How are you controlling the animations? AnimatorPlay() sequencer commands? If so, what is the first node's Sequence?

Re: Portrait Flashing on Conversation Start

Posted: Thu Dec 21, 2023 6:18 pm
by lcn_mc
Tony,

I'm controlling animations through Sequence Commands used at each step in the conversation. In most cases, I'm using Sequencer Shortcuts to call animations. Here's an example of one of the Sequencer Shortcuts and the corresponding full sequencer command it points to:

{{Sally_Normal_Talk}} (This animation would for the character 'Sally,' with her 'normal' expression, in a 'talking' state that has her dialogue portrait doing a simple open/close mouth sprite swap animation that swaps to her idle animation whens he's done talking.)

Code: Select all

AnimatorPlay(Sally_Normal_Talk, speakerportrait); required AnimatorPlay(Sally_Normal_Idle, speakerportrait)@{{end}};
I'm using Articy Draft 3 in my workflow, so I'm putting the Sequencer Commands (or Sequencer Shortcuts) in the 'Stage Directions' field of each step in the conversation when creating them. When exported, Articy conversations add a node called '{group} <input>' at the start of each conversation. This node is empty.

So, the first two nodes of all of my conversation have the default <START> node (which has a single 'Continue()' in its Sequence field by default, then the Articy-added {group} <input>' node, and then my conversation content.

Strangely, if I use 'Always From Start' for the Dialogue Panel's 'Visibility' setting, the portraits immediately use the correct animation I'm setting in the Sequence field without doing the 'use default animation per the character's Animation Controller until the first line of text is completed' issue I'm describing here. (But, if I have 'Always From Start' set, then I hit that 'one frame of wrong portrait' issue discussed earlier.)

Re: Portrait Flashing on Conversation Start

Posted: Thu Dec 21, 2023 8:00 pm
by Tony Li
As a test to get more info, please set that conversation's first sequence / Stage Directions to something like:

Code: Select all

AnimatorPlay(Sally_Angry_Talk, speakerportrait)@0.1;
required AnimatorPlay(Sally_Normal_Idle, speakerportrait)@{{end}};
In other words, delay the first command for 0.1 seconds. This will tell us if the command is working but isn't able to transition the animator for some reason. For example, maybe the Portrait Image GameObject isn't active yet for some reason.

Re: Portrait Flashing on Conversation Start

Posted: Fri Dec 22, 2023 2:00 pm
by lcn_mc
Good morning, Tony.

I tried adding the '@0.1' to the end of the first AnimatorPlay line, and it didn't seem to do anything.

I was stepping through the Console (frame by frame) to see if maybe there's a culprit in there (or some indication of where to look next), and I did notice a warning about 'Animator does not have an AnimatorController' (related to the Portrait Image game object, which is a child of the Subtitle Panel parent), but this only seems to occur for a few frames before the character's Animator Controller is populated to that field. Still, wanted to mention that because maybe it might help your diagnosis.

And here's an interesting twist for you: I've observed that if I do frame-by-frame advance while the game is running in the Unity editor, the issue seems to get worse in that the dialogue portrait animation will not change to the correct one until I advance to the next step in the conversation. (Whereas if I'm playing in editor normally, without doing frame-by-frame, the dialogue portrait animation will change to the correct animation, albeit it a quarter to half-second after all of the text for the current dialogue step finishes displaying.)

Re: Portrait Flashing on Conversation Start

Posted: Fri Dec 22, 2023 2:50 pm
by Tony Li
Hi,

I think I'll need a reproduction or reproduction steps to help. Can you send a reproduction project to tony (at) pixelcrushers.com?

Re: Portrait Flashing on Conversation Start

Posted: Fri Dec 22, 2023 3:30 pm
by lcn_mc
Tony,

I'm at a point in the project where it's got a lot of final content, so I'm not really able to share it out, I'm afraid.

Let me do some more tinkering over the weekend and, next week, I'll see if I can reproduce the issue in a separate scene using dummy assets. If I can get that setup, I'll be able to send something over.

Thanks for all of your help so far on this strange issue.

Re: Portrait Flashing on Conversation Start

Posted: Fri Dec 22, 2023 7:18 pm
by Tony Li
Sounds good. A reproduction project would be best, but if you're unable to put one together we could do a screen share session.