Decisions
In Utility Intelligence, each decision has:
- A list of Target Filters: They are used to filter targets for the decision.
- A list of Considerations: They are used to calculate the score of the decision.
- A list of Action Tasks: They will be executed by the egent if the decision is chosen.
Understanding how decisions work¶
Since a decision is scored per target, and any Utility Entity (all GameObjects with UtilityEntityController
or UtilityAgentController
attached) in the Utility World could be a target of the decision, we need a way to filter targets to ensure that only appropriate targets are considered. This is the job of Target Filters.
After finding appropriate targets, all Considerations of the decision will be evaluated for each target to calculate the score of each decision-target pair. Then the score of each pair is multiplied with the Decision weight to get the final score.
Finally, the best decision-target pair with the highest score will be chosen and the agent will execute all Action Tasks attached to the decision, either in Sequence or in Parallel.
Decisions are scored per target¶
A decision may or may not have targets. However:
- If it has targets, it will be scored per target. Afterward, Utility Intelligence will compare the scores of all the decision-target pairs with each other and select the pair with the highest score.
- If it does not have targets, it will be scored only once, and that score is the final score of the decision.
Oscillation between decision-target pairs¶
When using Utility AI, there may be a scenario where decision-target pairs with similar scores oscillate back and forth as their scores rise and fall. This leads to the agent constantly changing its decision and target. Currently, there are four ways to address this issue:
- Enable the Momentum Bonus option to add a bonus to the last chosen decision-target pair in the next decision-making round.
- This will prioritize the last decision-target pair over the others, thereby eliminating the oscillation.
- Increase the weight of the decision that you want to prioritize. For example, let’s say 2 or 3 instead of just 1.
- This will prioritize one decision over the others, reducing the oscillation.
- Enable Keep Running Until Finished option to prevent the agent from making a new decision while an important task is running.
- When the agent is performing an important task, such as AttackPlayer, ChargeHealth, ReloadAmmunition, and you don’t want it to be interrupted, you can enable this option to prevent the agent from switching to another decision while that task is running.
- Add more considerations to each decision.
- This will introduce more variation to the score-calculation process, increasing the chances that the competing decision will consistently win (or lose) and thereby reducing the oscillation.
Has No Target¶
A decision may or may not have targets. You can specify whether it has targets or not by checking/unchecking the HasNoTarget toggle in the Decision Tab:
- If the HasNoTarget toggle is checked:
- The target filter list will be hidden because it is no longer necessary.
- The decision will be considered as having no target, and will be scored only once without targets.
- If the HasNoTarget toggle is unchecked:
- If the target filter list is empty:
- All utility entities in the same utility world will be considered as targets for the decision, and the decision will be scored per target.
- If the target filter list is not empty:
- If the filtered targets > 0, the decision will be scored per target.
- If the filtered targets = 0, the decision score will be 0
- If the target filter list is empty:
Decision Weight¶
In Utility Intelligence, you can control the prioritization of each decision by adjusting its Decision Weight.
For example, you can organize your decisions into multiple layers like the following:
- Normal Layer’s Weight: 1.0
- Combat Layer’s Weight: 2.0
- Urgent Layer’s Weight: 3.0
The decision weight will then be multiplied by the decision score to get the final decision score:
You can change the weight of a decision in the Decision Tab:
Info
- The default value of Decision Weight is 1.0.
- You can adjust the weight of a decision to a value lower than 1.0 to decrease the priority of that decision.
Tip
- You can adjust the weight of decisions to reduce oscillation between nearly equal decision-target pairs.
Momentum Bonus¶
In Utility Intelligence, you can prioritize the last chosen decision-target pair in the next decision-making round by increasing the Momentum Bonus:
In the next decision-making round, the last chosen decision-target pair will be prioritized by multiplying its score by the Momentum Bonus, increasing its chances of winning and thereby reducing oscillation between nearly equal decision-target pairs.
Info
- The default value of Momentum Bonus is 1.1.
- You can adjust the Momentum Bonus to a value lower than 1.0 to decrease the priority of the last chosen decision-target pair.
Creating Decisions¶
To create a new decision, you need to go to the Intelligence Tab, fill in the Name field, and then click the Create button:
After creating a decision, you can add Considerations to the decision and observe how they affect the decision score. Additionally, you can add target filters and action tasks to the decision to determine which actions will be executed with its targets if the decision is selected at runtime.
Decision Statuses¶
At runtime, decisions have 4 statuses:
: Running
: Success
: Failed
: Inactive
At editor time, decision only have 2 statuses:
: Selected
: Unselected
If you like Utility Intelligence, please consider supporting it by leaving a 5-star review on the Asset Store.
Your positive feedback motivates me to keep improving and delivering more updates for this framework.
Thank you so much for your support. I love you all! 🥰

Created : September 1, 2024