These are exceptions being thrown from custom tasks and would qualify as bugs. Ideally, yes, exceptions should not happen during correct execution of a program. However, even under the strictest QA testing some bugs will inevitably slip through. In the event of an exception being thrown during Behaviour Tree execution, it is not acceptable for an AI to stop working on subsequent calls to StartBehaviour. Consider the following scenario:
1
2
3
4
5
6
An AI agent selects its target at the beginning ofaturn.
The target the agent selected dies before the AI can attack.
The AI goes to attack.The code does not expect the target to be nullat thispoint and does not check forit.
ANullPointerException gets thrown.
The next turn comes and it's the AI agent'sturn to execute.
StartBehaviour gets called and nothing happens.
The fix would be to either have a null check or to change the targeting logic. However, as ridiculous as it may seem, let’s say that this bug was not caught in QA testing. This bug made it to a build and now players are encountering it. Now whenever this bug occurs, this agent will no longer do anything on subsequent turns because it was not able to recover from the exception. An exception occurring in a previous turn should not impact the ability of the agent to function during future turns and therefore the agent should have some way of recovering from this exception.
As silly as this example is, I hope it illustrates my point.
Login
Register
By registering on this website you agree to our Privacy Policy.