Re: Portrait Flashing on Conversation Start
Posted: Sat Dec 23, 2023 3:43 pm
Tony,
Back with an update after doing some experiments.
I think I've narrowed the specific issue down to the following:
Here's a frame-by-frame example of what I observed in game, where Subtitle Panel 1 is the Default PC Subtitle Panel and Subtitle Panel 2 is the Default NPC Subtitle Panel:
Frame 1:
Back with an update after doing some experiments.
I think I've narrowed the specific issue down to the following:
- If the player has a line in a conversation, the Subtitle Panel set to Default PC Subtitle Panel will always set its Portrait Image as whatever the default animation state is per the player's animator controller.
- Even if the player doesn't have the first line in a conversation, the Dialogue Manager will briefly bring the Default PC Subtitle Panel to the front (for one frame) before the Default NPC Subtitle Panel.
- Because the Default NPC Subtitle Panel does not assign an image to its Portrait Image child game object until 1 frame after the Default PC Subtitle Panel, the 'flash' of the player's Dialogue Portrait image issue occurs, even though the Default NPC Subtitle Panel is lower in the hierarchy and is in front of Subtitle Panel 1.
Here's a frame-by-frame example of what I observed in game, where Subtitle Panel 1 is the Default PC Subtitle Panel and Subtitle Panel 2 is the Default NPC Subtitle Panel:
Frame 1:
- The Dialogue Manager begins a conversation.
- Subtitle Panel 1's 'Portrait Image' child object is activated and sets its UI Image as the first frame of the default animation in the player's Animator Controller.
- Subtitle Panel 1's 'Portrait Name' child object activates and displays the player character's name.
- Subtitle Panel 0's Portrait Image and Portrait Name child game objects are not yet activated.
- In the Hierarchy, Subtitle Panel 1 is higher than Subtitle Panel 0 (which means Subtitle Panel 0 would display on top of it, if it was showing anything.)
- Subtitle Panel 1's 'Portrait Image' child game object remains active, but 'Portrait Name' deactivates.
- Subtitle Panel 0's 'Portrait Image' child game object activates, and we get an overlap between it and Subtitle Panel 1's Portrait Image as Subtitle Panel 2's Portrait Image fades in.
- Subtitle Panel 0's 'Portrait Image' child game object finishes fading in.
- Once the portrait is faded in, Subtitle 0's 'Portrait Name' child game object activates, which displays the NPC's name.
- This issue does not occur in a conversation where the player has no lines of dialogue. (Presumably because Subtitle Panel 1 isn't assigning any images to its Portrait Image child game object.
- This issue does not occur if I go into frame-by-frame mode before the conversation starts, and then advance frame-by-frame while the conversation begins until the first line of dialogue is finished displaying. (e.g.: I advance frame-by-frame in the brief period after an in-game trigger is hit but before the Dialogue Manager starts the conversation.)
- I'm assuming the specific order of operations in terms of how the Dialogue Manager opens Dialogue Panels is set in its script? (I've tried toggling every option I can think of in the Standard Panel UI Component on the Subtitle Panels themselves, but it didn't fix the issue.)
- Is there a way to have the speaker's name (the Portrait Name child game object) activate and display immediately when the conversation starts? It seems to wait a quarter to half of a second after the line starts, and setting an action to activate it at 'On Open()' in the Subtitle Panel's Standard Subtitle UI Panel component doesn't seem to do anything