Skip to content

Utility Agent

A Utility Agent is a special Utility Entity that helps your AI make the right decision based on the current situation, and controls it to perform the Action Tasks attached to the chosen decision.

Transforming GameObjects into Utility Agents

To transform a Game Object into a Utility Agent, you need to attach these two components to it:

  1. Utility Agent Facade

    • It is similar to Utility Entity Facade but instead of interact with the GameObject of the Utility Entity, it is used to interact with the Game Object of the Utility Agent.
    • To create your own Utility Agent Facade, you need to create a class inherited from UtilityAgentFacade. For example:
      public class Character : UtilityAgentFacade
      {
          [SerializeField]
          private Team team;
      
          private CharacterEnergy energy;
          private CharacterHealth health;
          private NavMeshAgent navMeshAgent;
          private Rigidbody rigidBody;
      
          public Team Team => team;
          public NavMeshAgent NavMeshAgent => navMeshAgent;
          public Rigidbody RigidBody => rigidBody;
          public CharacterHealth Health => health;
          public CharacterEnergy Energy => energy;
      
          private void Awake()
          {
              navMeshAgent = GetComponent<NavMeshAgent>();
              rigidBody = GetComponent<Rigidbody>();
      
              health = GetComponent<CharacterHealth>();
              energy = GetComponent<CharacterEnergy>();
          }
      }
      
  2. Utility Agent Controller

    • It is similar to Utility Entity Controller, but instead of create and manage the lifecycle of the Utility Entity, it creates and manage the lifecycle of the Utility Agent.
    • It injects Intelligence Data from the Utility Intelligence Asset into Utility Agent, granting the agent intelligence.
      center|400

Utility Intelligence Asset

A Utility Intelligence Asset is a data container used to save Intelligence Data of Utility Agents.

It includes Decision Makers, Decisions, Target Filters, Action Tasks, Considerations and is stored in JSON format. So you can edit it manually using your Text Editor then import it into Utility Intelligence Asset by using File Toolbar Menu.

But the recommended way to change Intelligence Data is to use Utility Intelligence Editor.


If you find this plugin more valuable than its price, especially when it's on sale, or if you simply want to support me on my development journey, there are currently 3 ways to do so:

1. Leave a 5-star review on the Unity Asset Store.
2. Buy assets through my Affiliate Links. It won't cost you any extra money, and I'll get a commission from Unity.
    • Utility Intelligence: A user-friendly Utility AI Framework
    • Top New Assets
    • Top Paid Assets
    • Top Downloaded Assets
3. Buy me a coffee at Ko-fi. Donation Benefits:
    • Your requests will be prioritized in my todo-list.
    • You'll receive a special role on my Discord server exclusively for donors:
       • Supporter: One-time donation.
       • Patron: Monthly donation.

Thank you so much for your support! 🥰
It allows me to dedicate more time to developing this plugin.


Last update : April 2, 2024
Created : March 31, 2024