Page 1 of 1

Dialogue System 1.7.6 Patch 20171016 Available

Posted: Mon Oct 16, 2017 10:57 pm
by Tony Li
Patch 20171016 is available on the Pixel Crushers customer download site. (PM me your Unity Asset Store invoice number if you'd like access.). This patch contains:
  • NLua: Optimized DialogueLua.Get/SetTableField.
  • NLua: Implemented compressed SimStatus in PersistentDataManager to match default LuaInterpreter.
  • Fixed: UnityUISelectorDisplay & OverrideUnityUIControls continue button weren’t syncing with Dialogue Manager after load game.
  • Fixed: Unity UI Quest Log Window slowdown when mashing Track toggle button.
  • Improved: UnityUITypewriterEffect now automatically adds audio source if necessary.
  • Dialogue Editor: Moved “Link To:” dropdown items “Another conversation” & “New entry” to top of menu.
  • Localized text table editor: Added search bar.
  • [Third Party Support] Rog: Added ReplaceActorSprite() Lua function.
I'm working on I2 Localization for the version 1.7.7 release, which I expect to release on October 31.

Re: Dialogue System 1.7.6 Patch 20171016 Available

Posted: Tue Oct 17, 2017 8:54 am
by liisi.laasik
Saving compressed SimStatus with NLua is crazy-fast. Thank you!

I had a few problems though. Importing the patch crashed Unity (repeatably). However when importing again, all the files were already updated, so apparently the update worked. There was only one (hopefully) relevant line in Editor.log:

Code: Select all

TypeLoadException: Could not load type 'PixelCrushers.DialogueSystem.QuestCondition' from assembly 'DialogueSystem, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Also when running the game, there are hundreds of errors of the same type. The update might have exposed some error in our data. Do you have any ideas?

Code: Select all

Dialogue System: Lua code 'return Actor["NAME_X"].Name' threw exception '[string "chunk"]:1: attempt to index field 'NAME_X' (a nil value)'
UnityEngine.Debug:LogError(Object)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean)
PixelCrushers.DialogueSystem.DialogueLua:SafeGetLuaResult(String)
PixelCrushers.DialogueSystem.DialogueLua:GetTableField(String, String, String)
PixelCrushers.DialogueSystem.DialogueLua:GetLocalizedTableField(String, String, String)
PixelCrushers.DialogueSystem.DialogueLua:GetLocalizedActorField(String, String)
PixelCrushers.DialogueSystem.CharacterInfo:GetLocalizedDisplayNameInDatabase(String)
PixelCrushers.DialogueSystem.OverrideActorName:GetActorName(Transform)
PixelCrushers.DialogueSystem.CharacterInfo:.ctor(Int32, String, Transform, CharacterType, Texture2D)
PixelCrushers.DialogueSystem.ConversationModel:GetCharacterInfo(Int32, Transform)
PixelCrushers.DialogueSystem.ConversationModel:SetParticipants(Conversation, Transform, Transform)
PixelCrushers.DialogueSystem.ConversationModel:.ctor(DialogueDatabase, String, Transform, Transform, Boolean, IsDialogueEntryValidDelegate, Int32, Boolean, Boolean)
PixelCrushers.DialogueSystem.<Bark>c__Iterator5:MoveNext()
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
PixelCrushers.DialogueSystem.DialogueSystemController:Bark(String, Transform, Transform, BarkHistory)
PixelCrushers.DialogueSystem.DialogueManager:Bark(String, Transform, Transform, BarkHistory)
PixelCrushers.DialogueSystem.BarkStarter:TryBark(Transform, Transform)
PixelCrushers.DialogueSystem.BarkStarter:TryBark(Transform)
PixelCrushers.DialogueSystem.<BarkLoop>c__Iterator18:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Re: Dialogue System 1.7.6 Patch 20171016 Available

Posted: Tue Oct 17, 2017 9:46 am
by Tony Li
The error while importing shouldn't be an issue. This can happen if the Unity editor is using a Dialogue System DLL to display a custom editor (e.g., a Conversation Trigger) in an Inspector view while importing, which prevents it from successfully reloading it until you restart Unity.
Dialogue System: Lua code 'return Actor["NAME_X"].Name' threw exception '[string "chunk"]:1: attempt to index field 'NAME_X' (a nil value)'
This means the Actor table doesn't have a element "NAME_X". You can temporarily add a Lua Console to your scene and press ~+L to open it. Then enter: "return Actor" to list the elements in the Actor table.

Re: Dialogue System 1.7.6 Patch 20171016 Available

Posted: Wed Oct 18, 2017 3:51 pm
by Tony Li
liisi.laasik wrote:Also when running the game, there are hundreds of errors of the same type. The update might have exposed some error in our data. Do you have any ideas?
Were you able to identify the source of the errors?

Re: Dialogue System 1.7.6 Patch 20171016 Available

Posted: Fri Oct 20, 2017 4:47 am
by liisi.laasik
Mostly the errors were because our NPC game object names did not match Articy actor names. I did not know the dialogue system has such a convention. Apparently something in the latest update is enforcing this. We are fixing them as we go.

For one of the errors (copied below) I think we need your input tho. When calling DialogueManager:ConversationHasValidEntry with just the one conversation title argument, the transforms are set to null and I suspect later used to query Actor table. The conversation does have ActorID and ConversantID set, so I am not enitrely sure how this is happening.

Code: Select all

Dialogue System: Lua code 'return Actor[""].Display_Name' threw exception '[string "chunk"]:1: attempt to index field '' (a nil value)'
UnityEngine.Debug:LogError(Object)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean)
PixelCrushers.DialogueSystem.DialogueLua:SafeGetLuaResult(String)
PixelCrushers.DialogueSystem.DialogueLua:GetTableField(String, String, String)
PixelCrushers.DialogueSystem.DialogueLua:GetLocalizedTableField(String, String, String)
PixelCrushers.DialogueSystem.DialogueLua:GetLocalizedActorField(String, String)
PixelCrushers.DialogueSystem.CharacterInfo:GetLocalizedDisplayNameInDatabase(String)
PixelCrushers.DialogueSystem.CharacterInfo:.ctor(Int32, String, Transform, CharacterType, Texture2D)
PixelCrushers.DialogueSystem.ConversationModel:GetCharacterInfo(Int32, Transform)
PixelCrushers.DialogueSystem.ConversationModel:SetParticipants(Conversation, Transform, Transform)
PixelCrushers.DialogueSystem.ConversationModel:.ctor(DialogueDatabase, String, Transform, Transform, Boolean, IsDialogueEntryValidDelegate, Int32, Boolean, Boolean)
PixelCrushers.DialogueSystem.DialogueSystemController:ConversationHasValidEntry(String, Transform, Transform)
PixelCrushers.DialogueSystem.DialogueManager:ConversationHasValidEntry(String)
Another issue is with async saves. PersistentDataManager.GetSaveDataAsync() takes a total of 18482 milliseconds while PersistentDataManager.GetSaveData() takes 433 for exactly the same data. They performed the same before the laste update.

Do you have any instructions how to add Dialogue System source to the project instead of the dll? It would be nice to debug the code and give you more detailed input.

Re: Dialogue System 1.7.6 Patch 20171016 Available

Posted: Fri Oct 20, 2017 9:50 am
by Tony Li
liisi.laasik wrote:Mostly the errors were because our NPC game object names did not match Articy actor names. I did not know the dialogue system has such a convention. Apparently something in the latest update is enforcing this. We are fixing them as we go.
It's not an absolute requirement. If you want to use a different GameObject name, just add an Override Actor Name component and specify the actor name. You can read more details here: How GameObject Are Associated With Conversations
liisi.laasik wrote:For one of the errors (copied below) I think we need your input tho. When calling DialogueManager:ConversationHasValidEntry with just the one conversation title argument, the transforms are set to null and I suspect later used to query Actor table. The conversation does have ActorID and ConversantID set, so I am not enitrely sure how this is happening.

Code: Select all

Dialogue System: Lua code 'return Actor[""].Display_Name' threw exception '[string "chunk"]:1: attempt to index field '' (a nil value)'
UnityEngine.Debug:LogError(Object)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean)
PixelCrushers.DialogueSystem.DialogueLua:SafeGetLuaResult(String)
PixelCrushers.DialogueSystem.DialogueLua:GetTableField(String, String, String)
PixelCrushers.DialogueSystem.DialogueLua:GetLocalizedTableField(String, String, String)
PixelCrushers.DialogueSystem.DialogueLua:GetLocalizedActorField(String, String)
PixelCrushers.DialogueSystem.CharacterInfo:GetLocalizedDisplayNameInDatabase(String)
PixelCrushers.DialogueSystem.CharacterInfo:.ctor(Int32, String, Transform, CharacterType, Texture2D)
PixelCrushers.DialogueSystem.ConversationModel:GetCharacterInfo(Int32, Transform)
PixelCrushers.DialogueSystem.ConversationModel:SetParticipants(Conversation, Transform, Transform)
PixelCrushers.DialogueSystem.ConversationModel:.ctor(DialogueDatabase, String, Transform, Transform, Boolean, IsDialogueEntryValidDelegate, Int32, Boolean, Boolean)
PixelCrushers.DialogueSystem.DialogueSystemController:ConversationHasValidEntry(String, Transform, Transform)
PixelCrushers.DialogueSystem.DialogueManager:ConversationHasValidEntry(String)
Are you sure that the conversation's actor ID and conversant ID are set to valid actors? Are their Name fields set correctly? (You can check this in the Dialogue Editor window on the Actors tab.)
liisi.laasik wrote:Another issue is with async saves. PersistentDataManager.GetSaveDataAsync() takes a total of 18482 milliseconds while PersistentDataManager.GetSaveData() takes 433 for exactly the same data. They performed the same before the last update.
I'll take a look and reply back later today. Maybe the async version is processing too few dialogue entries per frame. The default is only 100. If you have 6000 dialogue fragments, this means it will take a minimum of 6000 / 100 = 60 frames. At 60 frames/sec, this be a minimum of 1000 milliseconds just in overhead of releasing control back to Unity.

Try increasing PersistentDataManager.asyncDialogueEntryBatchSize to, say, 10000. You can set this on the Dialogue Manager GameObject in the Inspector.
liisi.laasik wrote:Do you have any instructions how to add Dialogue System source to the project instead of the dll? It would be nice to debug the code and give you more detailed input.
Instructions are here. However, it's a big hassle that I'm going to address in Dialogue System 2.0. The problem is that Unity associates a GUID with each script. To Unity, the GUID assigned to the unpacked script file DialogueDatabase.cs is different from the GUID assigned to the compiled DialogueDatabase class in DialogueSystem.DLL. When you remove the DLL and import the source code, Unity will no longer recognize your dialogue database asset because the GUID will be different. The solution is to switch the Inspector to Debug mode and manually assign the DialogueDatabase.cs script to the asset. The same issue applies to all ScriptableObjects and MonoBehaviours in DialogueSystem.DLL, such as ConversationTrigger.

My later products (Love/Hate and Quest Machine) use a wrapper class that makes it effortless to switch between DLL and source code. But I haven't converted the Dialogue System to use wrapper classes yet.

Some studios import the source code into a separate project that they just use for debugging and exploring the code.

Re: Dialogue System 1.7.6 Patch 20171016 Available

Posted: Tue Nov 07, 2017 4:09 am
by liisi.laasik
I am sorry I haven't replied for a long time.

The PersistentDataManager.asyncDialogueEntryBatchSize hint was really good. We can fiddle with the value as our dialogue size increases and we are getting some good results. Thanks!

I actually spent a few days replacing all the missing script references to get our project to work with Dialogue System source. We will keep it in a separate code branch and I believe it will be of great benefit as we are entering the testing phase for our game.

Code: Select all

Dialogue System: Lua code 'return Actor[""].Display_Name' threw exception '[string "chunk"]:1: attempt to index field '' (a nil value)'
UnityEngine.Debug:LogError(Object)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean)
PixelCrushers.DialogueSystem.DialogueLua:SafeGetLuaResult(String)
PixelCrushers.DialogueSystem.DialogueLua:GetTableField(String, String, String)
PixelCrushers.DialogueSystem.DialogueLua:GetLocalizedTableField(String, String, String)
PixelCrushers.DialogueSystem.DialogueLua:GetLocalizedActorField(String, String)
PixelCrushers.DialogueSystem.CharacterInfo:GetLocalizedDisplayNameInDatabase(String)
PixelCrushers.DialogueSystem.CharacterInfo:.ctor(Int32, String, Transform, CharacterType, Texture2D)
PixelCrushers.DialogueSystem.ConversationModel:GetCharacterInfo(Int32, Transform)
PixelCrushers.DialogueSystem.ConversationModel:GetCharacterInfo(Int32)
PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry, Boolean, Boolean, Boolean)
PixelCrushers.DialogueSystem.ConversationModel:.ctor(DialogueDatabase, String, Transform, Transform, Boolean, IsDialogueEntryValidDelegate, Int32, Boolean, Boolean)
PixelCrushers.DialogueSystem.DialogueSystemController:ConversationHasValidEntry(String, Transform, Transform)
PixelCrushers.DialogueSystem.DialogueManager:ConversationHasValidEntry(String)
For instance I figured out, that the above error is due to the "START" dialogue entry ArticyConverter.CreateNewConversation() method creates. It has no actor and conversant information. Regular Lua apparently did not mind empty string literals in queries, but NLua does. Could you add some kind of check somewhere?

Re: Dialogue System 1.7.6 Patch 20171016 Available

Posted: Tue Nov 07, 2017 10:09 am
by Tony Li
Yes, I'll make sure that's fixed in 1.7.7, which I'm working on this week.

Re: Dialogue System 1.7.6 Patch 20171016 Available

Posted: Tue Nov 07, 2017 10:39 pm
by Tony Li
Patch 20171107 is now available on the Pixel Crushers customer download site. (If you need access, please PM me your Unity Asset Store invoice number). It has a fix for the issue above, another fix for PersistentDataManager (the save system) when saving SimStatus, and a few other additions:
  • Fixed: Persistent Data Manager SimX bug.
  • Fixed: NLua Get/SetTableField and Get/SetVariable handle blank table element names (e.g., blank actor names) more gracefully.
  • Improved: Conversation node editor now highlights incoming link arrows in a different color.
  • Improved: Unity UI Dialogue UI uses Unity UI Typewriter Effect more effectively by calling it directly instead of relying on OnEnable.
  • [Third Party Support] Ink Support: Updated for Unity 2017.2.
  • [Third Party Support] PlayMaker Support: Added actions to sync variables between PlayMaker and Lua.
  • [Third Party Support] RPG Kit Support: Updated for RPG Kit 3.1.8.
If you import this patch, please make a backup of your project first. Patches don't go through the full regression testing cycle that full releases do, but everything checked out with a set of basic tests.