When an Utility Board is executed it starts by gathering all Task and Sub Graph nodes.
It then gets their different Value values and applies them to their corresponding Need Curve, which returns a value constrained between the Minimum and Maximum value defined in the Utility Board asset.
Once their Score value is calculated, it compares all values and picks the one with the highest score and starts running it.
Wait to finish
An Utility Board will not recalculate a new need node unless the one currently being executed finishes. This means that when a need task cannot be completed, it should either early exit or abort itself.
When entering Play-Mode and selecting an agent that has a Processor component will display real-time information about the current execution. In the screenshot above the title of each node shows the resulting value of applying the Value onto the Curve:
- Go Home has a value of 0.072
- Drink has a value of 6.48
- Dance has a value of 9.856
Thus the node chosen to execute the AI system is Dance because has the highest score value.