Difference between revisions of "Brains"

From Forge Community Wiki
Line 10: Line 10:
  
 
== Behaviors ==
 
== Behaviors ==
 +
Behaviors are Brain's equivalent of Goals, constructed using a map of MemoryModuleTypes and MemoryStatus that dictates whether or not the Behavior can start executing. They can also be given a min and/or max runtime duration in ticks, automatically terminating at a timestamp randomly determined by the supplied runtime duration value(s). The "checkExtraStartConditions", "start", "canStillUse", and "stop" methods correspond to Goal's "canUse", "start", "canContinueToUse" and "stop" methods, respectively.
  
 
== Activities ==
 
== Activities ==

Revision as of 22:38, 28 March 2023

This page is under construction.

This page is incomplete, and needs more work. Feel free to edit and improve this page!

Brains were introduced in ?? as an alternative to Goals and Targets. Since then, all new mobs have been implemented using brains.

Sensors

Sensors are used to collect information about the entity’s world. This is where things like entity searches and block searches should be performed. After a specified amount of ticks, any search logic will run and store relevant information in the entity’s Brain using MemoryModuleTypes.

Memory Modules

Memory Modules are used to store state in the entity's Brain. They are also used as entry conditions for Activities and Behaviors, with the presence or absence of a memory functioning very similar to Flags used by Goals. Some Memory Modules have Codecs which allow the state they hold to be written to and loaded from disk.

Behaviors

Behaviors are Brain's equivalent of Goals, constructed using a map of MemoryModuleTypes and MemoryStatus that dictates whether or not the Behavior can start executing. They can also be given a min and/or max runtime duration in ticks, automatically terminating at a timestamp randomly determined by the supplied runtime duration value(s). The "checkExtraStartConditions", "start", "canStillUse", and "stop" methods correspond to Goal's "canUse", "start", "canContinueToUse" and "stop" methods, respectively.

Activities