[Behaviour Desiner Pro]DOTS performance issue

laughman

New member
I made a very simple tree like this. And I found that the do while loop in
TraversalSystemGroup
is evaluating my SenseTarget system multiple times at a single frame and that is unnecessary and very much costly. So I just commented it out and I gained lots of performance improvement.
// do
// {
base.OnUpdate();
var determineEvaluationSystem = EntityManager.WorldUnmanaged.GetUnsafeSystemRef<DetermineEvaluationSystem>(m_DetermineEvaluationSystemHandle);
determineEvaluationSystem.Complete(EntityManager);
evaluate = determineEvaluationSystem.Evaluate;
var evaluationSystem = EntityManager.WorldUnmanaged.GetUnsafeSystemRef<EvaluationSystem>(m_EvaluationSystemHandle);
evaluationSystem.Complete(EntityManager);
#if UNITY_EDITOR
if (evaluate)
{
count++;
if (count == ushort.MaxValue / 10)
{
UnityEngine.Debug.LogWarning("An infinite loop would have been caused by the TraversalSystemGroup. Please email support@opsive.com with steps to reproduce this error.");
//break;
}
}
#endif
//} while (evaluate);1740894270362.png1740894315021.png
 

Attachments

On the Behavior Tree component you can specify the maximum number of executions. This will in essence do something similar to your script commenting.

Thanks for the template tasks! Once bugfixing settles I'll include something similar.
 
On the Behavior Tree component you can specify the maximum number of executions. This will in essence do something similar to your script commenting.

Thanks for the template tasks! Once bugfixing settles I'll include something similar.
Thanks for your support. I thought this option only executes a fixed number of tasks but actually it runs the tree.
 
When the execution count has been reached it will then disable the evaluate bool. This will then stop that tree from running that tick. So it's a bit different from just commenting out code within the system but it'll achieve similar results.
 
Back
Top