Reply To: Turn-based logic best practices?

NodeCanvas Forums General Discussion Turn-based logic best practices? Reply To: Turn-based logic best practices?

#13965
gtranger
Participant

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:

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.