Hey all,
A big change is coming to Behavior. As some of you have noticed, nodes often have their Update()
call deferred to the next frame. This upcoming change will remove this behavior and ensure all nodes run on the same frame when they should.
Note that this means your entire graph can run in a single frame if none of its nodes return Status.Running
on their Update
and and finishes its operation entirely. This could potentially cause infinite loops. To mitigate that, we added 2 things:
- A safety check that if your graph is ticking for over a second, we’ll abort operation and give you an error telling you there might be an infinite loop or an extremely expensive operation.
- We’ve added a
WaitFramesAction
which will wait until the chosen number of frames have elapsed. This allows you to add yields in graphs that you expect to execute entirely.
This change brings a big improvement in graph execution and addresses an issue multiple users asked for. As you may expect, this also brings a bit of risk. I’ve tested this quite thoroughly during the work on the PR and worked on our automated testing quite a bit, so I am hopeful this should land smoothly. That said, I apologise in advance if anything has slipped our testing.
We (the Behavior team, not the Royal Me) are hopeful we can release this change in 1.0.8 tomorrow or the day after, but this all depends on our QA process. It could be that this will be delayed for 1.0.9 (hopefully in 2 weeks time).
As always, we welcome your feedback and are hopeful we’re moving in the right direction to deliver an excellent package for you that will bring you utility and use and make using Unity easier and more fun. Please keep the feedback coming!
Thanks,
~ The Behavior Team.