Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] 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:
    12,670
    Hi @ikemen_blueD - Yes, it's only used for this reason.

    If the King still exists and the Princess only has a relationship to Bandit because of her parent, then it's like this:
    • Princess.Personal Relationships = { <Princess, King> , <Princess, Queen>, <King, Bandit> }
    But if you destroy the King faction and tell the Princess to inherit relationships the King's relationships, then the Princess will have a direct personal relationship to Bandit:
    • Princess.Personal Relationships = { <Princess, King> , <Princess, Queen>, <Princess, Bandit> }

    Yes. At runtime, you'll see this appear in the Princess's Faction Member inspector.

    Another good idea. I'll think about this. I want to strike a good balance between simple and powerful. It may be better to use a common "abstract" parent like this:
    • Royalty = { <Royalty, Royalty, +100>, <Royalty, Bandit, -80> }
      • King = { <King, Lover, +100> }
      • Queen = { }
      • Princess = { <Princess, Bandit-B, +20> }
    So the King has a personal relationship to his Lover. King, Queen, and Princess all inherit from Royalty, so they all dislike Bandits.

    [EDIT: The more that I think about it, I really like your idea of a "Secret" flag for relationships! I'll try to get it implemented in the next version.]

    You wrote previously:
    You could report two deeds. For example, say Bandit-B robs a Villager. Report:
    1. Deed: Bandit-B robbed Villager: Impact=-50
    2. Deed: Bandits robbed Villager: Impact=-10
    This lets you specify different impact values based on your own criteria. If the Princess witnesses the deed or hears about it, she will adjust her affinity to Bandit-B and, to a lesser extent, Bandits.
     
    Last edited: Oct 4, 2015
  2. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    hey, thanks for all the awesome answers. Surprisingly, I learn a lot about the Object Oriented concept from your system. I did not know that Emotional AI is such a fun topic. Be alert that more questions may come up soon =)

    1) Scripts\Core\Faction Members\Pad.cs


    else if (unhappy && aroused && !dominant) { return Temperament.Anxious; }

    should Anxious be P-, A+, D-?

    2) is there a reason why you left out "a Deed.Tag" in the Deed Template GUI section. How can I set "a Deed.Tag" in design-time?

    3)


    When I click "the Plus button" in the Deed-Template gui-section. It gives me a list of Presets. By selecting one, for example Citizen preset, it will generate a "Null-Reference-Exception: Object reference not set to an instance of an object". I guess it could not find the "Citizen preset" somehow.

    Many thanks!!!
     
    Last edited: Oct 5, 2015
    TonyLi likes this.
  3. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    hi @TonyLi , I have some questions for you :)

    LoveHate\Scripts\Core\Faction Members\FactionMember.cs

    1) this is not always bounding to range [-1, +1]. I think a Clamp should be there. I'm not sure.

    for example, traitAlignment = 0.9, changeInAffinityToActorNorm = 0.648, traitAlignmentImportance = 50, then we have:
    [ (0.9 * Abs(0.648)) / (50/100)] = 1.1664 , bigger than 1.

    2) if I set traitAlignmentImportance = 0, I have:

    var traitImpactNorm = ( traitAlignment * Mathf.Abs(changeInAffinityToActorNorm) ) / (0 / 100);

    is it dividing by zero?
     
  4. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @ikemen_blueD - At that point in the function, we allow the value to go outside the range. We clamp it further down.

    I'll check this and make sure it's bulletproof in the next release.
     
    ikemen_blueD and hopeful like this.
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    I'm afraid the "upgrade" discount price is no longer available for Dialogue System for Unity users. I tried to configure Love/Hate as a "major version" upgrade of the Dialogue System, but it turns out that the Asset Store system really didn't like this. It merged data between both listings on the Store and caused all kinds of mess. I will do my very best to make sure Love/Hate is more than worth its regular Store price!

    Expect a new version at the end of the week!
     
    hopeful and BackwoodsGaming like this.
  6. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Would be nice if the asset store had bundling options available for those asset authors that wanted to provide discounting to loyal customers. Wonder if you could create another asset that was an actual bundle? Wait, you still couldn't do an upgrade if people wanted to upgrade to that with how the upgrades work on asset store, if I'm following correctly..

    At any rate, you do an awesome job supporting all your assets. If someone is looking for this type of functionality, it is well worth the price just knowing that you are buying from an asset author who actually provides top notch support!
     
    TonyLi likes this.
  7. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    damn, these past two weeks so busy with my day works. I'm missing your Love/Hate system already, can't wait for the new update Tony. Btw, I'm still patiently waiting for your procedural Quest system :) Nice weekend guys!!!
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Version 1.7 was submitted to the Asset Store on October 24, so hopefully they'll make it available for download soon.

    Work is progressing on finishing up the quest system, too!
     
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Love/Hate 1.7 Now Available!

    Love/Hate 1.7 is now on the Asset Store!

    Version 1.7
    • Added: Customizable emotion model. Includes a 22-emotion template for those who want to use the OCC model.
    • Added: Relationships can be marked inheritable (default) or non-inheritable (e.g., secret relationships).
      • NOTE: Save game serialization format changed to accommodate relationship inheritability value.
    • Added: Ability to affect relationship to subject's parents when changing relationship to a subject.
    • Changed: When adding new factions in editor, initializes instead of copying previous item.
    • Fixed: Possible division by zero in deed evaluation.
    • Fixed: In editor, summing personality & relationship traits now clamp to [-100,+100].
    • PlayMaker: Added GetEmotionalState, SetRelationshipInheritability actions.
     
  10. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Version 1.71 Submitted - Cosmetic Fix

    If you're using Unity 5.2.1p3 or higher (including 5.2), Unity will report these warnings when you import Love/Hate 1.7 or earlier:

    Assets/Pixel Crushers/LoveHate/Scripts/Core/Faction Members/FactionMember.cs(614,82): error CS0619: `UnityEngine.Physics2D.raycastsStartInColliders' is obsolete: `Physics2D.raycastsStartInColliders is deprecated. Use Physics2D.queriesStartInColliders instead. (UnityUpgradable) -> queriesStartInColliders'

    Assets/Pixel Crushers/LoveHate/Scripts/Core/Faction Members/FactionMember.cs(616,43): error CS0619: `UnityEngine.Physics2D.raycastsStartInColliders' is obsolete: `Physics2D.raycastsStartInColliders is deprecated. Use Physics2D.queriesStartInColliders instead. (UnityUpgradable) -> queriesStartInColliders'

    It's nothing to worry about. The API Updater will update it just fine.

    Version 1.71 was just submitted with a change that handles this at the source so you won't get any deprecation warnings.
     
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Version 1.71 Now On Asset Store

    Version 1.71 is now available on the Asset Store. It just contains the cosmetic fix described above. If you're not using Unity 5.2.p3 or higher, you don't need update. :)
     
  12. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Quick question if you don't mind- does the system currently have the ability to handle members of a faction having different affinities for a character, such that Bob and Frank can both be pirates, but one of them has a positive affinity for the PC while the other maintains a very negative opinion of him?
     
  13. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Sendatsu_Yoshimitsu - Yes, that's the heart of Love/Hate.

    A good way to set this up is to define a Pirates faction. You can define a relationship between Pirates and the player, or leave it undefined (neutral) until the player does something to affect the relationship such as helping the pirates escape jail.

    Bob and Frank would also have their own factions. Their parent faction would be Pirates. But they'd also have personal relationships to the player, where Bob's is positive and Frank's is very negative. (If another pirate doesn't have a personal relationship to the player, he'll inherit his affinity to the player from his parent faction, Pirates.)

    Let's say Bob and Frank witness something bad happening to the player (or hear about it through the gossip system), such as the governor's daughter spurning the player's advances. Since Bob likes the player, he will feel sad and lose some affinity to the daughter. Since Frank hates the player, he'll feel happier and gain some affinity to the daughter.
     
  14. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    That's really helpful, thank you for taking the time to elaborate. :)

    Edited to add: quick follow-up question that occurred to me- do parent/child factions effect each other at all? Say Pirates have a -100 affinity for the player, and Bob has a +50. Is his net affinity -50 (pirate + Bob) or 50 (Bob)?
     
    Last edited: Nov 13, 2015
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Child relationships completely override parent relationships. This allows for more dramatic relationships. For example, say the Kingdom faction has -100 affinity to Pirates. Barring any personal relationships, a citizen of the kingdom would also have -100 affinity to Bob the Pirate (since both sides get values from their parent factions).

    Now say the Princess is madly in love with Bob the Pirate. Her affinity to Bob is +100. If inherited and personal relationships were averaged, her effective affinity would be 0. Since personal relationships override inherited relationships, it stays at +100.

    Note that you can mark some relationships as non-inherited. Say the Princess has Ladies-In-Waiting who inherit from the Princess faction -- in other words, they share all the same beliefs as the Princess. To make the Princess's relationship to Bob private, mark it as non-inherited. This way, the Ladies-In-Waiting won't know about the Princess's relationship to Bob, and they will inherit the Kingdom's relationship (-100) instead.
     
  16. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    This might be far too game-specific for the product thread, but I'd love to hear your thoughts if you have any: I'm using this in a game with a calendar and day/night cycle, where the NPC population is consistent, but you can go multiple days between encounters with a given character. Since the game is quite large most of the NPCs are culled out of the scene when you walk away, and don't persist in the game world to interact with each other off-screen.

    The result is that in gameplay, the PAD system feels weirdly inconsistent- if you enter an area and stay there for a while, you can watch NPCs interact and their moods begin to change, but if you pop in, talk to the one person you need, and pop out, you never really get to appreciate the depth of the mood and personality simulation.

    We've tried aggressively equalizing everyone's PAD, so every conversation starts at the same neutral ground, but our playtesters figure this out and start doing weird things to game the system, like behaving antagonistically towards someone's enemy every time they need to talk to that person, as a way of "priming" their mood to a more favorable disposition.

    We've also tried simulating interactions between NPCs, by randomly generating an interaction and rumor/deed history when a character spawns in, but that process is opaque to the player and carries the same problem that just randomly generating PAD values when an NPC spawn would, namely that it makes it possible for an NPC to be difficult or impossible to deal with when you arrive. The player can try to ascertain what has caused the mood and deal with it by taking positive or negative actions towards a related character, but since the simulation is still running in the background it's possible that they'll come back only to find that yet another random event has changed the situation in a way they can't predict or control. This typically ends with playtesters save scumming or sleeping through multiple days, as it's the most efficient way of getting a mood beneficial to their intentions.

    So do you have any thoughts on how to simulate or otherwise maintain consistent moods over time? In theory our setup seems like a perfect use case for where personality simulation can shine, but it's surprisingly difficult to balance.
     
    hopeful likes this.
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Sendatsu_Yoshimitsu - Interesting issue, and good writeup. Making the NPCs persist (or appear to persist) should help a lot.

    Before culling out an NPC, use FactionMember.SerializeToString() to save its data to a string. Then store this string somewhere along with the game time when it was culled.

    When bringing the NPC back into the scene, use FactionMember.DeserializeFromString() to restore its data from the saved string. You could also use the saved game time to compute how long the NPC has been out of action, and then equalize the PAD to a corresponding degree.

    To address the issue of spamming favorable deeds to "prime" an NPC, what about ramping up the NPC's Acclimatization Curve? Each successive deed will have less of an impact to witnesses. For example, say you're doing a high school simulation and you want to talk to a jock. You could get on the jock's good side by insulting a nerd first. But, with a high curve, if you insult the nerd again, the jock will have already gotten used to it, so it won't affect the jock's mood any further.

    You can also tweak the deed's personality traits. Maybe my ridiculously stereotyped high school simulation has a Meanness personality trait. Goths don't like nerds, but they also don't like Meanness. If you insult a nerd, it won't make the goth much happier because the deed goes against its personality traits.
     
    hopeful likes this.
  18. Sendatsu_Yoshimitsu

    Sendatsu_Yoshimitsu

    Joined:
    May 19, 2014
    Posts:
    691
    Thank you for the considerations! Messing with the acclimatization curve is an excellent idea, and I think treating the obvious exploits will keep the core of the system transparent and fun to mess with while avoiding the weird emergent workaround we've been seeing from testers :)
     
  19. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Gamers will game the system where they can. Count on it. :)
     
  20. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    At least gaming the system is more fun when it's procedural!
     
    hopeful likes this.
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Pixel Crushers Website Downtime Tuesday 12/8/2015 9:30 AM MST

    The pixelcrushers.com website will be down tomorrow from 09:30 AM - 10:00 AM MST for maintenance. If you can't connect then, please try again after a few minutes. Thanks!
     
  22. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Love/Hate 1.8 Released!

    Love/Hate 1.8 has been submitted to the Unity Asset Store and should be available for download in a few days. If you need it sooner, please PM me for access to the Pixel Crushers customer download site.

    The big addition in Love/Hate 1.8 is plyGame support!

    Version 1.8:
    • Changed: Save game serialization format changed to accommodate dynamically-created faction names.
    • Improved: Can now adjust number of witnesses processed per update.
    • Improved: Implemented fast lookup of factions by name and ID.
    • Improved: Added tooltip help to all inspectors.
    • Adventure Creator: Added SetRelationshipInheritable action.
    • Dialogue System: Added SetRelationshipInheritable() Lua function.
    • plyGame: Added support.
     
    hopeful, BackwoodsGaming and Teila like this.
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Love/Hate 1.8 is now available on the Asset Store!

    Please note that the serialization format for saved games changed slightly, so it's not compatible with games saved in Love/Hate 1.71 and earlier. Other than that, no other changes, just improvements! :)
     
    ikemen_blueD likes this.
  24. wood333

    wood333

    Joined:
    May 9, 2015
    Posts:
    851
    Questions on third party integration:

    If I use the ORK bridge to replace ORKs factions with ORK LH managers/members, and I reach for LH from a Behavior Designer LH task, will the BD LH task find the ORK LH managers/members?

    If I use the ORK LH components, and Dialogue System, Play Maker, Trade Sys, and Behavior Designer, together, will Love Hate continue to receive and send its information elegantly among these assets. o_O
     
  25. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Yes. :)
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Just sharing this interesting article that Richard Moss wrote for Gamasutra: 7 uses of procedural generation that all developers should study.

    I opened the article expecting it to only cover procedural map generation, with maybe a little procedural animation thrown in. But I was pleasantly surprised that the first two examples were character-based procedural generation in Crusader Kings II and Shadow of Mordor -- the kind of thing that Love/Hate is designed for. If you're interested in procedural character generation, it's a worthwhile read!
     
    Teila, BackwoodsGaming and hopeful like this.
  27. TMPxyz

    TMPxyz

    Joined:
    Jul 20, 2012
    Posts:
    766
    Hi, TonyLi,

    This is a great project, currently I have some questions about random characters.

    I see that the personality traits data are put into "Faction" not "FactionMember",

    So, I want to spawn & kill random NPCs with different personalities in the runtime, should I create individual factions for each of them in runtime?

    Another question, I've seen APIs named like ***Personal*** (e.g.: SetPersonalRelationshipTrait), but the parameters are only faction ids, so are they supposed to be the relationships between factions? not between faction members?
     
  28. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @TMPxyz - Thanks! Yes, you should create different factions. You can use FactionDatabase.CreateNewFaction() in scripts or the equivalent visual scripting action in PlayMaker, Makinom, etc.

    That's correct. Love/Hate attempts to do as much as possible at the faction level, since it helps keep the processing very lightweight. "Personal" means personal to the faction, versus a relationship that's inherited from the faction's parents.
     
    hopeful likes this.
  29. TMPxyz

    TMPxyz

    Joined:
    Jul 20, 2012
    Posts:
    766
    Thanks, this is helpful.

    It's kind of different from the model I thought, I think I need to look further into the parent setting of faction.
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Exactly. In addition to creating a new faction with CreateNewFaction(), you can assign parents to the faction with AddFactionParent() and inherit traits from parents with InheritTraitsFromParents().

    By default, InheritTraitsFromParents() averages the traits of the parents. So if one parent is very greedy (e.g., has a Greed trait of +80) and another parent is only slightly greedy (e.g., has a Greed trait of +20), then the child will fall somewhere between them (+50 Greed).

    However, you can also tell InheritTraitsFromParents() to sum the traits. So if a goblin NPC named Fizbaz has two parents: Goblins (+10 Greed) and Thieves (+20 Greed), then Fizbaz as a goblin and a thief is extra greedy (+30 Greed).

    Factions can inherit from as many parents as you want, and the family trees can be as deep as you want. So Aragorn in the Lord of the Rings could have as parents Rangers of the North, Fellowship of the Ring, and Arathorn. Arathorn's parent could be Numenor. Numenor's parent could be Gondor, and Gondor's parent could be Men.

    Think of Faction Members, on the other hand, as the eyes and ears of a Faction. They can witness deeds, remember them, and share them with others. In most cases, there will be one Faction Member for a Faction -- e.g., Aragorn has only one set of eyes and ears. However, you can share Factions for generic NPCs, such as generic goblins, to simplify things.
     
    TMPxyz likes this.
  31. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Support Added for Zone Controller

    Love/Hate now has Certified integration with UtopiaWorx's Zone Controller! This integration is available in a patch for Love/Hate 1.8 that you can download here with your Unity Asset Store invoice number: Love/Hate Customer Downloads

    It will also be in the next full release of Love/Hate on the Asset Store.

    Future versions of Love/Hate will continue to take advantage of new features that are being added to Zone Controller.

    Zone Controller is a neat way to provide finer geographic control of Love/Hate. For example, if a Faction Member enters a zone in a tranquil temple, it might stabilize its emotional PAD values more quickly than normal. In this case, the tranquil temple's zone would influence the Faction Member's Stabilize PAD component. Another zone might affect an Aura, ramping up the intensity of its effect as the Faction Member moves deeper into the zone, providing more nuance than the default inside/outside Boolean state of the Aura.

    (If you haven't bought Love/Hate yet, wait a few days -- and keep your eye on the Asset Store!)
     
  32. JohnRossitter

    JohnRossitter

    Joined:
    Dec 18, 2013
    Posts:
    1,027
    Congrats Toni!
    I can't wait for UAS to finish their review of Zone Controller and we can get this party started!
     
    Teila and BackwoodsGaming like this.
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    50% Off - 24 Hour Sale

    Happy Valentine's Day, everyone! Love/Hate is 50% off in today's 24 Hour Sale !
     
  34. siblingrivalry

    siblingrivalry

    Joined:
    Nov 25, 2014
    Posts:
    384
    oooooooooooooooooooooooooh Present to myself. Happy St'Valentine's day me!!!!

    Thanks @TonyLi
     
    JohnRossitter and TonyLi like this.
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Multiplayer Support In Love/Hate

    Several people have asked about various types of multiplayer support. Love/Hate comes with a multiplayer example (using legacy networking since it still supports Unity 4). You can also find a discussion of multiplayer approaches in the Love/Hate Multiplayer Guide.
     
    Teila, siblingrivalry and hopeful like this.
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Featured Asset Store Staff Pick

    Love/Hate is a Featured "Asset Store Staff Pick"!

    And it's going to get even better with the upcoming version 1.9 release, which will include deeper certified integration with UtopiaWorx's excellent Zone Controller (a Featured "New On Asset Store" pick!). Zone Controller 1.0.1 will introduce new features that will give you much finer zone-based control of Love/Hate components.

    We'll also be starting a games showcase for games that use Love/Hate, similar to the showcase for the many games that use the Dialogue System for Unity. If you'd like to enter your game in the showcase, please PM me a website URL, short description, and screenshots or video!
     
  37. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    Yay!!!! John just told me that you guys were integrating. :) So happy! I had a great idea on how to use them together and asked him about it..and lo and behold, the work is almost done for me!

    Thanks!
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Teila - The integration in Love/Hate 1.9 will expose all the controllable properties in Love/Hate to Zone Controller. My thinking is that you'd just use Zone Controller to adjust those properties as desired -- for example, ramping up the influence of an Aura when a character is in a zone, or adjusting how quickly PAD values stabilize. If you have any other requests for Zone Controller support, please let me know. There are still a couple more days before I lock down 1.9 for final QA testing.
     
    BackwoodsGaming and Teila like this.
  39. Teila

    Teila

    Joined:
    Jan 13, 2013
    Posts:
    6,932
    At the moment, my plan is to use it to set up zones in my city that will affect the states of the NPCs. So they might be more aroused in the poor parts of town, more willing to fight or steal and more calm in the religious areas, maybe more friendly, willing to chat in the market area...and so on. I am sure I will find other cool things to use it for too. :)
     
    TonyLi likes this.
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Love/Hate 1.8.1 Available On Asset Store

    Love/Hate version 1.8.1 on now available on the Asset Store! This update primarily just adds support for Zone Controller and Zone Controller Pro, so it got assigned version 1.8.1, not a full 1.9.
     
    BackwoodsGaming likes this.
  41. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    Hello, I just got this recently, and now I have had time to mess with it some. I have a question or rather a problem, I'm reading the documentation PDF word for word for the setting up of Faction relationships. Specifically Parent Faction relationships with children inheriting them, and when I set up my Parent Faction with sub factions(child factions who are parenting it), I want the sub faction to inherit the parent factions relationships with OTHER parent factions relationships like so:

    FactionParent---->hates------>FactionParent2

    FactionParentChild----->inherited=(hates)----->FactionParent2Child

    but inside the UI when setting it up it says in the Documentation that it will SHOW me the faction inherited values. but its not!

    I'm worried its not going to work out this way for these children. The documentation says it should. But it says its not inheriting any values AND I made sure that the factions are set up correctly and parented correctly with all the boxes checked in the Parent Faction relationships.
    I'm not seeing it update when hitting refresh either. I tried all kinds of stuff. this is mind boggling

    Any help is appreciated thank you! I still like the product alot since it saves times and allows me to visually see my set ups.
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @frekiidoochmanz - Thanks for using Love/Hate! The UI doesn't show that level of detail, since it could be an enormous list (potentially n^2 elements for n factions), but it is taken into account at runtime. The UI only shows direct relationships of parents, grandparents, etc. For instance, in the example faction database, if you inspect Cat Girl, you should see that she inherits some relationships from her parent faction, Citizens.

    I should also mention that, while the inherited relationship list is visible at edit time in the faction database inspector, the inherited list for FactionMember components is only fully populated at runtime since it needs to attach to the FactionManager, etc.
     
  43. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    oh ok, thank you. that makes alot of sense, I'll keep testing it I'm sure it will work out because I did set it up right.
     
  44. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    I'll clarify the manual, too. Thanks for bringing it to my attention!
     
  45. senritsu

    senritsu

    Joined:
    Dec 12, 2012
    Posts:
    37
    Very interesting asset, i just read through the manual and noticed that the link to the API docs in the manual is broken.

    It points to http://pixelcrushers.com/lovehate/api/ which results in an empty Apache index page. Might want to look into that :)

    I was going to try for my own implementation of emotional state soon, but now that i found this asset, i am not sure if i need to. I have a few quick questions though:

    - How does the "power level" mentioned in the manual behave in its default implementation? The delegates are overridable, but what do they do in their default state? What metric is used to assess the power level of an entity?
    - The PAD model seems a bit limiting at first glance, but i might just not be in the right mindset yet to fully appreciate it. What are the limitations of the model as seen by someone who has been working on/with it for quite some time?
    - How easy would it be to expand the PAD model or replace it with a different one? Specifically, how strongly coupled is the rest of the systems to the characteristics of the PAD model.
    - How do deeds impact a FactionMember when they have no existing relation to another faction, just an inherited one from their parent faction. Is the inherited value taken as the starting value for forming their own personal relation? I ask because according to the docs the personal relations override any inherited relations, but i didn't see mention of how personal relations are formed in the first place.
     
  46. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @senritsu - Thanks! It should be fixed now.

    No metric whatsoever. The default power level is 1 for everyone. If you want to use power levels in your game, it's up to you to define what power level means.

    The PAD model is quite expressive. All the models in Love/Hate are based on real behavioral psychology. The PAD model might actually border on overkill for a game, since it's more nuanced than most players will be able to detect. But I figure it's better to have to scale back a bit than be limited.

    Pleasure, Arousal, and Dominance form axes in 3D space. Psychologists typically map out 16 temperaments in this space: Exuberant, Bored, Disdainful, etc. If you want to use a different mapping, you can define an Emotion Model and assign it to your character using an Emotional State component. Love/Hate includes an example Emotion Model that maps the 22 emotions defined in the OCC Model. (You can google PAD, OCC, OCEAN, etc., or look them up in a behavioral psychology text, but when you see them in the Unity inspector I think they make intuitive sense without having to look any further.)

    When you combine this with relationships (of which you can define any number of axes -- trust, fear, lust, etc.), you can build a really complex social model.

    Subsystems such as Temperament and Emotion Models that are based on PAD values depend on the PAD model, of course, but it's otherwise uncoupled from the rest of Love/Hate. You can completely ignore PAD if you want and implement your own emotional model.

    Unless you've defined a personal relationship at edit time, they're formed when the FactionMember witnesses a deed or receives gossip about a deed. At that point, the FactionMember judges the deed based on how it feels about the target of the deed*, the source of the gossip (if applicable), and how the deed's personality traits align with the FactionMember's personality traits. You can override this judgment function by assigning your own EvaluateRumor delegate. (A "rumor" is a record of a deed, either witnessed directly or heard from a gossiper.)

    *If the FactionMember doesn't have a personal relationship, it inherits its parents' relationships to the target and/or the target's parents as applicable. You can also specify that some parent relationships are not inheritable to children, and you can specify how inheritance works -- sum or average.
     
  47. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    Hey, sorry to bother you, but what is the best way to add a function or method that can change a gameobjects Faction on create (at runtime) based on a variable? or variable string? I noticed the API (and the script) actually reads a FactionID (int) and I'm not sure how to find this list in the code to convert it to a string or what.

    I'm also trying to figure it out so I can make a NodeCanvas equivilent myself since it isnt in that. (only in Playmaker which is bugging for me right now so i cant use it)
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @frekiidoochmanz - Get a reference to the FactionManager, and use its GetFaction method. If you already have a FactionMember and want to call its SwitchFaction method, you can use this code:

    Code (csharp):
    1. var newFaction = factionMember.factionManager.GetFaction("New Faction Name");
    2. if (newFaction != null) factionMember.SwitchFaction(newFaction.id);
    I'll ask Nuverian (who maintains the Node Canvas integration) to add the missing node actions. They were added to the PlayMaker integration after he wrote the original Node Canvas integration.
     
  49. frekiidoochmanz

    frekiidoochmanz

    Joined:
    Feb 7, 2016
    Posts:
    158
    thanks alot, I'll test this right away!

    edit: lol silly me I forgot to type "using PixelCrushers.LoveHate;" on top of my custom method classes. No wonder I was having such a hard time
     
    Last edited: Mar 23, 2016
  50. senritsu

    senritsu

    Joined:
    Dec 12, 2012
    Posts:
    37
    @TonyLi thanks for the quick and detailed response :)

    PAD space is usually mapped to 8 moods, not 16, with one for each octant, right?

    I still have that vague feel that 3 axes for the immediate emotional state might be limiting for the project i have in mind, but i guess i will have to try and see how it works out. I will probably get the asset anyways, at the very least to look at the sources :) Seems way too interesting to not get it for the really fair price.