Perform Interrupt in conjunction with Repeater Task

slipyfrog

New member
Hello Justin,

And thank you for you ongoing support with the Behaviour Designer product. I am curious if what I describe below is a bug or intended behaviour.

Here is a boiled down set up to illustrate the issue.
- Setup for the tree can be seen in the image
- The Repeater is set to repeat forever.
- Perform Interrupt is set to return success. (I don't think it matter thought).
- TestTask triggers a log in the OnStart and OnUpdate.

If it is helpful, Please see the following video for additional description:

Observed
It appears that tasks of the lower most sequence (at depth 5 of the tree) execute a second time after the Perform Interruption of that row is executed .

1. First pass of the tree reaches the PerformInterrupt
At this point test task and Wait both have executed once.
1658424276353.png

2. After the PerformInterrupt, the OnStart and OnUpdate methods of TestTask and Wait are invoked a second time (this can be observed below but also by log output of the TestTask)
1658424304055.png


3. The interrupt is honoured after this second pass and we arrive at the Idle.
1658424056409.png



The issue is observed in both 1.71 and 1.72 in Unity 2021.3.X.


Thanks again for your help and have a great day.

W
 
Last edited:

slipyfrog

New member
Some more notes.

1. I use the PerformInterrupt/Interrupt over Conditional aborts as this ensure the tree doesn't interrupt mid execution of the tree. All nodes at depth 5 are run before the interrupt is performed. Conditional aborts allow for the tree to be aborted mid sequence.



2. Placing a task that keeps 'Running' after the interrupt results in row not being reevaluated after the PerformInterrupt is executed.


1658432123767.png
 

Justin

Administrator
Staff member
Can you attach the scene that you are using to test this so I can take a closer look and step through the tasks? Thank you!
 

slipyfrog

New member
Hi Justin,

Please see attached link for the sample project with in the SampleScene scene:
<link>

The project contains three examples that illustrate issues with the Interrupt/PerformInterrupt. You can see observer and expected results in each of the description fields inside the each GameObject example. I've attached here for convince.

Just to be sure, I tripped checked my project to make sure the Behaviour Designer code was from a clean import and did not have any changes.

If it matters I've also enabled 'Player Options' in the Project Settings to disable domain and scene reloads.

Thanks for looking into this and for the continued support on this product. Also, I hope the issue is not something simple I over looked on my end.



Example Test 1: In this example, TestTask (A) and Wait (B) are run a second time after the Perform Interrupt (C) is invoked.

1658978580610.png



Example Test 2:
Here, (X) inovkes after (C). (X) is invoked and interutted before (D) executes
Expected (X) should probalby not be invoked at all.

1658978603343.png



Example Test 3:
In this example, Wait (B) is interrupted before it can complete when (D) is invoked. (C) is never executed despite Interrupt Success being set to true on (D).
Expected: (A) return scuccess when (D) is invoked, (B) invokes and after 20 second (C) is invoked.

1658978626467.png
 
Last edited:

Justin

Administrator
Staff member
Thanks. I've edited your post to not include the Google Drive link as it contains Behavior Designer itself when not everyone who reads these forums have a license to Behavior Designer.

But I was able to determine the cause and it relates to the execution order. The interruption isn't actually performed until the next tick and because you have enabled "Instant" on the Perform Interruption task it doesn't give the interruption a chance to execute. The solution is to just disable "Instant" on the Perform Interruption task and everything will work correctly.
 

slipyfrog

New member
Oh I’m so sorry. That was super bad. I should have thought about removing the imported folder before archiving.

The folder and archive project have been deleted from the Google drive.

Thanks for looking into the issue and sending over the suggestion. It’s much appreciated!
 
Last edited:
Top