Skip to content
Dizy edited this page Feb 8, 2024 · 45 revisions

Unity based Framework

This framework only work with Unity and is currently tested on the 2019.3 version.

When to use an Utility AI ?

While utility-based systems can be used in many types of games, they are more appropriate in situations where there are a large number of potentially competing actions the AI can take—often with no obvious “right answer.” In those times, the mathematical approach that utility-based systems employ is necessary to ferret out what the most reasonable action to take is. Aside from The Sims, other common areas where utility-based systems are appropriate are in RPGs, RTS, and simulations.

Source : http://intrinsicalgorithm.com/IAonAI/2012/11/ai-architectures-a-culinary-guide-gdmag-article/

How to start using xNodeUtilityAI

  • Firstly, clone the master branch if you want to check the framework example
  • Then copy the ReflexityAI/Assets/Plugins folder in your project to start using it
  • Create a script MyAI inheriting from ReflexityAI and add it to your GameObject (look at AI Component as example).
  • Create a script MyBrain inheriting from AIBrainGraph (look at AI-Brain as example).
  • Create a MyBrain using Unity contextual menu in your Project view.
  • Add a DataReaderNode to fetch fields and properties from your MyAI.
  • Add one or multiple DataSelectorNode to select the data from the DataReaderNode.
  • Add an UtilityNode to evaluate the DataSelectorNode outputs.
  • Add an OptionNode to connect the value provided by the UtilityNode.
  • Add a DataLauncherNode or a DataSetterNode to launch a method or set a value when the option is selected.
  • Play unity and click on the AI in the scene using the Tool > AI Debugger to observe the brain activity.