Skip to content

AI Component

Dizy edited this page Apr 30, 2020 · 20 revisions

The AI Component allow you to transfer contextual information to brain graph Nodes. Moreover it allow you to parameter your AI using the inspector.

To create your own AI component you have to inherit from ReflexityAI

    public class CubeAI : ReflexityAI {
        
        // External References
        [HideInInspector] public CubeEntity CubeEntity;
        public List<CubeEntity> OthersCubeEntities => GameManager.CubeEntities;
        
        private void Awake() {
            CubeEntity = GetComponent<CubeEntity>();
        }

    }

Add the component to any GameObject (prefab or in scene) associated to this AI (an enemy for exemple).

  • AI Brain : Here you can add one or more ai brain graph which will be used by the component.
  • On Enable Queuing : If you check this the AI will be processed OnEnable.
  • Queuing Loop : If you check this the AI will be automatically processed in a loop.
  • Option Resolution : This dropdown allow you to select between robotic and human.
    • Robotic : The AI will always take the best option or the first one (if all equals).
    • Human : The AI will randomize between the best options.
  • Multi Brain Interaction : This dropdown allow you to select which option will be choose between brains.
    • Cooperative : Each best option per brain are executed.
    • Competitive : The best option for all brain is executed.
  • Local AI Brains : All AI Brains are copied inside this list, you can access the local copy in runtime to display the ports values but all copy are destroyed when the application quit.
Clone this wiki locally