Previous: Turret Action, Up: AI [Contents][Index]
Utility Module is a decision-making machine which compares your Directive’s Utility Graphs and activates Behavior Sequencer components to orchestrate complex behavior. The graphs are compared at their current Valence (X axis) to get their Utility (Y axis). It’s most common use is for AI units, but it can make decisions for a variety of systems in your game. It chooses the Directive with the currently highest Utility. To use, add a Utility Module and at least one Behavior Sequencer component. Next, specify multiple Directives which the Utility Module can choose from. Then, create a Utility Graph which represents the level of desire from low desire on the left to high desire on the right. The Valence tells Utility Module what point on the graph we are currently on. The Valence has a Change Per Sec which allows the graph to change over time automatically.
string
uniqueIdentifierA unique string wich identifies this particular Utility Module from all others. Used for serialization only
string
personalityNameThe name of this personality that will be displayed to the player
Rect
guiAreaNormalized viewport rectangle which controls the part of the screen which is taken up by the GUI box for this Utility AI. Numbers are a percentage of screen coordinates. Only applies to immediate mode GUI
Default value: new Rect(.3f, .3f, .3f, .3f)
InputField
nameDisplayIf we’re using UGUI (as opposed to immediate mode) assign this to display the name of the personality for this AI
Applies the ’Satisfaction Value’ of the given directive so that the valence of that directive can change
Argument: The name of the directive we wish to satisfy. This moves the current X position on the Utility Graph ( Valence = Satisfaction Value + Valence). To satisfy completely, set Satsifaction Value to -1. To max out the graph, set Satsifaction Value to + 1.
Causes the Utility AI to fail a given directive, allowing it to re-evaluate it’s directives and optionally start a sequence resultant from that failure.
Argument: The name of the Directive we wish to fail.
Causes the AI to start the failure sequence associated with the currently active directive, if any, and choose another directive if possible
Sets one of the Directives to be selected, so that SatisfySelected knows which Directive to satisfy
Argument: The Name of the Directive we wish to select.
Satisfy the Directive we selected by a specific amount. This is added to the Valence, which is a number between 0 and 1 indicating the current X position on the Utility Graph for the selected Directive. Select a Directive by sending the SelectDirective message
Argument: How much should we add to the Valence? Negative numbers satisfy.
Causes the AI to re-evaluate it’s directives and immediately initiate a Behavior Sequencer, even if that sequence is already running.
Saves the current state of this Utility Module based on it’s unique identifier
Loads the previous state of the Utilitymodule based on it’s unique identifier
Finds an unused random number and uses it as the new Unique Identifier for this Utility Module
Assigns a new Unique Identifier to this Utility Module
Argument: The new Unique Identifier that you wish to use for this Utility Module.
Assigns a new Personality Name to this Utility AI, which can be displayed as part of the AI’s
Opens the IMGUI for this AI
Closes the IMGUI for this AI
Toggles the IMGUI for this AI
string
uniqueIdentifierA unique string wich identifies this particular Utility Module from all others. Used for serialization only
string
personalityNameThe name of this personality that will be displayed to the player
Rect
guiAreaNormalized viewport rectangle which controls the part of the screen which is taken up by the GUI box for this Utility AI. Numbers are a percentage of screen coordinates. Only applies to immediate mode GUI
Default value: new Rect(.3f, .3f, .3f, .3f)
InputField
nameDisplayIf we’re using UGUI (as opposed to immediate mode) assign this to display the name of the personality for this AI
Applies the ’Satisfaction Value’ of the given directive so that the valence of that directive can change
Argument: The name of the directive we wish to satisfy. This moves the current X position on the Utility Graph ( Valence = Satisfaction Value + Valence). To satisfy completely, set Satsifaction Value to -1. To max out the graph, set Satsifaction Value to + 1.
Causes the Utility AI to fail a given directive, allowing it to re-evaluate it’s directives and optionally start a sequence resultant from that failure.
Argument: The name of the Directive we wish to fail.
Causes the AI to start the failure sequence associated with the currently active directive, if any, and choose another directive if possible
Sets one of the Directives to be selected, so that SatisfySelected knows which Directive to satisfy
Argument: The Name of the Directive we wish to select.
Satisfy the Directive we selected by a specific amount. This is added to the Valence, which is a number between 0 and 1 indicating the current X position on the Utility Graph for the selected Directive. Select a Directive by sending the SelectDirective message
Argument: How much should we add to the Valence? Negative numbers satisfy.
Causes the AI to re-evaluate it’s directives and immediately initiate a Behavior Sequencer, even if that sequence is already running.
Saves the current state of this Utility Module based on it’s unique identifier
Loads the previous state of the Utilitymodule based on it’s unique identifier
Finds an unused random number and uses it as the new Unique Identifier for this Utility Module
Assigns a new Unique Identifier to this Utility Module
Argument: The new Unique Identifier that you wish to use for this Utility Module.
Assigns a new Personality Name to this Utility AI, which can be displayed as part of the AI’s
Opens the IMGUI for this AI
Closes the IMGUI for this AI
Toggles the IMGUI for this AI
Previous: Turret Action, Up: AI [Contents][Index]