Brain

From AI Product Manuals
Revision as of 21:15, 29 September 2021 by Davemark (talk | contribs)
Jump to navigationJump to search
This page is part of the IAUS Manual.BrainBehaviorBehavior TypeDecisionAI Entity

Concept

IAUS Structure

A Brain is the top level component that is assigned to an agent in the game. From a data standpoint, a Brain is simply a collection of Behavior Packs and Ability Packs. However, the Brain class contains most of the data for the agent's thinking and does most of the work of scoring Behaviors and keeping track of the history of the Behavior usage.

It is the Brain class that is ticked on a regular basis by the game code. However, the Think Cycle is controlled by the brain itself. That means that while the Brain might be ticked every frame of game loop, the Brain may only think perhaps every 250ms.

During this process, the Brain assembles a list of potential neighbors and combines them as necessary with Behaviors to arrive at a combined list of Decisions to be scored and selected from. It then proceeds to score all those Decisions to arrive at the one with the greatest utility at the time.

If a new Decision is selected, the related Behavior Type is executed. Additionally, data is adjusted in the Brain to make note of what the Brain is currently doing, the history of behaviors, etc.

Code

Data

From a data standpoint, other than a unique ID, name, and a description, a Brain is simply a collection of Behavior Packs and Ability Packs.

Export

Exporting a Brain is merely exporting the Brain's ID and the Behavior Packs and Ability Packs it contains.