Search Unity

[SALE 50% OFF] Love/Hate: The Emotion-Driven Relationship System

Discussion in 'Assets and Asset Store' started by TonyLi, Mar 24, 2015.

  1. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Oops, you're correct. It's right there in the Love/Hate manual, too. The PAD emotional state model Wikipedia page is a good starting point to see whether the PAD model will fit your needs or if you'll want to add your own model instead. Jump down to the References section and read Mehrabian's work. Van der Voordt et al. also provide a good comparative analysis in this paper.
     
  2. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    Hello Sir,
    How do I activate the "Inherited Relationships" checkbox in C#script?
    I thoujght it was a bool but i was WRONG. lol. It wont update automatically or show it unless I click it. Unless thats intended. Maybe it is working as intended even if I dont click it?
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Hi @frekiidoochmanz - Sorry for the confusion. Inherited relationships are always enabled. The "Inherited Relationships" checkbox only toggles whether the inspector shows the faction member's inherited relationships. It takes a little time to compute the list of all inherited relationships and prepare it for display in the inspector, so the checkbox is there to give you the option to not show the list. In the next release, I'll rename this checkbox to "Show Inherited Relationships" to make it more clear.
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Updated Integration Packages

    Love/Hate 1.82 is in review and should be available in the Asset Store soon. It renames the "Inherited Relationships" checkbox to "Also Show Inherited Relationships" to clarify its purpose, and includes some additional minor improvements.

    Opsive and Paradox Notion have updated their integration packages for Behavior Designer and Node Canvas, respectively, to include new Love/Hate tasks. You can get those integration packages now on their product sites.
     
    Tinjaw likes this.
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Love/Hate 1.82 Available on Asset Store

    Love/Hate 1.82 is now on the Asset Store! This update includes:
    • Improved: Additional caching to eliminate garbage collection.
    • Improved: Renamed FactionMember inspector Inherited Relationships checkbox to clarify its purpose.
    • Dialogue System: Added Lua functions Get/SetPersonalityTrait, GetTemperament, GetEmotionalState.
    • PlayMaker: Added Get/SetPersonalityTrait actions.
    Opsive has also updated the Behavior Designer integration, and Paradox Notion has updated the Node Canvas integration. You can get the updated integration packages on their websites.
     
    Tinjaw, hopeful and Tiny-Tree like this.
  6. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    Is This AI tool?

    This is helpful for Decision Making?

    Or Does This asset share data easily?

    I think This tool Help the communication of data between characters

    but This product is likely AI tool

    I'm a little confused.
     
  7. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Hi @Cartoon Mania - Thanks for asking about Love/Hate. It's an AI tool, but "AI tool" is a very broad term, covering everything from NavMeshAgents to vision systems and more. Specifically, Love/Hate keeps track of what characters think of each other. This information helps other decision-making AI tools decide what to do. For example, an NPC may do something different when a friend approaches than when an enemy approaches.

    I encourage you to read the first page of the manual for an oveview and play the demo if you're interested in learning more about how it works. If you have any other questions about Love/Hate, just ask. I'm happy to answer!
     
  8. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    236
    Hi,

    I noticed one of the updates mentioned:
    Where could I find out more information about this? I checked out http://pixelcrushers.com/lovehate/api/html/index.html but I couldn't spot it.

    Any help appreciated, thanks.
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Hi @giraffe1 - This is just an internal optimization. Earlier versions used a sequential search for some lookups, which was fine if your project had, say, just 100 - 200 factions. However, they now use a fast hash lookup internally, so you can have tens of thousands of factions without any issue.

    Nothing changed on the API side. You can still use FactionManager.GetFaction. It's just faster in 1.8+. Example:

    Code (csharp):
    1. var factionManager = FindObjectOfType<FactionManager>();
    2. var orcFaction = factionManager.GetFaction("Orcs");
     
    hopeful likes this.
  10. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    236
    okie dokie! thanks for your speedy response. That answered my question!

     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Happy to help!
     
  12. Exeneva

    Exeneva

    Joined:
    Dec 7, 2013
    Posts:
    425
    Hi there, this is my first time using this asset, so bear with me. There's a lot of math going on with deed evaluation and I'm struggling to piece it all together.

    I want to make it so that if a character in my game is attacked 3 times by the player, the character will switch from a default neutral state to hostile. This, of course, is assuming the character's faction has not received word of previous player attacks (which would decrease the number of times the player can attack before retaliation).

    What would be the default relationship and harmful deed values I need to set up to make the above situation possible?

    Here is the database. Assume Colonists is the neutral faction where a member can initially take 3 hits before becoming hostile.



    Here is a harmful deed:



    Can you point me in the right direction on what initial values I should set for impact and aggression? I'm not sure how the relationship number actually changes based on those two values.
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Hi @Exeneva - Thanks for using Love/Hate!

    Here's the short answer, which is based on some assumptions:
    • Set the Antagonize deed's Impact to -20.

    • Add an IWitnessDeedEventHandler script (see p25) to your colonist NPCs. Call FactionManager.GetAffinity() to check if the Colonists' affinity to the player is below -50. If so, attack the player. (Or use a PlayMaker event if you don't want to write a script.)


    Here's the long answer:

    I suspect you just want Colonists to act based on their affinity (like/dislike) to the player.

    Affinity is the default relationship trait. All relationship trait values are in the range [-100,+100]. If the Colonists have -100 affinity to the player, they feel the maximum amount of hatred possible in your game world. If they have +100 affinity, they feel the maximum amount of love for player.

    Your Colonists should switch to hostile well before hitting -100 affinity. A threshold of -50 might work well. This is midway between neutral and the absolute strongest hatred possible.

    All things being equal, if you set the Antagonize deed's Impact to -20, then three of these will drop the Colonists' affinity to -60, which is below the arbitrary threshold of -50.

    Of course, all things are rarely equal in the real world, and Love/Hate attempts to simulate some of that messy nuance. The way I interpret your faction database, if the player's Alignment is positive it means the player has a history of helping the Colonists. In this case, since it's in line with the Colonists' Alignment, the Colonists will cut the player a little slack. Each deed's impact will be softened a bit. Of course, if the player's Alignment is negative, this just confirms to the Colonists that the player is a villain, and the Colonists will judge the deeds even more negatively (i.e., confirmation bias).

    The complete formula is at the end of the manual. You can also tick Debug Eval Func on your Faction Member component(s) to log a breakdown of the computation in the Console view.

    All this just modifies how Colonists feel about the player. The next step is to make the Colonists actually do something about it. I suggest adding an IWitnessDeedEventHandler script to your colonist NPCs. An example script is on page 25 of the manual (Love/Hate version 1.82). If you don't want to write a script, you could hook up a PlayMaker event (or whichever of the supported visual scripting systems you're using).

    An easy first step might be to just add a Greeting Trigger to the NPCs. For the range [-100,-50], play an angry animation such as shaking a fist. This will let you know that the NPCs have reached the threshold. Optionally add an IGreetEventHandler script to do something else such as attacking the player when "greeting" (i.e., seeing) the player. Something with code like:
    Code (csharp):
    1. var factionManager = FindObjectOfType<FactionManager>();
    2. if (factionManager.GetAffinity("Colonists", "Player") < -50f) Attack();
    Then you could add the script I mentioned above.


    Since you mentioned "hostile," Love/Hate also defines a PAD emotional temperament named "Hostile". However, this may be different from what you want. I'll describe it below to help you decide if it's what you're looking for.

    Relationship traits (such as affinity) are typically long-lasting values, whereas emotions are typically shorter-lived and settle down over time. Love/Hate models emotional state with three values: Pleasure, Arousal, and Dominance.

    The current values of Pleasure, Arousal, and Dominance result in an emotional temperament. The table of temperaments is on page 10 of the manual.

    The emotional temperament "Hostile" is defined as:
    • Low Pleasure
    • High Arousal
    • High Dominance
    "Low" and "High" mean values outside the NPC's Excitability Threshold, which defaults to 20.

    When an NPC witnesses a bad deed (e.g., player antagonizes him), the NPC's Pleasure decreases, Arousal increases (he's more agitated/upset), and Dominance changes in a more complex way.

    If the player commits an aggressive deed (e.g., Antagonize as you've defined it in your screenshot), it makes the NPC feel less dominant. If the player commits deed that has negative aggression (e.g., Help), it makes the NPC feel more dominant.

    In addition, if the NPC's power level is significantly higher than the player's, this can cancel out the loss of dominance from aggressive deeds. (It also works the other way, where less powerful NPCs will feel even less dominant.)

    If you'd like more details or clarification on any of this, just let me know!
     
    Last edited: Jun 13, 2016
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Pixel Crushers Holiday Hours June 24 - July 2

    I'll be traveling June 24 -July 2. I'll do my best to reply to any posts as promptly as possible each day, but responses might be a little slower than usual next week.
     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Love/Hate 1.83 Released!

    Love/Hate 1.83 is now available on the Asset Store!

    This is a small update that adds support for custom time modes via a GameTime class and also updates support for Adventure Creator 1.53+.
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    The Sims-Style AI

    Quite a few people have asked about Love/Hate in the context of games like The Sims. I thought I'd post a little discussion here:

    The Sims uses utility-based AI. Briefly, each Sim has a set of needs (Hunger, Thirst, Sleep, etc.). Each need has an urgency value. The AI identifies the need with the highest urgency and then scans the scene for objects that advertise that they'll satisfy the need. For example, if a Sim's Thirst need is highest, the AI will choose a glass of water over a bed. (In AI parlance, the glass of water has higher "utility" to the thirsty Sim.)

    Then the AI follows a simple script on the glass of water that contains instructions such as:
    1. Walk to glass.
    2. Play animation to reach hand to glass.
    3. Child glass to hand.
    4. Play drinking animation.
    5. Reduce the Thirst urgency. Increase the Bathroom urgency.Love/Hate, on the other hand, deals more with interpersonal relationships. This is a big part of The Sims, too, since Sims can fall in love, have rivalries, etc.
    Love/Hate by itself doesn't actually take any actions. Instead, its purpose is to observe actions (e.g., observe Adam kiss Beth) and provide information to help action-oriented AI systems make better decisions on what actions to take (e.g., shoot Adam out of jealousy.) Love/Hate also models an emotional state (e.g., Beth feels scared when she sees Adam get shot).

    For the action-oriented part, you might use Behavior Designer, for example. Behavior Designer has a Utility node that makes a decision based on a utility function. You can use Love/Hate to help compute that utility function. For example, if Love/Hate indicates that Beth is scared, she might choose to use the door to run away. Using Love/Hate like this, your Sims can exhibit deeper and more nuanced behavior.
     
  17. tchris

    tchris

    Joined:
    Oct 10, 2012
    Posts:
    123
    Hi I started looking into Love/Hate and I have a quick question. Is it possible for a faction to have a certain personality but a member of that faction to differ a bit?

    For instance, a faction of a group of thieves might like to steal things and hurt people. But maybe one member in particular will share those morals to some extent and follow along, but still has a bit more morality than the rest of the members.

    So maybe that one member might back out at the last minute or something like that.
     
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Yes. Factions form a "family tree." Your moral thief would have his or her own faction (with more moral personality values) whose parent faction is the general thief faction.

    In the example scene, there's a Bandits faction. The two bandits in the scene, Horn Girl and Pink Girl have their own child factions. They inherit certain properties, such as their negative relationship to Citizens, but override other properties. For example, Pink Girl is the Princess's sister, so she has a positive relationship to the Princess but inherits from Bandits a negative affinity to other Citizens.
     
    Last edited: Aug 27, 2016
  19. tchris

    tchris

    Joined:
    Oct 10, 2012
    Posts:
    123
    Thanks for the answer. I have one question now that I actually started experimenting with Love/Hate.

    I have 4 actors:
    Actor 1 Commits a "Steal" act on #2
    Actor 2 Gets a Steal acted on it
    Actor 3 Likes #2 and already doesn't like #1, so after the witnessing the steal act his affinity for #1 goes to -100 which is what I expected. Also Actor 3's Happiness is down and other PAD attributes change as expected.
    Actor 4 I put this actor behind a wall (I set Steal to only be witnessed by sight). Actor 4's PAD does not change and in the debug it does not say he witnessed the stealing which is what I expected. However his affinity for #1 goes to -100 it seems. I'm confused by this? His affinity for #1 was only -0.3 at the beginning.

    Each actor is in its own faction
    Actor 3 is a child of actor 2 but otherwise there's no children of other factions
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Hi @tchris - Here are two possibilities:

    1. Is Actor 4 sharing a faction with another actor? If so, create a child faction for Actor 4 so it can maintain its own, separate relationship list.

    2. If that's not the case, do your actors have Gossip Triggers? If so, the default gossip mechanism works off OnTriggerEnter; it doesn't account for obstructions such as walls. Try temporarily disabling your Gossip Triggers to see if it makes a difference.

    If neither of those help, please feel free to send an example project to tony (at) pixelcrushers.com and let me know what version of Unity to use. I'll be happy to take a look.
     
  21. tchris

    tchris

    Joined:
    Oct 10, 2012
    Posts:
    123
    Ooh stupid mistake on my part. Actor 3 and Actor 4 were sharing a faction and that's why they had the same experience. Once I put 3 & 4 in their own factions they reacted as I first expected.

    The faction colors helped me figure that out. Thanks for your time. This is a really great package.
     
    TonyLi likes this.
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Love/Hate 1.8.4 Beta 1 is available now on the Pixel Crushers Customer Download Page for Love/Hate. (You'll need to enter your Unity Asset Store invoice number for access.)

    Beta 1 includes a new component, Deed Evaluation Overrides, that you can add to a faction member to tell it to evaluate deeds done to specific factions differently (for example, a masochist who enjoys being the target of cruel deeds).

    The full 1.8.4 release should also include support for Emerald AI. We're just waiting for BHS to add some hooks into Emerald AI to better support integration with other products.
     
  23. tchris

    tchris

    Joined:
    Oct 10, 2012
    Posts:
    123
    I am having an issue when trying to Build my project into an exe. When I run the exe, I get errors in the console saying that the members can't find the Faction Manager. When I run the project in Unity there are no errors. It seems to be the Faction Member components that are causing the error because when I disable those components the errors go away. Is there something special to do when building the project?
     
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Hi @tchris - Would you please PM me the player log file that contains the error or email it to tony (at) pixelcrushers.com if you prefer?
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Love/Hate 1.8.4 Released!

    Love/Hate 1.8.4 is now available on the Asset Store! It adds support for optional deed overrides that allow faction members to interpret deeds differently when done to specific factions. For example, a masochist could get upset when witnessing cruel deeds done to others but be happy when cruel deeds are done specifically to himself.
     
    Last edited: Sep 21, 2016
    Teila likes this.
  26. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    236
    @TonyLi

    Hi,

    Just wanted to say thank you!

    I've been browsing through your profile to find all your posts where you discuss AI.

    SoOOOoOOooooOoooooooo much useful knowledge and input!
     
    TonyLi likes this.
  27. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Love/Hate 1.8.5 Released!

    Love/Hate 1.8.5 is now available on the Asset Store!

    This version has programmer-side improvements:
    • Added Rumor.customData field to support associating custom data with rumors.
    • Exposed FactionMember's utility functions so delegates that override default functionality can use them.
    • Removed UNITY_EDITOR conditional compilation for non-editor classes to make it easier to pre-compile DLLs.
     
    hopeful likes this.
  28. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    5,703
    Do you planned to implement something like versu/cotillon?
     
  29. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Hi @neoshaman - At some point, yes. Currently I don't know whether this will become a part of Love/Hate or a separate asset that possibly works with Love/Hate and the Dialogue System.
     
  30. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    5,703
    As long as it is coming? That makes one less tail to chase for me :D!
     
  31. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    I am using unity 5.4

    "Love and Hate" Example for Dialogue system doesn't work

    I mean I can click the button

    UI doesn't work
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Hi @Cartoon-Mania - Thanks for letting me know! Here's an updated scene for Unity 5.4.0+:

    LoveHate_DialogueSystemExample_Unity54_2016-10-10.unitypackage

    This will also be in the next release. A change in Unity UI from 4.6.5 (in which the scene was created) to 5.4 caused the Dialogue System's Alert Panel to block Unity UI EventSystem mouse pointer input.
     
  33. Cartoon-Mania

    Cartoon-Mania

    Joined:
    Mar 23, 2015
    Posts:
    320
    I know that Quest machines support emerald AI

    But Emerald AI seems to be integrated with this product.

    Do you plan to support Emerald AI?

    I think Dialogue system also should supports emerald AI.
     
  34. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Hi @Cartoon-Mania - You may have seen on the Emerald AI forum thread that the latest version of Emerald AI was just released today. This version contains events hooks that I requested to support third party integration. I'll be able to implement integration with Quest Machine, Love/Hate, and the Dialogue System now. My first priority is to get Quest Machine into beta; then I'll focus on third party integration.
     
    cygnusprojects and Teila like this.
  35. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,835
    Yay!
     
    BackwoodsGaming and hopeful like this.
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694

    Pixel Crushers is a sponsor of the Christmas Giveaway Calendar!

    This event is sponsored by over 40 of the highest rated Unity Asset Store developers and a whole sleeve of industry partners – including Unity themselves! (Many thanks for Devdog for organizing this event.)

    You can sign up right here.


    So what’s this all about?

    For the past weeks, we’ve been collecting sponsored gifts related to Unity (asset vouchers, product keys, conference tickets etc.), and throughout each day of December leading up to Christmas Day on the 25th , we will be sending out these sponsored gifts as early gamedev Christmas presents via e-mail to hundreds of lucky winners.

    The total prize pool is over $15.000, with over 350 presents in the prize pool. Merry Christmas from Pixel Crushers, Devdog, and every single one of the sponsors.




     
    Last edited: Nov 28, 2016
  37. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    689
    This is a bit theorycrafty for an asset thread, but I'm hoping it's something that Tony (or anyone else who uses this extensively) has already wracked their brain over: Love/Hate is a really nifty system out of the box, and it can provide an awful lot of additional interactivity to your world, but I've had a really difficult time articulating what's going on to the player.

    If there are only a handful of NPCs in the world it's sufficient to click on them individually (or consult some kind of NPC codex) and view their social statistics, but if you increase that number to even something like 10-20 characters, it quickly becomes impossible to remember what's going on by paging through individual files.

    Crusader Kings 2 has maybe the most straightforward yet difficult-to-use version of this, where you can view all of a person's social relations on their menu, but it's only practical to remind yourself of one person's status; fairly simple strategic questions, like "What are the two largest alliances, who are their members, and how are they related" are extremely cumbersome to answer.

    On the flip side, a node graph provides at-a-glance information on social connections, but humans tend to be pretty bad at reading graphs, and even moderately large pools of NPCs will quickly turn any graph into a huge, hard-to-read mess.

    So has there been a game that ever tackled this problem satisfactorily? The closest I can think of is Shadow of Mordor, and a lot of what made their nemesis system so useable was that the pool of characters was quite small, and the complexity of the data the player needed to keep track of was extremely simple.
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    I agree. Their decision to keep the variables simple made the system work as well as it does.

    In the original project for which Love/Hate was designed (a narrative-heavy RPG), NPCs express their Love/Hate data through dialogue and animation -- hence the Dialogue System integration and components like Greeting Trigger.

    I think a more numbers-oriented game like Crusader Kings 2 could be improved by providing information in a hyperlinked fashion. For example, the top level interface might have a link for "Alliances," among others. If the player clicked on Alliances, it would show a list of alliances sorted by size. The UI wouldn't have to look like a dry HTML table; it could have some nice visual juice.

    Then if the player clicked on an alliance, it would show the members. If the player clicked on a member, it would show the member's relationships, perhaps as a network graph, with stronger relationships drawn larger, and colors ranging from red (negative affinity) to green (positive affinity). Weaker relationships could be drawn smaller and smaller, possibly even omitted after a certain cutoff.

    But that's just a thought. I'm really interested to hear if anyone else has other ideas, too!
     
  39. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    689
    That's an interesting idea... I think part of this is going to end up varying too heavily from project to project, since the nature of your game obviously determines what information needs to be prioritized.

    We've done a lot of playtesting with different menu formats, and one thing we discovered is that even in data-heavy games, players tend to respond very poorly to excessive iteration. I suspect that breaking relationships into LODs like you suggested and trying to massage the gameplay to focus on individual data instead of groups of people is ultimately a really good approach; even in a system with a relatively small scope, the instant you need to look beyond two degrees of separation, you're looking at a combinatorial explosion of data where 99% of the links on display won't actually help the player.
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    I can't take credit for the idea. Yesterday's Gamasutra article on Tyranny's "lore links" was fresh on my mind. :)
     
  41. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    #UnityChristmas - Sign up if you haven't already

    Just a reminder that #UnityChristmas, which is sponsored by over 40 Asset Store publishers and organized by devdog, is still running through December 25. There are over $21,000 of prizes to win, including a Unite 2017 ticket and a 1-year Unity Pro license. Sign up here:

    http://christmas.devdog.io
     
  42. TMPxyz

    TMPxyz

    Joined:
    Jul 20, 2012
    Posts:
    765
    Hi, I've a question for the Affinity and rumor evaluation.
    [env: LoveHate 1.8.5 + U5.3.4 + Win10]

    Assume we've a cult member and a kid, the cult member did an evil deed to himself, and the kid witness that.
    So, the deed's actor & target are both cult-member himself, and one witness the kid.

    I noticed that in the default rumor evaluation, if the kid has 0 affinity to the cult member before, It would result in the deed won't change the affinity of kid to the cult-member;

    'changeInAffinityToActorNorm' = 0 (as the kid doesn't care about cult-member, kinda logical I think)
    but the 'traitImpactNorm' = 0 as it multiplied with changeInAffinityToActor.

    How do you think about it? Is it normal?
     
  43. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Hi @TMPxyz - It might not be "normal" for reality, but it helps streamline the number of data points. If the kid has 0 affinity to the cult member, then it's probably not worth it for the kid to keep track of this deed.

    However, if you want to model this interaction, give the cult member a parent faction such as "humans" and give the kid a positive relationship to humans. In other words, if the kid witnesses an evil deed done to any human, he will track it. If you then want to make the kid not care at all about the cult member, you can give the kid a specific personal affinity of 0 to the cult member. This means that, while the kid has a positive relationship to humans in general, he doesn't care at all about the cult member.

    If neither of those recommendations fit your needs, you can assign a delegate function to FactionMember.EvaluateRumor to handle it differently.
     
    hopeful likes this.
  44. TMPxyz

    TMPxyz

    Joined:
    Jul 20, 2012
    Posts:
    765
    I think I can do with that, thanks for the help.
     
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Happy to help!
     
  46. digitalzombie

    digitalzombie

    Joined:
    Dec 10, 2007
    Posts:
    84
    @TonyLi

    If I make a neutral Faction, The Wizard's Guild, and begin it with a Lawfulness of 0, is there a way to update this value based on the deeds of its members?

    For narrative, I'd like the faction to start neutral and have the players deeds determine the faction numbers. As I read through the manual though, it seems the faction never actually changes, only the affinity between entities changes.

    Your thoughts?

    Thanks.
     
  47. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Hi @digitalzombie - In your scenario, is Lawfulness a personality trait or a relationship trait? A personality trait is considered inherent in a faction, whereas a relationship trait is a variable value (such as affinity) between two factions that changes in reaction to deeds.

    Personality traits don't typically change, but relationship traits do. Technically, you can change personality trait values, but the built-in serialization (i.e., saved games) doesn't include personality trait values in the current version of Love/Hate. Since there's been interest for this, personality trait values will be included in serialization in the next version.

    The default deed/rumor evaluation function uses the deed's personality traits, the witness's personality traits, and the witness's affinity relationship traits to the actor and target. The FactionMember class exposes this as a delegate so you can swap in your own evaluation function to do other things such as modifying other relationship trait values or even personality trait values (which, again, aren't currently included in saved games in 1.8.5 but will be included in the next version).

    If you write such as delegate, you could for example check if the actor is a member of The Wizard's Guild. If so, you could multiply the deed's Lawfulness by The Wizard Guild's affinity to the actor. This means that the more The Wizard's Guild cares about an actor, the more the actor's deeds influence the Guild's Lawfulness. Then add this value to the Guild's current Lawfulness.
     
    hopeful and BackwoodsGaming like this.
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    I'll be traveling Friday, February 24, through Sunday, February 26, 2017. I'll do my best to reply to support requests quickly, but responses may take a little longer than usual.
     
  49. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    11,694
    Love/Hate 1.8.6 Released!

    Version 1.8.6 is now available on the Asset Store!

    The major addition in 1.8.6 is that personality traits are now dynamic. When a character sees a friend commit a deed, the character's personality traits will nudge toward the deed's traits. The higher the character's Impressionability setting, the more easily its personality traits are influenced by friends' deeds.

    For example, say a street urchin is adopted by a thief. As the urchin watches the thief commit robberies and burglaries, the urchin's Lawfulness value may decrease while his Greed value increases.

    Another nice improvement is that the Faction Manager inspector now lets you view and edit the runtime faction database.

    Version 1.8.6:
    • Changed: Save format now includes factions' personality trait values.
    • Added: Impressionability value to FactionMember, which changes personality traits based on deeds witnessed.
    • Added: FactionMember.ShareRumor delegate.
    • Added: Rumor.Expire() method.
    • Improved: Faction Manager editor now shows runtime faction database contents.
    • Improved: Added option to not run memory cleanup.
    • Improved: Methods in triggers & StabilizePAD are now protected virtual, not private.
    • Minor API updates for Unity 5.6.
     
  50. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,835
    So cool!!
     
    TonyLi likes this.
unityunity