Difference between revisions of "Brain"

From AI Product Manuals
Jump to navigationJump to search
(→‎Concept: Initial Entry)
(Added more about the concept)
Line 3: Line 3:
== Concept ==
== Concept ==
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 Pack|Behavior Packs]] and [[Ability Pack|Ability Packs]]. However, the Brain class contains most of the data for the agent's thinking and does most of the work of scoring [[Behavior|Behaviors]] and keeping track of the history of the Behavior usage.
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 Pack|Behavior Packs]] and [[Ability Pack|Ability Packs]]. However, the Brain class contains most of the data for the agent's thinking and does most of the work of scoring [[Behavior|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 [[Decision|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 ==
== Code ==


== Data ==
== 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 ===
=== Export ===
Exporting a Brain is merely exporting the Brain's ID and the Behavior Packs and Ability Packs it contains.

Revision as of 14:33, 29 September 2021

This page is part of the IAUS Manual.BrainBehaviorBehavior TypeDecisionAI Entity

Concept

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.