sync actors and factions?

Announcements, support questions, and discussion for Love/Hate.
NotVeryProfessional
Posts: 150
Joined: Mon Nov 23, 2020 6:35 am

sync actors and factions?

Post by NotVeryProfessional »

Is there a way to keep actors in the Dialogue System database and factions in the Love/Hate database in sync?

And/or to link them together, so the two systems understand that this NPC is that actor and that faction? Other than attaching the relevant components to a gameObject, of course. I'm especially thinking about off-scene actors (i.e. when the character is somewhere else, and rumours are spreading behind his back).
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: sync actors and factions?

Post by Tony Li »

Hi,

No, the current way is to assign a DialogueActor and FactionMember component. If you have any suggestions or feature requests that would make it easier to manage, please let me know.
NotVeryProfessional
Posts: 150
Joined: Mon Nov 23, 2020 6:35 am

Re: sync actors and factions?

Post by NotVeryProfessional »

Just a simple script to keep them in sync would be great. At the moment, I add every NPC to both the faction and the dialogue database.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: sync actors and factions?

Post by Tony Li »

How should the feature work? Do you envision more of a design-time thing or runtime?
NotVeryProfessional
Posts: 150
Joined: Mon Nov 23, 2020 6:35 am

Re: sync actors and factions?

Post by NotVeryProfessional »

Design time, definitely.

The ideal would be to have a merged entity that both Dialogue System and Love/Hate can access. Maybe a class that's derived from both Faction Member and Dialogue Actor.

The probably easiest that would be a big help already would be a simple button or menu function that copies all Actors into the Faction database and/or all Factions into the Dialogue actor database, if they don't already exist.

One step up would be a checkbox to select if it should be copied or not. For example in Love/Hate I have factions that are groups and factions that are individuals (say, "village of X" and "Hans, a villager in X" who then has the village faction as a parent faction. Only individuals should become Dialogue System Actors, obviously.


Probably want to add something like "me" or "Actor" / "Conversant" for the Lua Functions to Love/Hate as well, but that's not my use case as I run all the actual dialog through Ink.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: sync actors and factions?

Post by Tony Li »

How about a LoveHateDialogueActor component that's a FactionMember-aware subclass of DialogueActor? The inspector could have buttons to add a faction/FactionMember or a Dialogue System actor if any are missing.
NotVeryProfessional
Posts: 150
Joined: Mon Nov 23, 2020 6:35 am

Re: sync actors and factions?

Post by NotVeryProfessional »

Yes, something like that. In the underlying business logic, faction member and dialogue actor are really the same person. So the code logic should express that identity, that would reduce the possibility for mistakes.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: sync actors and factions?

Post by Tony Li »

Sounds good. I'll try to get a patch out within the week.
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: sync actors and factions?

Post by Tony Li »

Here's the updated Dialogue System integration for Love/Hate:

LH_DialogueSystemSupport_2021-06-25.unitypackage

It has a new component LoveHateDialogueActor that replaces the Dialogue System's Dialogue Actor.
NotVeryProfessional
Posts: 150
Joined: Mon Nov 23, 2020 6:35 am

Re: sync actors and factions?

Post by NotVeryProfessional »

I see that this component does some additional checks and otherwise is the same as the DialogueActor component, correct?

Here's my setup - with the new component added. I don't see a difference to using a regular DialogueActor component, so I assume that the additional checks in the code are all there is.
Bildschirmfoto 2021-06-28 um 09.19.43.png
Bildschirmfoto 2021-06-28 um 09.19.43.png (411.62 KiB) Viewed 3176 times

My perfect use case would be to have ONE component that is both a Dialogue Actor and a Faction Member. And since the Dialogue DB is essentially just a list of names, it would use the Faction Database as its data source. Dialogue System needs the actor list internally for the dialogue trees, so something to keep them in sync would also be needed.

I'm not sure if that is in line with your vision, as it would integrate the two systems much more closely and you may prefer loose coupling. I also have no idea how much work that would be.


But this is absolutely workable, and the additional checking is a good helper to ensure that no mistakes happen.
Post Reply