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
    Love/Hate 30% Off

    Love/Hate is available in the Asset Store sale for 30% off right now!
     
    Weblox, twobob, Teila and 1 other person like this.
  2. nixter

    nixter

    Joined:
    Mar 17, 2012
    Posts:
    320
    I saw this talk from GDC and thought of Love/Hate, seeing as how it is the only social stimulative AI in Unity. I hope this spurs some new ideas on the topic.

     
    TonyLi likes this.
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Interestingly, Michael Mateas' new framework uses a 0-100 scale for Alliance (aka Affinity in Love/Hate), which is similar to what Love/Hate uses -- so thank you again to all the beta testers who convinced me to change the scale from [-1,+1] to [-100,+100] before release. Authority in Mateas' framework is modeled by the interaction of two values in Love/Hate: PowerLevel and Dominance. In several other regards, his framework has several areas where it's significantly more sophisticated than Love/Hate, although Love/Hate does have memory and sensors. For example, Love/Hate doesn't have gesture recognition or a behavior tree system. But what's great about Unity is that you can enhance Love/Hate with plugins like Behavior Designer for behavior trees. Mateas' framework has a lot more on the "output" side (expressing behaviors) than Love/Hate, which focuses mainly on the "input" side (seeing and judging deeds).

    Love/Hate is designed to keep its processing overhead very low so it can handle thousands of characters. Rather than add weight to Love/Hate itself, I think a good direction would be to write some interesting behavior trees to exhibit socially interesting behavior based on current Love/Hate values. This may be different for every game, though. Swinging a sword might be socially appropriate in a fantasy hack-and-slash game but not in a contemporary high school dating simulator. I'm interested to hear if anyone has thoughts on how they're implementing the "output" side of social simulation in their games.
     
    Hauhau, Teila, docsavage and 3 others like this.
  4. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Hey, @TonyLi.

    Finally getting around to integrating Love/Hate into a project and had a few questions. Some may be answered by the manual, but it's late and that thing is a doozie, and I felt my eyes glazing over... so I figured it couldn't hurt to ask a few questions to get me started.
    1. My game is effectively menu-based and doesn't have GameObject representations of characters walking around. The plan is to integrate Love/Hate through its API, calling methods through my own update cycles (not Unity's Update) as needed. Do you have any pointers or resources for using the asset in that manner, versus the intended way detailed in the manual?
    2. The relationships I'm most interested in modeling are those between pre-medieval kingdoms (as well as their subordinate rulers within). So for example, the Kingdom of Unitopia vs the Kingdom of Unrealand, but also that of Duke Schneider of Unitopia, Duke TonyLi of Unitopia, and Duke Sweeny of Unrealand with each other. Am I correct in that my Faction list should look something like:
      • Unitopia
      • Unrealand
      • Schneider (child of Unitopia)
      • TonyLi (child of Unitopia)
      • Sweeny (child of Unrealand)
    3. And if so, is there any problem with having ~300 or so total Factions, counting Members? My supposition is that the limits would come from how many are processed in an Update frame, but if I'm running those myself, that should be less of an issue, right?
    Looking forward to getting this going!
     
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Schneider21 - Faction members are MonoBehaviours, so they need to be added to a GameObject at some point. However, they don't have to be fully fleshed-out models walking around in a 2D or 3D world. They can just be empty GameObjects. If you want to create these GameObjects programmatically, there's a discussion and code in this forum thread: Is there a way to use Love/Hate without relying on GameObjects?

    Yes, exactly. You can have multiple parents, too. For example, TonyLi and Sweeny could also both be children of the University of the Land of Mary, since we went to the same school for undergrad. If Sweeny doesn't have a direct relationship with Schneider, his relationship to Schneider will be the average of his parents' relationships to Schneider.

    The Faction Manager MonoBehaviour will take care of this for you. You can specify how many to process in a frame. I test with 10,000 faction members during QA.

    My recommendation is to just throw your Faction Manager and all of your Faction Members on an empty GameObject. Or, better yet, create an individual child GameObject for each Faction Member to make it easier to browse through them in the Hierarchy.
     
    andreiagmu and Schneider21 like this.
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Side note: I'll be submitting version 1.8.7 tomorrow with these changes:
    • Moved to Plugins to speed up compilation.
    • Added: Can See Advanced component (sophisticated vision model).
    • Added: FactionMember.GetTraitAlignment delegate.
    • Fixed: Inheriting parent traits now uses parents, not oldest ancestor.
    • Updated support packages for: Adventure Creator, Makinom, plyGame, & TradeSys.
    UPGRADE NOTE: Since Love/Hate was moved to Plugins, before updating please delete the old Pixel Crushers folder to make sure you get a perfectly clean install. (And, as always with any update of any asset, make a backup first.)
     
    Last edited: Jul 14, 2017
    Weblox, BackwoodsGaming and hopeful like this.
  7. TonyLi

    TonyLi

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

    Version 1.8.7 is now available on the Asset Store!

    The new features are listed in the previous post. If you're upgrading from an earlier version, please see the upgrade notes! (TL;DR - Delete old version before importing 1.8.7.)
     
  8. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Love/Hate Updates: Dialogue System Support Update, Possible Min Version Change

    Dialogue System Support - Bugfix
    The Dialogue System Support package included in Love/Hate 1.8.7 has a bug in which the ModifyAffinity() Lua function actually calls SetAffinity(). A fix will be in the next release. PM me if you need a copy earlier.

    Unity 5.2.3 Minimum Version?
    I'm considering increasing the minimum version to Unity 5.2.3. Please speak up if this will be a problem for you!
     
    BackwoodsGaming likes this.
  9. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Short Updates/Notes:


    The next version of Love/Hate will require Unity 5.2.3 or higher.


    The developers of the Social NPCs mod for Skyrim will be presenting a paper at an IEEE conference this month describing their research. While Love/Hate uses a different, streamlined model, and not the Comme il-Faut used in Social NPCs, you can achieve similar behavior using Love/Hate in your Unity games. So go add some interesting NPCs to your worlds! :)
     
  10. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Since traits are now dynamic, is it possible to set them directly?
    Let's say I have a faction and every faction member should be a bit different, is it possible to set traits of a faction member or do I have to make a new faction?

    Could AbstractAuraTrigger contain a bug?
    The code says:
    var alignment = Traits.Alignment(m_self.traits, other.faction.traits);
    Shouldn't there be those dynamic traits instead of faction traits?
     
    Last edited: Aug 20, 2017
  11. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi @Carpe-Denius - In this case make a new faction please. Traits are dynamically changed on the faction itself. I didn't want to break existing projects by shifting traits off of factions and onto faction members. Think of the faction as the data you can set at design time and the faction member as the eyes and gut-reaction. For unique individuals, use a 1:1 mapping between faction and faction member. You'll usually only point multiple faction members to the same faction if they're essentially interchangeable (like generic cannon fodder goblins) or have a hive mentality (like the Borg).

    Since traits are on the faction (and not individual faction members), the code is OK.
     
  12. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Okay, thank you.
     
  13. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    I am considering purchasing Love/Hate. I have a project using UFPS-MP for multiplayer FPS, Dialogue System for conversations, ICE Creature Control for driving the AI elements, and need a method to align/conflict my various NPC factions with the player(s) and each other.

    Right now, without Love/Hate, every AI attacks anything that moves. I would like the only relationships that pre-exists to be zombie hates everybody, and soldier hates zombie. CitizenAI should learn to fear zombies, and players can choose to align with or shoot soldiers/citizens/players. Would Love/Hate be the right tool to:
    • Integrate with ICEcc to influence behaviors?
    • Allow AI to react to specific individuals (attack on site, neutral chat, happy chat, etc.)?
    • Allow AI to react to other AI/Players in factions (Army, Civilians, etc.)?
    • Integrate with Dialogue System to influence conversations?
    • Are there tutorials or other guidance that specifically deal with these 2 integrations?
    I have the following factions to deal with:
    1. Multiple unrelated players that can form their own groups, or join others' groups.
    2. Companion AI to aid players.
    3. Soldier AI that conflict with the zombies.
    4. Zombie AI that conflict with all.
    5. Citizen AI that conflict with zombies.
    Thanks,
    Mark
     
  14. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi, Mark!
    Next week, I'm going to work on a Love/Hate integration package for Opsive's Third Person Controller. I can also work on integration packages for UFPS and ICE.
    Yes. That's built in.
    Dialogue System integration is covered in the manual. I'll add UFPS and ICE integration to the manual, too. Please feel free to try out the evaluation version ahead of time if you'd like.
    If you want to share basic faction data across all players, you can make them child factions of an overall Player faction, and then give each player (Player1, Player2, etc.) its own faction. Companions could then have relationships to specific players and/or to the overall Player faction. Soldier and Zombie relationships would be set at design time. As citizens witness zombies attack factions that they care about (such as other citizens), this will build a negative relationship from citizens to zombies.

    Love/Hate handles the numbers behind all of this, but it relies on integration packages (or your own code) to interface with other assets, such as ICE's target decider. It's designed to make integration with other assets easy, so I should be able to take care of all three integration packages next week.
     
  15. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Hi @TonyLi Any progress on this integration? I would love to get busy adding some depth to my little game's AI.
    Thanks,
    Mark
     
  16. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    I'm doing my best to finish it by the end of the week, along with an update to the Dialogue System, prior to Unite next week.
     
  17. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Excellent! Please let me know when it's ready, and I will pop into the Asset Store and send a few dollars in your general direction.

    Mark
     
  18. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Pixel Crushers at Unite Austin

    We'll be at Unite Austin next week. If you're there, please stop by our booth to say hi and enter for a chance to win a copy of the Dialogue System, Love/Hate, or Quest Machine!


    (@Mad_Mark - The integrations for UFPS and ICE should be available for download tomorrow. I'll post the link here when they're ready.)
     
    BackwoodsGaming and Teila like this.
  19. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    I'm still working out an issue with the ICE integration, but it should be ready by the end of the weekend.
     
    BackwoodsGaming likes this.
  20. TonyLi

    TonyLi

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

    Love/Hate 1.8.8 has been submitted to the Asset Store and is available for download on the Pixel Crushers customer download site. If you need access, please PM me.

    Version 1.8.8
    • Added: DeedReactionEvents component. Hook up events in the inspector to react to witnessed deeds.
    • Added: UFPS support.
    • Added: ICE Creature Control support.
     
    BackwoodsGaming and Teila like this.
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Version 1.8.8 is now available on the Asset Store!
     
    BackwoodsGaming, Teila and hopeful like this.
  22. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Thanks Tony. I will be picking up a copy from the asset store at the end of the week. Enjoy Unite Austin!
    Mark
     
    TonyLi likes this.
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    BTW, all integrations work with the free evaluation version, too, so you're welcome to try before you buy. I'm always open to suggestions if anyone has additional feature requests on the UFPS and ICE integrations or any other integrations, too.
     
    TeagansDad and BackwoodsGaming like this.
  24. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    I forgot to mention in my previous post that Opsive Third Person Controller integration is coming next.
     
    Teila likes this.
  25. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Heyas Tony. I just jumped back to the first post to see what integrations have been added and what is planned. I noticed the last two haven't been added and the planned aren't there. Are these being kept track of in another place where we can see all available integrations for the package and what is on the drawing board for future addition? If it is kept track of somewhere else that is publicly accessible, I'd recommend replacing the lists in the first post with a link to where people can see all the current integrations. Would probably be good to have that for each of your pack threads.

    Keep up the awesome work!!!
     
  26. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Thanks for catching that! I just updated the first post. The Dialogue System's first post should be up to date, and as I add integrations to Quest Machine I'll update the first post there, too.
     
  27. BackwoodsGaming

    BackwoodsGaming

    Joined:
    Jan 2, 2014
    Posts:
    2,229
    Awesome!!! You rock, Tony!!
     
  28. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    @TonyLi I just loaded the UFPS/ICE demo, as setting up in my own project produced errors. Same ones show up in the demo.

    ArgumentException: An element with the same key already exists in the dictionary.
    System.Collections.Generic.Dictionary`2[UnityEngine.Collider,vp_DamageHandler].Add (UnityEngine.Collider key, .vp_DamageHandler value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
    vp_DamageHandler.Awake () (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_DamageHandler.cs:188)
    ICE.Integration.Adapter.ICEWorldDamageAdapter.Awake () (at Assets/ICE/ICEIntegration/Scripts/Components/ICEWorldDamageAdapter.cs:157)
    PixelCrushers.LoveHate.ICESupport.LoveHateDeedICEWorldDamageAdapter.Awake () (at Assets/Pixel Crushers/LoveHate/Third Party Support/ICE Support/Scripts/LoveHateDeedICEWorldDamageAdapter.cs:26)
    UnityEngine.Object:Instantiate(GameObject, Vector3, Quaternion)
    ICE.World.ICEWorldRegister:Instantiate(GameObject, Vector3, Quaternion) (at Assets/ICE/ICEWorld/Scripts/Core/Base/ICEWorld.cs:269)
    ICE.World.WorldManager:Instantiate(GameObject, Vector3, Quaternion) (at Assets/ICE/ICEWorld/Scripts/Core/Base/ICEWorld.cs:481)
    ICE.Creatures.Objects.ReferenceGroupObject:InstantiateNewObject(Vector3, Quaternion) (at Assets/ICE/ICECreatureControl/Scripts/Core/Objects/ice_CreatureRegisterReferences.cs:834)
    ICE.Creatures.Objects.ReferenceGroupObject:Spawn() (at Assets/ICE/ICECreatureControl/Scripts/Core/Objects/ice_CreatureRegisterReferences.cs:796)
    ICE.Creatures.Objects.ReferenceGroupObject:TryInitialSpawn() (at Assets/ICE/ICECreatureControl/Scripts/Core/Objects/ice_CreatureRegisterReferences.cs:953)
    ICE.Creatures.ICECreatureRegister:Update() (at Assets/ICE/ICECreatureControl/Scripts/Components/ICECreatureRegister.cs:226)

    Seems the damage handler is misbehaving. Any ideas?
    The zombies (bears?) also record all kinds of negative feelings when I light 'em up, but never shoot back or take any aggressive action. By design?

    Mark
     
  29. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    Changed the Player Interactor to TAG Player. Bears now kick my butt. Still have those 4 errors though.
     
  30. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    That's an ICE error. It's harmless, but I'll see if I can find a way to work around it so the console stays clean. [Edit: My mistake. It wasn't entirely harmless. The solution is to add a (trigger) collider to the creature.]
     
    Last edited: Oct 14, 2017
  31. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    I have put Love/Hate into my current project. I am running into an odd problem. It seems that the second zombie AI that has a Love Hate Deed ICE World Damage Adapter on it gets its LHDIWCD script disabled with the following error in the console:
    ArgumentException: An element with the same key already exists in the dictionary.
    System.Collections.Generic.Dictionary`2[UnityEngine.Collider,vp_DamageHandler].Add (UnityEngine.Collider key, .vp_DamageHandler value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:404)
    vp_DamageHandler.Awake () (at Assets/UFPS/Base/Scripts/Gameplay/Combat/vp_DamageHandler.cs:188)
    ICE.Integration.Adapter.ICEWorldDamageAdapter.Awake () (at Assets/ICE/ICEIntegration/Scripts/Components/ICEWorldDamageAdapter.cs:157)
    PixelCrushers.LoveHate.ICESupport.LoveHateDeedICEWorldDamageAdapter.Awake () (at Assets/Pixel Crushers/LoveHate/Third Party Support/ICE Support/Scripts/LoveHateDeedICEWorldDamageAdapter.cs:26)

    Here is the zombie in game:
    upload_2017-10-14_13-41-46.png

    And in editor:
    upload_2017-10-14_13-43-0.png

    Any help stopping this would be appreciated.
    Mark
     
  32. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Hi Mark, thanks for the screenshots and details. I'll investigate and reply with a solution by the end of the day.
     
  33. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    @Mad_Mark - Add a collider to your zombie. You can tick Is Trigger so it doesn't actually collide with anything.

    ICE's ICE World Damage Adapter (which Love/Hate builds on top of) expects that the GameObject has a collider. My ICE UFPS Love/Hate example scene has the same issue because I forgot to add a collider to the Zombie. To fix it, I added a tiny collider and ticked Is Trigger.
     
  34. Mad_Mark

    Mad_Mark

    Joined:
    Oct 30, 2014
    Posts:
    484
    That fixed it. Thanks.
     
  35. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Last edited: Nov 27, 2017
    hopeful likes this.
  36. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Mega Sale Ends DECEMBER 8

    Just posting a quick reminder that the Mega Sale ends December 8 at midnight PST. You can get Love/Hate for 30% off, and view all the assets on sale here.
     
    Last edited: Dec 1, 2017
  37. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Correction: Mega Sale ends December 8. Sorry I got the date wrong in my previous post. I corrected it.
     
  38. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Mega Sale Ends Today

    Just posting a reminder that the Mega Sale ends at midnight PST. If you haven't picked up Love/Hate yet, get it today for 30% off.

    Love/Hate has integration with Quest Machine, which is a featured asset in the Mega Sale and discounted 50% off this week, and the Dialogue System for Unity, which is also discounted in the Mega Sale.

    Or click the banner below to see everything that's in the Mega Sale:

     
  39. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    Moved across to here! Just had a quick look over the latest spiel from love/hate and it has some of the features I was going to ask about adding! I swear the last I checked they weren't there but it's good to see that witnessing or hearing about events can alter the perceptions of others. One thing I didn't have up on the website is that each faction will have a lore tome that records the events the faction undertakes (so quest outcomes and updates). You can either fill it out yourself as the player, or have an npc scribe it for you, and that npc can be informed by others who were with you, and depending on if they like you they may write down that you were the hero, or that your companion they like more did it! This way history can be altered, and members of your faction could rise up and depose you.

    I'm currently using a quest system custom made for the invector controller, but I will have a look at this and your quest machine and dialogue system as they all have integration with each other which saves a lot of fiddling about. Really keen to delve into this more as I am aiming to have a living world that doesn't wait for the player to act, and allows the AI to act upon each other, which I think Kingdom Come is currently doing.
     
  40. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Sounds good, @uberwiggett! You can download free evaluation versions of Love/Hate, Quest Machine, and the Dialogue System on http://www.pixelcrushers.com to see what they can do.

    All three are designed to let the world "live" around the player(s). In Love/Hate, there's no distinction between players and NPCs. Anyone can commit a deed, witness a deed, and/or share memories of deeds. Similarly, in the Dialogue System, conversations can run without the player being involved. (These are often used as color conversations that the player can eavesdrop on to learn about the game world.) And in Quest Machine any quester (player or NPC) can undertake and complete quests. You're responsible for any AI required to get your NPC questers to move, fight, etc., but the quest progression part is all handled by Quest Machine.
     
  41. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    thanks for that, really keen to try this out soon. I've noticed there are a few videos on youtube demonstrating dialogue and quest machine, but I can't seem to see any about love/hate. Am I failing at looking or are there none yet? :)

    Also i've updated the virtue system page on my site https://encardia-citadel.info/virtue-system/ it outlines one of the core features I am after in the system. If you get time and are interested, can you take a look and comment about how love/hate could work in relation to what's proposed?
     
  42. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Not yet! All Pixel Crushers assets are getting nice updates soon, followed by long-overdue video tutorial updates.

    I'm not sure if you designed it based Love/Hate's specs, but that's exactly how Love/Hate works.
    • Each sin/virtue is equivalent to a Love/Hate personality trait.
    • Mood is equivalent to temperament.
    • Social pressure can be determined by the character's relationships.
    • Precedence can be determined by the character's memory, which is a record of deeds that the character has witnessed or learned from a friend.
    To implement social pressure and precedence, you may need to use a little scripting (or visual scripting like PlayMaker), but the data is there to be pulled from Love/Hate. Virtues and moods are built into Love/Hate and handled automatically.

    I'm not sure if you'd be interested in this, but each character can have multiple relationship values in relation to another character. For example, a character could have high Respect and Loyalty relationship values to his captain but a low Affection value. By default, though, Love/Hate defines one simple Affinity value that represents general like/dislike.
     
    hopeful and TeagansDad like this.
  43. uberwiggett

    uberwiggett

    Joined:
    Jun 26, 2015
    Posts:
    105
    That sounds fantastic, yeah I definitely want the varied levels in relationships, part of the lust/chastity aspect is the ability to either be in love with one character obsessively or be obsessively flirtacious with as many characters as you can, so the ability to determine other attraction details would allow the system to pick which one :) It's true a lot of this was written after looking at a lot of different AI options, but after reading a few of them I wasn't sure which one did what but I'm happy to see it's covered!

    As an aside, with the idea of passing records of memory between characters, is there a way to physically represent that by a messenger system? My idea would be like sending pidgeons or ravens between areas to pass messages through, so there would be chances to intercept or alter messages, or limit exposure to them. From what I can tell the message is passed via proximity between characters, but I don't know how it's handled on the back end. And lastly, I'm assuming this integration has been covered much like the quest machine, but dialogue options that alter or rely on love/hate stats, is that a thing?
     
  44. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    It's just a simple script call to FactionMember.ShareRumors().

    Yes, absolutely.
     
    uberwiggett likes this.
  45. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    A new Love/Hate user had some questions, and I thought I'd post the info here in case it's helpful to others.


    Brief Overview of How Love/Hate Works

    Characters in Love/Hate are defined by three aspects: relationships, personality, and emotional state. They all use the range -100 to +100.


    RELATIONSHIPS are values in the range -100 (hate) to +100 (love) that the character feels for others. This value is called affinity. Taking Star Wars, for example, Luke Skywalker might have a +100 affinity to Yoda and a -100 affinity to Emperor Palpatine. (You can optionally add more types of relationship values. For example, in addition to affinity you could define values for respect, lust, obligation, etc.) I'm using +100 and -100 in this description, but those are the extremes. Someone with +80 affinity to Yoda still likes Yoda quite a lot.


    PERSONALITY is defined by a number of personality traits that you can specify. In a simplistic model, you could define a single personality trait, such as Force. Yoda would have +100 in this trait, indicating the Light Side, and Palpatine would have -100, indicating the Dark Side. OCEAN is a more sophisticated model, which defines personality with 5 traits: Openness, Conscientiousness, Extraversion, Agreeableness, and Neuroticism. The OCEAN Template section near the end of Love/Hate's manual provides some examples of how you can interpret different combinations of trait values. Personality is usually fairly static. For example, a ruthless, cool-headed spy typically exhibits the same personality throughout the game.

    Whereas OCEAN has 5 personality traits, MegaOCEAN has 35 traits. This is overkill in my opinion. The example provided for "Shy Person" is poorly presented; in the next release, the manual will be updated to show +40 and +80 instead of +1 and +2.

    You can also use personality traits to describe deeds. In the Star Wars example, Palpatine's Dark Side Lightning would be associated with Force -100. This comes into play when characters witness deeds. If Palpatine were to witness Luke using Lightning, he would be especially pleased because Lightning's -100 trait lines up with Palpatine's -100 personality. However, the spirit of Yoda would be especially displeased because Lighting's -100 is the opposite of Yoda's +100 personality.


    EMOTIONAL STATE is defined by 3 values: Pleasure, Arousal, and Dominance (PAD). Unlike personality, which is fairly static, a character's emotional state can change moment-to-moment. The P, A, and D values are also in the range -100 to +100.

    Emotion models give you a way to interpret PAD values into a single description. By default, Love/Hate uses the Temperament model, which categorizes PAD values into 8 different single-word descriptions. For example, a character who is currently Pleasure +100, Arousal +100, and Dominance +100 feels "Exuberant". A character who is currently Pleasure -100, Arousal +100, and Dominance -100 feels "Anxious". You can use these single-word descriptions to drive your characters' behavior -- for example, playing a nervous animation when the character feels "Anxious", or speaking different dialogue options.

    If you want finer detail than the Temperament model's 8 categories, you can use the OCC model, which categories the 3 PAD values into 22 different categories.



    A good balance of performance and complex modeling is to use one relationship value (affinity), 5 personality values (OCEAN), and the Temperament model for emotional state. This keeps memory and CPU very low. Love/Hate generates virtually no garbage to be collected, either. Our test bed runs 10,000 simultaneous characters, all committing deeds, judging each other on those deeds, and gossiping with each other to transmit knowledge of those deeds to others.

    If your game calls for more detail, you can add it as needed. For example, a dating game might define additional relationship traits, such as lust, admiration, etc.


    You'll usually define personality traits at design time, and let Love/Hate update relationships and emotional states automatically in response to gameplay actions. To report these gameplay actions to Love/Hate, you'll tell Love/Hate that a character committed a deed to another character. Witnesses will then update their relationships and emotional states based on how they judge the deed. For example, if Darth Vader cuts off Luke's hand, this will please Palpatine (PAD) and improve his affinity to Vader (relationship). You can also manually adjust personality values, relationship values, and PAD values in your own code (or visual scripting if that's what you use).
     
  46. TonyLi

    TonyLi

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

    Version 1.8.9 is now live on the Asset Store!

    This version features some nice updates to the core system, such as an in-game Faction Member Debugger component and a tweak to deed evaluation that allows the Dominance emotion value to better reflect the witness's affinity to the deed's target.

    It also adds Emerald AI integration. Combat with AIs affects Love/Hate factions and emotional states, and can push AIs into different Emerald temperaments (e.g., from Passive to Aggressive).

    The screenshot below is from the Emerald AI example. It also shows the Faction Member Debugger. (You can customize the debugger's appearance; this is just the default.)




    Release Notes
    • Changed: Dominance change now better reflects witness's affinity to target.
    • Added: FactionMemberDebugger.
    • Added: FactionMember.ForgetDeed().
    • Added: FactionManagerSaver & FactionMemberSaver integration with Save System.
    • Improved: Save System now uses nonallocating (no GC) methods when loading.
    • Emerald AI: Added support.
    • ICE Creature Control: Fixed bug in demo scene.
    • PlayMaker: [Breaking Change] Actions with GameObject fields now use FsmOwnerDefault & require reassignment.
     
    Last edited: Mar 19, 2018
    hopeful likes this.
  47. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Wait! where I can learn about this?
     
  48. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    In 2012, game AI researcher Stephane Bura game an influential GDC talk. Here are the slides: Emotional AI for Expanding Worlds.

    In many ways, Love/Hate is an implementation of the theoretical system he described in the talk, streamlined in some ways to make it practical, and augmented in other ways with newer ideas that have been proposed since then.
     
  49. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,492
    Oh I worked with him lol, I was hired by him due to my work in similar domain, I'm resuming slowly those things lol: https://neoshaman.github.io/Javascript-experiment/ I use a motivational model here to model paramters for story, it basically works a bit like BURA describe, as I was the one introducing scale to make story dynamics and have semantic, but he moved to personality as driving force (as in cause action to drive plot forward), I used need/motivation (a simplified maslow model) as a general driving and structural force (as in plot IS the action).
     
  50. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,670
    Neat! Did you work with Storybricks?

    I like your Javascript experiment. It's like a narrative generator crossed with an intelligent version of the Videogame Name Generator on steroids.

    You might be interested in Quest Machine. It procedurally generates quests based primarily on drives (needs/motivations), although it can incorporate personality, too. (It has Love/Hate integration.) It's heavily influenced by Richard Bartle's Dawn of Time articles, Doran & Parberry's work at UNT, and Till Riemer's research at ITU Copenhagen.
     
    uberwiggett likes this.