[BUG?] Sync From DB can delete Actors and Variables

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
BitorVarbosa
Posts: 6
Joined: Fri Aug 04, 2023 11:20 am

[BUG?] Sync From DB can delete Actors and Variables

Post by BitorVarbosa »

Hi there,

Because of the amount of dialogues in our game, we have been using multiple databases with the "Extra Databases" component, but the problem we're having does not happen at runtime.

We have a "main database" (which is the default/initial database) and 5 other databases that are synced with the "main database".
That is because all important actors and variables are on the "main database", while other more specific variables and actors that only appear during small sections of the game are on the 5 other databases, so it goes:

Main Database
Act1 Database > synced with Main
Act2 Database > synced with Main
All the way up to Act5 Database

The issue is that when creating new variables or actors on the main database, it causes actors and variables on the subsequent databases to vanish. The repro steps go like this:

-Create 2 databases, "Main Database" and "Act1 Database".
-Open "Act1 Database", move to the Actors tab and Sync From DB using "Main Database".
-The default Actor entry named "Player" should be grayed out now.
-Hit ctrl+s to save project.
-On the "Act1 Database", create a new Actor, name it "ActorThatWillDisappear" for meme sake.
-Hit ctrl+s to save project.
-Open the "Main Database" and create a new Actor, name it "ActorThatWillPrevail" because why not.
-Head back to "Act1 Database", verify that "ActorThatWillDisappear" did indeed disappear, however, when opening the "Act1 Database".asset file using Notepad++, I realize that the file itself hasn't been updated yet.
-Add new actor on "Act1 Database".
-Hit ctrl+s to save project.
-Now "ActorThatWillDisappear" is gone from both the UI and the actual file

The same repro steps also seem to work for Variables.

But what about the Unique ID Tool?

Well, I figured that this gotta help in some way. And it seems that in order for the Unique ID Tool to prevent the problem, you need to:
-Create the new "ActorThatWillPrevail"
-Save
-Run the Unique ID Tool
-Only now open the "Act1 Database"

If you decide to open the "Act1 Database" before running the Unique ID Tool, the overlapping actors seem to be lost forever.

Honestly, I feel like sometimes something different happened, but we currently do not have the time to properly investigate this further and hoped you could advise us on what would be the proper procedure should we need to create new actors and variables on the "Main Database" again.

Is the best way to do this really "running the ID Tool immediately after creating new Actors or variable on the Main Database"?

Important Info

We are using the Dialogue System version 2.2.35.
Unity version 2021.3.23f1

If needed, I can also produce a small recording performing the issue.

Thank you in advance. It is a really great tool.
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: [BUG?] Sync From DB can delete Actors and Variables

Post by Tony Li »

Hello,

If possible, back up your project and update to the current version (2.2.39). There aren't any specific changes to actor IDs from 2.2.35 to 2.2.39, but this way we'll be looking at the same code.

If there is an actor ID 1 in your Main database and an actor ID 1 in the Act1 database, and you sync from Main to Act1, the Dialogue System will assume that they are the same actor. For example, if you change the name of actor 1 in Main and then sync to Act1, the Dialogue System will update the name of actor 1 in Act1 to match Main.

The Unique ID Tool can help, but the best solution is to set the Base ID for Act1, Act2, etc. You can set the Base ID in the Dialogue Editor's Database section. For example, set Act1's Base ID to 1000. Any new actors you create in Act1 will have an ID of 1000 or higher, which will not conflict with your Main actors.
BitorVarbosa
Posts: 6
Joined: Fri Aug 04, 2023 11:20 am

Re: [BUG?] Sync From DB can delete Actors and Variables

Post by BitorVarbosa »

Tony Li wrote: Fri Aug 04, 2023 9:32 pm The Unique ID Tool can help, but the best solution is to set the Base ID for Act1, Act2, etc. You can set the Base ID in the Dialogue Editor's Database section. For example, set Act1's Base ID to 1000. Any new actors you create in Act1 will have an ID of 1000 or higher, which will not conflict with your Main actors.
Ooooh, that will be useful! I haven't noticed that option before, my bad.
That's definitely the way to go. Thanks for answer!
User avatar
Tony Li
Posts: 21679
Joined: Thu Jul 18, 2013 1:27 pm

Re: [BUG?] Sync From DB can delete Actors and Variables

Post by Tony Li »

Glad to help!
Post Reply