Issue with stutter.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Tondo
Posts: 3
Joined: Mon May 22, 2017 2:13 am

Issue with stutter.

Post by Tondo »

Hey guys,

I have the "trial" version of this asset installed and everything seems great enough to shell out the money except for one thing. It seems that there is a noticeable though not game breaking stutter whenever activating a dialogue the first time. Its only really significant the first time however. My game is a 2D top down RPG. What I have running in this scene is very simple. Any help?
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Issue with stutter.

Post by Tony Li »

Hi,

The stutter is usually caused when the Dialogue System loads the dialogue UI from a prefab. If the Dialogue Manager's Preload Resources checkbox isn't ticked, does the stutter go away if you tick it?
Tondo
Posts: 3
Joined: Mon May 22, 2017 2:13 am

Re: Issue with stutter.

Post by Tondo »

No sorry that doesn't change anything. The preload resources is already ticked.
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Issue with stutter.

Post by Tony Li »

Does the example scene "Assets / Dialogue System / Examples / Unity UI Examples / Generic UI Example Scene" stutter?

Are you using the Dialogue Manager prefab (from Assets / Dialogue System / Prefabs), a legacy Unity GUI prefab (e.g., from Prefabs / Legacy Unity GUI Prefabs), a Unity UI prefab (from Prefabs / Unity UI Prefabs), or something else?

Is your Dialogue Manager's Debug Level dropdown set to Info by any chance?
Tondo
Posts: 3
Joined: Mon May 22, 2017 2:13 am

Re: Issue with stutter.

Post by Tondo »

The example demos seem to work fine with no significant stutter as far as I can tell. I'm using the dialogue manager prefab with default JRPG unity UI prefab. The Debug level is set to error.

Regardless I do like the asset so maybe I could do a slightly hacky solution where I use a screen hiding transition transition (fade to black ect.) and then load a "conversation." This seems like it would work since you can tell the dialogue manager to not destroy itself on load.
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Issue with stutter.

Post by Tony Li »

Hi,

Try adding this script to your Dialogue Manager. Then select a conversation from the dropdown menu. When the script starts, it will start (and then immediately end) the conversation. This should push whatever is causing the stutter to the moment that the scene starts rather than when your first actual conversation starts.

PrewarmDialogueManager.cs

Code: Select all

using UnityEngine;
using PixelCrushers.DialogueSystem;

public class PrewarmDialogueManager : MonoBehaviour
{

    [ConversationPopup]
    public string conversation;

    void Start()
    {
        Debug.Log("Prewarming Dialogue Manager.");
        var originalDebugLevel = DialogueDebug.Level;
        try
        {
            DialogueDebug.Level = DialogueDebug.DebugLevel.None;
            Lua.MuteExceptions = true;
            DialogueManager.PlaySequence("None()");
            if (DialogueManager.MasterDatabase == null || DialogueManager.MasterDatabase.GetConversation(conversation) == null) return;
            var model = new ConversationModel(DialogueManager.MasterDatabase, conversation, null, null, false, null, -1, true, true);
            var view = this.gameObject.AddComponent<ConversationView>();
            view.Initialize(DialogueManager.DialogueUI, DialogueManager.Instance.gameObject.AddComponent<Sequencer>(), DialogueManager.DisplaySettings, null);
            view.SetPCPortrait(model.GetPCTexture(), model.GetPCName());
            var conversationController = new ConversationController(model, view, true, null);
            conversationController.Close();
        }
        catch (System.Exception)
        {
            // Ignore exceptions when doing this extra-thorough preload step.
        }
        finally
        {
            DialogueDebug.Level = originalDebugLevel;
            Lua.MuteExceptions = false;
        }
    }
} 
If that doesn't help, or if you'd like to get to the bottom of what's causing the stutter, please feel free to send a reproduction project to tony (at) pixelcrushers.com. I'll be happy to take a look.
Post Reply