From AI Product Manuals
Revision as of 14:21, 30 September 2021 by Davemark (talk | contribs) (Initial Entries)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
This page is part of the IAUS Manual.BrainBehaviorBehavior TypeDecisionAI Entity

This item is a component of a Behavior.


The Duration Type for a Behavior specifies how long a behavior should run. If it is set to "instant", the behavior runs once and doesn't carry over until the next cycle. If it is set to "continuous", there is a factor added to its score on the next Think Cycle that increases its score by 25% (as a default). Known as "decision momentum," this helps prevent "state strobing" where two (or more) similarly scoring behaviors keep switching back and forth between each other. Therefore, there would need to be a significant increase in one of the other behaviors to overcome that momentum and change the behavior.

Additionally, it changes how Behavior Histories are processed. An instant behavior registers that it is has been run when it is executed. A continuous behavior doesn't register that has been run until a new behavior is selected and takes its place.

When executing a behavior, all behaviors run both the Behavior Setup and Execute Action routines contained in the code for the Behavior Type. However, a continuous behavior will only run the Execute routine on subsequent calls while it continues to run.


It is stored as a simple enum, "DurationType" in the enums file.

	enum class DurationType
		Instant = 1,		// Used once and is over
		Continuous = 2		// Can continue over multiple think cycles


There is no editable data in the Data Tool for Duration Type. It is exported along with the other enums, however.