Tactical + Surround: The requested operation caused a stack overflow.

nantoaqui

New member
Hello,

The following diagram is causing:

C#:
StackOverflowException: The requested operation caused a stack overflow.
UnityEngine.Object.CompareBaseObjects (UnityEngine.Object lhs, UnityEngine.Object rhs) <0x2cd27d987b0 + 0x0000b> in <31d5d65b32ec483292e13e8ae4100b93>:0
UnityEngine.Object.op_Equality (UnityEngine.Object x, UnityEngine.Object y) (at <31d5d65b32ec483292e13e8ae4100b93>:0)
BehaviorDesigner.Runtime.Tactical.Tasks.TacticalGroup.AddAgentToGroup (BehaviorDesigner.Runtime.Behavior agent, System.Int32 index) (at Assets/Behavior Designer Tactical/Scripts/TacticalGroup.cs:194)
BehaviorDesigner.Runtime.Tactical.Tasks.NavMeshTacticalGroup.AddAgentToGroup (BehaviorDesigner.Runtime.Behavior agent, System.Int32 index) (at Assets/Behavior Designer Tactical/Scripts/Tasks/NavMeshTacticalGroup.cs:113)
BehaviorDesigner.Runtime.Tactical.Tasks.Surround.AddAgentToGroup (BehaviorDesigner.Runtime.Behavior agent, System.Int32 index) (at Assets/Behavior Designer Tactical/Scripts/Tasks/Surround.cs:29)
BehaviorDesigner.Runtime.Behavior.SendEvent[T,U] (System.String name, T arg1, U arg2) (at <843968489f854a31bdd9270d59c9c087>:0)
BehaviorDesigner.Runtime.Tactical.Tasks.TacticalGroup.AddAgentToGroup (BehaviorDesigner.Runtime.Behavior agent, System.Int32 index) (at Assets/Behavior Designer Tactical/Scripts/TacticalGroup.cs:202)

bug.png

The code is:

Code:
                for (int i = 0; i < formationTrees.Count; ++i) {
                    agent.SendEvent("AddAgentToGroup", formationTrees[i], i);
                }

Works fine without Sequence node.

Thank you!
 
Hi @Justin,

1- Open Behavior Designer Tactical scene;
2- Leave only 2 Agents game object with a single behavior tree component attached each of them;
3- Use the node structure from screen shot above Entry -> Sequence -> Surround | Attack | Wait

From what i understood it crashes just by doing Entry -> Sequence -> Surround instead of Entry -> Surround
 
Unfortunately I am not able to reproduce the error. What leaders have you specified?
 
Hi Justin!


I've attached 4 screenshots showing my setup.

Let me know if it helps.
 

Attachments

  • 1.zip
    561.9 KB · Views: 2
Thank you. Your settings look correct but here is the scene that I am using to test it. Maybe you can compare the difference with your scene?
 

Attachments

  • SurroundTest.unity
    101.5 KB · Views: 0
Top