Creating Decisions is as easy as creating a decision function, and referencing it with your AI. Reference back to the Designing AI page if you need help designing your decisions.
Let’s get started!
Decision Function
Decision functions have a few pieces to them.
Score Input – The Score Input allows you to custom define a score for the decision. Most commonly, this is used as the score when the decision wants to score high.
Score Output – The Score Output is what will be processed by your AI to determine what Behaviour, Goal, and Plan should be running. The highest score of all B/G/P’s will be chosen.
- Navigate to the desired AI controller. You’ll also want to open up the parent AI controller for the subsystem, where you’ll find template decisions for a Behaviour, Goal, and Plan.
- Use the template to create your own decision in the Parent or Child AI Controller.
- (optional) Use the input to allow you to change what score is returned when the decision has high probability
- Provide the Score Output, which includes a score and the name of the B/G/P for the Decision.
- That’s it!
Remember you can change the score of a decision in runtime by checking outside factors, aka Influence as mentioned in the Designing AI page.
Decision Reference
When you’ve created all your decision functions, you’ll need to make sure your AI is using them by adding them to the “Retrieve Behaviour/Goal/Plan Decisions” function in your child AI controller. It’s as simple as making an array of all Behaviour, Goal, or Plan decisions, then providing it to the function return.
When you’re done, each “Retrieve” function will look similar to this, containing all the B/G/P decisions for your AI. Use the Score input to determine
Once you’ve placed your functions, make sure to assign a “Score” value to each of the decisions. Decisions that are higher priority should score higher
Now that you’ve created your decisions, the last step is to create the Action for your AI!
Once you’ve completed your Decisions, the last step is implementing Actions. You can learn more about Action on the Action page here.
Check out the Designing AI page to get more information on how Behaviour, Decision, and Action work as a whole.