Giter Site home page Giter Site logo

shijbey / tdrs Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 0.0 2.18 MB

A relationship system for RPGs, simulation games, and adventure games in Unity.

Home Page: https://assetstore.unity.com/packages/tools/behavior-ai/tdrs-trait-driven-relationship-system-231563

License: MIT License

C# 66.87% Python 0.92% ShaderLab 27.43% HLSL 4.77%
ai game-development relationships social-ai social-simulation unity unity-package factions-plugin faction-system

tdrs's Introduction

Trait-Driven Relationship System

TDRS Banner Image

Static Badge Static Badge

ko-fi

TDRS (Trait-Driven Relationship System) helps users model dynamic social relationships between characters in Unity projects, using various traits to represent personality traits, emotional states, relationship statuses, and faction affiliations. TDRS is ideal for RPGs, dating sims, adventure games, and life simulation games. Users can leverage TDRS as an additional layer for content gating, NPC decision-making AI, and reactive dialogue presentation.

Features

  • ๐Ÿค– Use agents to represent characters, factions, items, religions, concepts, or anything that might form social relationships.
  • โค๏ธ Define relationships representing one agent's feelings about another.
  • ๐Ÿ“Š Track agents and relationship numerical stat values
  • ๐Ÿท๏ธ Use traits to represent personality traits, statuses, faction affiliations, and emotional states and apply fitting stat modifiers.
  • ๐Ÿ‘ˆ๐Ÿพ Create rules that apply additional modifiers to relationships given that some preconditions are met.
  • ๐ŸŽŠ Enable agents to respond to events that happen to other agents, allowing for engaging relationship-driven gameplay scenarios where players must be mindful of the second-order social effects of their interactions with various NPCs.

Project contents

This repository contains a Unity project with TDRS added as an embedded package. The package-specific code can be found in the Packages/TDRS directory. All other data found in the Assets folder belong to the samples.

Documentation

You can learn more about TDRS and how to get started by visiting the Wiki. There, you can find a getting started tutorial and various how-to guides to assist you.

Limitations

  • TDRS is not optimized to handle a large number of NPCs. Some users might encounter performance slow-downs if they try to make something like Crusader Kings. More extensive performance profiling is required to investigate this.

tdrs's People

Contributors

shijbey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tdrs's Issues

RelationshipController Inspector not populating when loading from save

The RelationshipController inspector does not show traits and stats when loading information from a save file in the demo scene. The information is properly loaded, as it appears within the TDRS Database viewer, but it seems that RelationshipControllers never have their SetRelationship method called to ensure the editor displays the correct information.

Add feature to check the validity of SocialRuleInstances

Once social rule instances have been applied, they remain in effect until the trait responsible for them is no longer active. It would be nice if:

  1. Social rules were evaluated on every simulation tick to see if they still apply
  2. There was an EvaluateRelationship(target) method on social agents that would check social rules and recalculate stats for a particular relationship

NullReferenceException: SerializedObject of SerializedProperty has been Disposed.

Description

The following error appears when exiting Play mode while inspecting any GameObject with a TDRS Entity component. I think this might be caused by displaying serialized information that does not belong to the character. So the data might be cleaned up while the TDRS Entity script is using it.

I thought it might be caused by nesting the list views for relationships and stats, but even with those disabled. The problem persists with the traits list, which is a simple list of strings.

NullReferenceException: SerializedObject of SerializedProperty has been Disposed.
UnityEditor.SerializedProperty.Verify (UnityEditor.SerializedProperty+VerifyFlags verifyFlags) (at /Users/bokken/build/output/unity/unity/Editor/Mono/SerializedProperty.bindings.cs:476)
UnityEditor.SerializedProperty.get_intValue () (at /Users/bokken/build/output/unity/unity/Editor/Mono/SerializedProperty.bindings.cs:994)
UnityEditor.UIElements.Bindings.ListViewSerializedObjectBinding.Update () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Editor/Bindings/ListViewBindings.cs:349)
UnityEngine.UIElements.VisualTreeBindingsUpdater.UpdateBindings () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Bindings/VisualTreeBindingsUpdater.cs:330)
UnityEngine.UIElements.VisualTreeBindingsUpdater.Update () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Bindings/VisualTreeBindingsUpdater.cs:293)
UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/VisualTreeUpdater.cs:111)
UnityEngine.UIElements.Panel.UpdateBindings () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/Panel.cs:1002)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.UpdateSchedulers () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:256)
UnityEngine.UIElements.UIEventRegistration.UpdateSchedulers () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Core/UIElementsUtility.cs:105)
UnityEditor.RetainedMode.UpdateSchedulers () (at /Users/bokken/build/output/unity/unity/ModuleOverrides/com.unity.ui/Editor/RetainedMode.cs:55)

To Reproduce

  1. Open the Sample Scene
  2. Enter Play Mode
  3. Click "Character_A" or any of the other characters to open their inspector
  4. Exit PlayMode while still inspecting the character to produce the error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.