Page 1 of 1

Questions about Love/Hate system

Posted: Wed Jan 06, 2021 4:13 pm
by hellwalker
Hey,

I changed a few things in my design and I'm trying to determine how few things work in love/hate.

My game is not randomly generated or meant to be played as a random game. So, I don't have a sandbox-style approach to player actions and NPC reactions.

What I want to do is more similar to something like Mass Effect or Planescape Torment. Where actions and relationships are more hard-coded.

Your actions in dialogue and gameplay correspond to certain traits (Cunning, Honest, Vengeanful). I want to determine player reputation based on which traits player favors, and I want the player to character relationships to change based on what kind of traits the player exhibits.


#1) I want to accumulate these traits into Player Reputation. So, if you mostly tell the truth you'll gain the reputation of "Truthful" and in the story, I will check this to see if other characters trust you on your word. If you are vengeful all the time, the characters will be too afraid to ask forgiveness and continue to lie to you. etc. (Hand-coded)

Can I accumulate somehow the "Player Traits" into player data that I can check somewhere? Like player reputation honest = 100;


#2) I have three relationship traits. Affinity(Disposition), Fear, Loyalty. They are three separate layers of relationship. Someone might like you but be disloyal etc. I want player deeds to affect these three relationships. So, something you do might make the character Loyal or Traitorous, etc.

How, or where does Love-hate translate the player deeds into relationships? How can I control that behavior?

#3) Do I have to use Deed presets? Can I build deeds at runtime and report that? I want to judge dialogue choices individually(Cruel 20, Honest 10), rather than in presets. I can write my own "Deedbuilder DS sequence", but can Love/Hate accept something like that? Like a custom deed struct to process?

#4)PAD is a bit confusing to me.

Why is the system locked to these specific traits? Is it specifically meant to produce an "Emotional State" descriptor, or is it an essential processing step between deed and relationship?

I like the idea of an "Emotional State" descriptor, and I could use it in my game. But I don't really want to use it with relationships necessarily. It seems useful more like a separate system, where I could set the character's emotional state based on other gameplay factors. Like if the character has no food or went through a traumatic battle, they are unhappy no matter their relationship with the player, etc.


#5) Is the Love/Hate a good fit for what I'm trying to do? Or is it more geared towards sandbox-y game and not meant for more heavy handed, hard-codded interference from the designer?

The main problem for me seems the PAD. On surface level, it seems similar to my three relationship traits, but not quite. I don't really have enough mechanics for the player to interact with other characters in a way that corresponds to these exact traits. And I don't want to "gamify" this for my story. So, if a character feels dominant or not; or aroused or not; is a non-factor in gameplay terms for me. I handle this on a storytelling side and track this in a more hard-coded and situational manner.

I could use PAD, as I mentioned in a more gameplay centric way. Like adjust animations and expressions based on PAD, or use PAD as a "Morale" factor in gameplay. But, not for main three relationship stats.

If I can
1) Separate PAD from Deed => Relationship evaluation
2) Define Trait => Relationship conversion logic (What increases Loyalty, vs Fear)
3) Save Traits use frequency into player reputation stats

the other mechanics seem very useful for what I want to do. Like deed reporting, factions, traits, relationships.

I'm willing to write custom solutions, and for example like listen to player deed reports and manually save this into lets say dialogue system player actor variables. Or something like that. But, first I'm trying to see if overall structure of Love/Hate is a good fit.

Re: Questions about Love/Hate system

Posted: Wed Jan 06, 2021 8:32 pm
by Tony Li
Hi,
hellwalker wrote: Wed Jan 06, 2021 4:13 pmWhat I want to do is more similar to something like Mass Effect or Planescape Torment. Where actions and relationships are more hard-coded.
You can do that with Love/Hate. I won't argue for or against using Love/Hate, except to say that it probably still fits. Just ignore the more procedural features you don't need, such as sharing gossip. I'll describe how you can accomplish the tasks below in Love/Hate.
hellwalker wrote: Wed Jan 06, 2021 4:13 pm#1) I want to accumulate these traits into Player Reputation. So, if you mostly tell the truth you'll gain the reputation of "Truthful" and in the story, I will check this to see if other characters trust you on your word. If you are vengeful all the time, the characters will be too afraid to ask forgiveness and continue to lie to you. etc. (Hand-coded)

Can I accumulate somehow the "Player Traits" into player data that I can check somewhere? Like player reputation honest = 100;
Yes. The player will have a Faction in Love/Hate's faction database. The player's GameObject will have a Faction Member component, which points to a Faction in database.

For each faction, the faction database defines personality traits (Cunning, Honest, Vengeful) and relationship traits (Affinity, Fear, Loyalty).

Use the GetPersonalityTrait() Lua function to check the player's personality traits. Example:
  • Dialogue Text: NPC Helga: "You have a reputation of honesty, so I will tell you my plight."
  • Conditions: GetPersonalityTrait("Player", "Honesty") > 20
If the player tells the truth in a dialogue choice, you can use the SetPersonalityTrait() Lua function to increase the player's Honesty personality trait, like:
  • Menu Text: "[Tell the truth] I cannot lie. I cut down the tree."
  • Script: SetPersonalityTrait("Player", "Honesty", 5 + GetPersonalityTrait("Player", "Honesty"))
Page 46 of the Love/Hate manual lists all the Lua functions. You can of course work with Love/Hate values directly in your own C# scripts using Love/Hate's API. But the Lua functions are how to use them inside conversations.
hellwalker wrote: Wed Jan 06, 2021 4:13 pm#2) I have three relationship traits. Affinity(Disposition), Fear, Loyalty. They are three separate layers of relationship. Someone might like you but be disloyal etc. I want player deeds to affect these three relationships. So, something you do might make the character Loyal or Traitorous, etc.

How, or where does Love-hate translate the player deeds into relationships? How can I control that behavior?
You can use the Love/Hate API. Relationship traits apply from one character to another. For example, if the player does something to make an NPC Helga more loyal to the player, you can do:

Code: Select all

int loyaltyID = FactionManager.factionDatabase.GetRelationshipTraitID("Loyalty");
FactionManager.factionDatabase.ModifyPersonalRelationshipTrait("Helga", "Player", loyaltyID, 10);
Or you can change it in a conversation:
  • Dialogue Text: "You have earned my loyalty."
  • Script: ModifyRelationshipTrait("Helga", "Player", "Loyalty", 10)
hellwalker wrote: Wed Jan 06, 2021 4:13 pm#3) Do I have to use Deed presets? Can I build deeds at runtime and report that?
You can build your own deeds, but there's no need to use deeds at all if you're manually controlling the personality and relationship values. Deeds are only necessary if you want characters to judge the player's deeds and automatically adjust their relationship values based on a formula. Since you will be adjusting relationship values and personality values manually, you don't need to use deeds.
hellwalker wrote: Wed Jan 06, 2021 4:13 pm#4)PAD is a bit confusing to me.

Why is the system locked to these specific traits? Is it specifically meant to produce an "Emotional State" descriptor, or is it an essential processing step between deed and relationship?

I like the idea of an "Emotional State" descriptor, and I could use it in my game. But I don't really want to use it with relationships necessarily. It seems useful more like a separate system, where I could set the character's emotional state based on other gameplay factors. Like if the character has no food or went through a traumatic battle, they are unhappy no matter their relationship with the player, etc.
Normally, PAD values automatically change in response to deeds. If you're not using deeds, you can ignore PAD or just set the PAD values manually using the Love/Hate C# API or Lua functions. PAD is a additional psychological model. It's not part of the faction's personality traits or relationship traits; but deeds, personality traits, and relationship traits all affect PAD values when the character evaluates a deed. However, in your case, you may not want to have character evaluate deeds, but instead manually change personality, relationship, and PAD values.
hellwalker wrote: Wed Jan 06, 2021 4:13 pm#5) Is the Love/Hate a good fit for what I'm trying to do? Or is it more geared towards sandbox-y game and not meant for more heavy handed, hard-codded interference from the designer?
It's fine for hard-coded values. When you use it with hard-coded values, think of it as a database that holds the hard-coded values -- basically a regular traditional faction system.

It sounds like that's the way to go with your game. And then just write the additional code to do whatever else you need on top of it.

Re: Questions about Love/Hate system

Posted: Thu Jan 07, 2021 2:53 am
by hellwalker
Thank you!
This is very helpful, I have a few more questions.

#3) I do want to use Deed style mechanics but interpret them with my own logic.
Or rather, when a player does something, I want the NPC's to react to it based on different masking.

For example, if the player was unfair in his judgment on the village trial. That village NPC's will be affected.
So there would be like a Deed with -20 Fairness, and faction "Village" would be the target.

The Love/Hate mechanics for affecting large groups of NPC's, based on different Radius/Masking are really useful. (And avoid a lot of manual code in dialogues)

Is it possible to approach this more in a manner of overriding the "Processing" Functions and inserting custom functionality in there?

For example:
In Dialogue, I call a custom Deed script or sequence. Something like CommitDeed(User, Target, "Honesty=10, Cruel=20");

This custom function will first increase the corresponding player traits, and then tell L/H to commit a custom deed with those values.

The NPC's that should be affected by a deed, have a custom "Processing" function code added that will translate the deed logic to Loyalty/Fear/Disposition.

Would this be a viable path?

Re: Questions about Love/Hate system

Posted: Thu Jan 07, 2021 8:24 am
by Tony Li
Hi,
hellwalker wrote: Thu Jan 07, 2021 2:53 am#3) I do want to use Deed style mechanics but interpret them with my own logic. ...
Is it possible to approach this more in a manner of overriding the "Processing" Functions and inserting custom functionality in there?
Yes. Just assign a replacement function to FactionMember.EvaluateRumor. Example:

Code: Select all

GetComponent<FactionMember>().EvaluateRumor = CustomEvaluateRumor;

// Receives a rumor from a source and evaluates it. 
// If the character witnessed the deed directly, sourceOfRumor will be self.
// Returns a new copy of the rumor as this character judges it -- for example, 
// if the character doesn't care much about it, the returned rumor's impact may be
// lower than receivedRumor.
Rumor CustomEvaluateRumor(Rumor receivedRumor, FactionMember sourceOfRumor)
{
    // (See the code in original FactionMember.DefaultEvaluateRumor for an example.)
}
For simplicity, the Dialogue System integration's ReportDeed() Lua function uses a Deed Reporter to report deeds. You can either define your deeds ahead of time for the Deed Reporter, or you can write a similar Lua function of your own -- e.g., CommitDeed() -- that lets you specify the deed info directly in the function. A deed has a lot of data fields (see Deed API), but you may be able to ignore some of them and use default values in your custom Lua function.

Re: Questions about Love/Hate system

Posted: Thu Jan 07, 2021 10:22 am
by hellwalker
Thanks!
Will give this a try.