Behaviors
Last updated
Last updated
Universal Monster uses 3 sets of behaviors, Routine, Stimuli, and Combat. By default, all AI will start out using their Routine Behavior, then, when a new target is successfully perceived, the AI will switch to their Stimuli Behavior. From the Stimuli Behavior the AI can choose to enter combat to begin using their Combat Behavior. Having 3 sets of behaviors allows for the most realism by enabling the AI to act differently depending on what is currently stimulating them.
Data Table Row: You can store your Behaviors in a data table. Tasks: Array of tasks used to determine what the AI should do during this behavior. Override Current Behavior?: Should this Behavior override the current behavior?
Routine Behaviors are utilized when the AI has no Current Target, which also means they are not set as In Combat. Think of this behavior as the AI's daily life. The default behavior is to simply wander around within a set range based on the AI's initial spawn location. You can definitely extend this to make the AI follow a spline path or move in formation within a group. There is a task that allows you to have the AI search for any actor class, which you can then have it run a custom event/function to do whatever needs to be done with the actor(s) that are found. For example, search for friends and join their group if it exists or start a new group and include all the found actors. Or maybe you need to find a new spline path so the AI can follow it to their next location. Maybe you just want them to find a food or water source so they can simply survive.
Stimuli Behaviors only occur when a new Current Target is set based on the Stimulus Conditions that are configured in the Stimuli Array. Default Stimuli include seeing/hearing an enemy, being hit by an enemy, and being hit by a friend. Depending on which Stimuli is triggered, you can configure different Stimuli Behaviors to be triggered. Want your AI to attack everything it encounters? Universal Monster can do that. Want your AI to flee from everything? UM handles that too. Want your AI to be much smarter? Maybe you only need your AI to attack enemies under 50% health or flee when the AI has low health. You can setup a behavior to have your AI flee until they find some friends and then proceed to attack in a group. If you can think of it, then Universal Monster can do it. A bit of creativity is needed, but the basic tasks are all ready for you to use in any way you see fit.
Data Table Row: You can store your Stimuli in a data table. Stimulus Tags: The tag associated with the Perception Stimulus. "None" is used for sight and all other tags are used in conjunction with the Make Noise function. Stimulus Conditions: See Conditions link below for more information. Self Conditions: See Conditions link below for more information. Target Conditions: See Conditions link below for more information. Faction States: The faction reputation states allowed to trigger this Stimuli. See Faction System for more information. Result: See Tasks link below, then scroll to the Task Results section for more information.
Combat Behaviors are used only when the AI has a Current Target and is set as In Combat. These behaviors define how you want your AI to act when they are in battle. Does your AI need to just charge their enemy and attack them without thinking? That is the default Combat Behavior which would be suitable for most AI. Do you need your AI to be more intelligent? Universal Monster has many conditions you can test for to allow your AI to read any situation. You can test if your AI is in front of, to the side of, or behind their Current Target, allowing them to flank the enemy. You can test if the enemy is about to attack so your AI can block or dodge. Maybe your AI needs to flee for a few seconds because they are low on health, but you don't want them to flee permanently because they know healing magic. Your Attacks Array would already be configured to know to use a healing spell when low on health, so this particular flee task would then trigger the attack task which will then cast the healing spell.