Love/Hate is designed to help other AI solutions make better decisions. It includes integrations with many popular AI solutions and other assets.
If you want to integrate Love/Hate with a different AI solution, this page contains a brief overview. More detailed information is here:
Love/Hate manages emotional states and relationships between factions. Individual characters typically have their own faction, although generic monsters often share the same faction for simplicity. Factions can have parents and inherit relationships from them. A relationship is a value [-100,+100] that represents a type of feeling one faction has toward another. The default relationship type is “Affinity”, which represents general like/dislike. You can also define additional relationship types such as “Obligation” or “Lust”.
The main parts of Love/Hate are:
  • FactionDatabase: Asset. Defines all factions, including their personalities and relationships. Every faction has an int ID and a string name.
  • FactionMember: MonoBehaviour. Ties a GameObject to a faction in the faction database. Gives factions eyes into the game world so they can witness & remember deeds and share memories when they encounter friends. Also maintains an emotional state modeled by 3 floats <Pleasure, Arousal, Dominance> (aka PAD), each in the range [-100,+100].
  • FactionManager: MonoBehaviour. Central manager between faction database and faction members. Typically runs as a persistent singleton.
  • Deed: An action that faction members can judge, which affects their relationships and emotional states. Deeds are stored in faction members’ memory as Rumors, which contain additional subjective information.
Basic integration typically uses these functions:
  • Check emotional state: FactionMember.pad or FactionMember.pad.GetTemperament()
  • Check affinity: FactionMember.GetAffinity()
  • Report a deed: FactionManager.instance.CommitDeed() or DeedReporter.ReportDeed()
  • Optionally assign replacement functions to these FactionMember delegates: CanSee and GetPowerLevel
    • The default CanSee runs a raycast from the FactionMember to the GameObject that committed the deed. Love/Hate includes a more sophisticated replacement, or you can assign your own function.
    • GetPowerLevel defaults to 1. Affects how faction members judge deeds.
  • The manual also describes several EventSystem interfaces you can use such as IWitnessDeedEventHandler and IModifyPadDeedEventHandler.