Page 1 of 1

NPC not visible in conversation

Posted: Mon Sep 21, 2015 8:47 am
by wipethestars
Have an issue with an NPC disappearing in conversations when switching or loading into a later scene. To explain. Making a quick prototype with four playable characters in Unity with Adventure Creator , RT-Voice and dialogue system, which all works very well so far. However I have a problem with one of the NPC's that works just as expected in scene 2. but when I load scene 1 and run it and then load back into scene 2 that NPC disappears when entering its conversation ( the lines are displayed, but the character model isn't visible and the RT-voice doesn't speak the line: basically the same result as if I go into the scene and rename the NPC in the scene; when running the conversation in game it has the same effect, as if the Dialogue system doesn't associate database player with NPC in the scene anymore). That NPC will function fine in scene 1 regardless, so it is only one directional goinf forward in scene order. This doesn't happen to the other NPC's, which are set up in the exact same way and are also part of conversations in scene 1 and 2. I can fix the issue in scene 2 by removing and re-adding the NPC, but as soon as I load back into scene 1 or run the game from scene 1 into scene 2, the problem comes back. Both scenes share the same dialogue database and it certainly looks like something is stored inside the dialogue manager / database that is causing this problem? Any ideas anyone, its driving me a bit potty:) Cheers

Re: NPC not visible in conversation

Posted: Mon Sep 21, 2015 11:18 pm
by Tony Li
Hi,

Are you continuing the same conversation across scenes? Or is it a separate conversation in each scene? When a conversation starts, it generates a new cache of character transforms. But it releases this when the conversation ends. When the next conversation starts (even if it's a restart of the same conversation), it starts with a new, empty cache.

Sharing a dialogue database across scenes is no problem. In fact, that's the recommended way to do it.

If you set the Dialogue Manager's Debug Level temporarily to Info, does the logging in the Console view provide any insights?

Re: NPC not visible in conversation

Posted: Tue Sep 22, 2015 4:34 am
by wipethestars
Cheers for the reply,

No it's two separate conversations in the same database. Unfortunately the debug set to info doesn't give any insights as to what is going wrong either.
I discovered however that I hadn't set set the Actor / conversant in the third party adventure creator scriptable action "Conversation". If I do set that NPC that goes missing as the conversant this fixes most of the problem. However I left them empty originally as that works with all other characters and for some reason, if I define the Actor in that action as the player they become invisible (probably better said "not associated correctly"): Guess this has to do with my setup. I am whiteboxing a 4 character setup, which can all be players, so there is a lot of player switching replacing with NPC's going on, as well as the player not only deciding on the player dialogue options but the NPC response options as well, which leads to some rather heavy branching in the dialogue trees. So setting the conversant as the one NPC that gets un-associated works for the conversation between player and just that NPC, however it doesn't solve the issue in later conversations that involve more than just the player and that particular NPC, but also the other two NPC's (in essence a four way conversation); obviously if I set the NPC as the conversant for those conversations it will override the other characters as defined in the actual conversation. This 4 character conversation works surprisingly well without defining actor / conversant in the scriptable action, so I would very much like to keep them that way.
As originally described the main issue I am trying to debug is why this is only happening to one of the NPC's but not the others, which are set up in the exact same way. In the original setup the NPC in question was the last one to deliver a line in scene 1 before switching, which I have changed to see whether that was causing it, but it wasn't:)
The effect I see is pretty much exactly like going into the scene and changing the name of the NPC in the scene, so the present NPC character in the scene doesn't match the dialogue database character name and the dialogue manager therefore doesn't associate the character correctly. So I was wondering if there is a hidden integer or other variable on each character in the database that might get changed after the first conversation (much like a "run first" variable or something) that might be causing this?

Thanks again.

Re: NPC not visible in conversation

Posted: Tue Sep 22, 2015 9:11 am
by Tony Li
Thanks for describing your setup. I'll test this out later today and get back to you. Can you please give me more details about what you mean "becomes invisible?" Is this a 2D or 3D game? Are you using the Camera() sequencer command to point the camera to the speaker? (If you're leaving the dialogue entry's Sequence field blank, it's using the Dialogue Manager's Default Sequence, which is probably set to do this, too.) Can you post a screenshot of a visible character and an invisible character situation?

Here's how the AC Dialogue System Conversation action works internally: If the actor is unassigned, it uses the first GameObject that it finds that's tagged "Player". If the conversant is unassigned, it doesn't apply a primary conversant GameObject.

When a line is spoken, the Dialogue System checks if it's spoken by the primary actor or primary conversant. If so, it uses that GameObject. Otherwise it looks for a GameObject whose name exactly matches the actor name in the dialogue database.

Once it has the GameObject, it looks for an Override Actor Name component on it. If it has an Override Actor Name, it uses this name in the NPC Portrait Name text element. Otherwise it uses the GameObject name.

Re: NPC not visible in conversation

Posted: Tue Sep 22, 2015 12:55 pm
by wipethestars
Thanks Tony,

It's a 3D game and I'm using default sequencer cameras. "invisible" is very much the wrong way of phrasing it (" it seems to loose the association in the dialogue manager, so it doesn't focus the camera correctly on the speaking NPC but a wall for example) The NPC itself stays in the scene ( I can see it in the scene viewer, but not the game camera).

Re: NPC not visible in conversation

Posted: Tue Sep 22, 2015 2:49 pm
by Tony Li
Hi,

If you temporarily set the Dialogue Manager Debug Level to Info, it will show the transforms used for each Camera sequencer command. Are the correct transforms being used? If so, perhaps the scale of the characters are different from the default camera angles' Closeup angle. This angle is set as something like 1.8 units up and 1 unit away from the subject.

You can specify a different set of camera angles of your characters are a different size. Please see the Camera Angles tutorial for instructions. If your characters are different heights, such as a child and a giant, you can specify different default camera angles for each one by adding a Default Camera Angle component to the characters.