Page 1 of 1

Question about same actor in multiple database

Posted: Mon Jan 08, 2024 10:03 am
by joeylu
Hi Tony,
My game is an visual story type, and it contains different worlds, timelines, currently, I'm using different dialogue database to handle each world and timeline, such as a group.
Actors that might be appeared in multiple world (database), by now I just copy the character settings from one database to another, nothing much, just the name, display name and a custom field that contains the GUID of the actor, and I will use the GUID as the primary key to query my own sqlite character database.
I understand when the game is played, dialogue system use a "masterDatabase" as a merge of all dialogue system database, and that makes me carious about my previous described approach, does that make sense to you? or is there a better logic way to keep a same actor in multiple dialogue database?
Also, another question is that "masterDatabase" only available in playmode, what is the best way to access something similar as "masterDatabase" from editor mode? Currently I just manually use a database array as a serialized field in my component script

Re: Question about same actor in multiple database

Posted: Mon Jan 08, 2024 1:06 pm
by Tony Li
Hi,

Your array is a fine way to handle it in the editor. Please review Working With Multiple Databases. In particular:
  • If more that one database will be loaded into memory at a time, make sure their internal IDs are unique. The easiest way is to set the Base ID for each database.
  • Make sure the same actor in all of the databases has the same ID. The easiest way is to set up a "global" database that's assigned to the Dialogue Manager's Initial Database field, with other databases added via Extra Databases components or DialogueManager.AddDatabase(). Define your shared actors, quests, and variables in the global database, and sync them to the other databases.

Re: Question about same actor in multiple database

Posted: Mon Jan 08, 2024 9:34 pm
by joeylu
Tks for the reply, use a global database to handle actors and use SyncNow button to sync to extra database, this is exact what I need to do :)
One follow up question, in my game, I have over 100 hundreds actors, it is fine if I separate them to different databases, however, if using global actor database, but is there a way to group actors like using forward slash to group conversations?

Re: Question about same actor in multiple database

Posted: Mon Jan 08, 2024 9:39 pm
by Tony Li
Yes, you can use forward slashes in actors' Name fields to group actors. Tick Use Display Name and set the Display Name to what the player will see.

Re: Question about same actor in multiple database

Posted: Mon Jan 08, 2024 10:59 pm
by joeylu
Hmm.. I tried using forward slash in Actor Name field, nothing is grouping

Re: Question about same actor in multiple database

Posted: Tue Jan 09, 2024 8:17 am
by Tony Li
Hi,

Where are you looking for grouping? With forward slashes, actor dropdown menus should be grouped. This includes the Actor dropdowns of conversation properties, dialogue entry properties, and Dialogue Actor component Actor dropdowns.

Re: Question about same actor in multiple database

Posted: Thu Jan 11, 2024 10:05 pm
by joeylu
Hi Tony, I meant the Actor window in dialogue editor
Since I'm going to create a global actor database table, it contains hundreds actors, the list of actor in the actor tab becomes too long.
I tried to put a forward slash in the actor name field, something like Place\Occupation\Joe Smith
It wont translate to the actor list and there is no group

Re: Question about same actor in multiple database

Posted: Fri Jan 12, 2024 8:18 am
by Tony Li
Hi,

To get submenus, use forward slashes ( / ), not back slashes ( \ ).

I think I understand what you mean now about the Actors section. Unlike the Variables section, in which you can organize variables into smaller lists contained in foldouts, you can't do that in the Actors section yet. You can, however, set the filter bar at the top of the Actors section. For example, if you set it to "Place/" it will only show actors whose names start with "Place/".