Stackoverflow exception Tools.GameObjectHardFind

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Ders
Posts: 18
Joined: Thu Mar 10, 2016 3:53 am

Stackoverflow exception Tools.GameObjectHardFind

Post by Ders »

After I call DialogueManager.StartConversation("name_conversation") I get the following error:

Code: Select all

StackOverflowException
PixelCrushers.DialogueSystem.Tools.GameObjectHardFind (UnityEngine.GameObject item, System.String str, Int32 index)
PixelCrushers.DialogueSystem.Tools.GameObjectHardFind (UnityEngine.GameObject item, System.String str, Int32 index)
PixelCrushers.DialogueSystem.Tools.GameObjectHardFind (UnityEngine.GameObject item, System.String str, Int32 index)
PixelCrushers.DialogueSystem.Tools.GameObjectHardFind (UnityEngine.GameObject item, System.String str, Int32 index)
PixelCrushers.DialogueSystem.Tools.GameObjectHardFind (UnityEngine.GameObject item, System.String str, Int32 index)
*goes on forever*
For some reason this does not seem to happen on all pc's I've tested on. So far it only happened on 2 out of 4 (windows 7 and windows 10 if that matters).
I tried redownloading the repository I'm working on because it is perfectly working for my collegue and I still get this error.

The conversation I want to start is just a regular conversation with no special scripts or anything going on. (I also switched out the conversation with another one and I get the same problem). On the 4 laptop I tested on (Windows 7 x64, clean install) it worked once when I downloaded the project to a new folder, so completely clean, but when I restarted the game (and Unity) it crashes again.

Is there anything I can do to prevent this issue, or what could be the problem I'm facing here? I checked the method in the code and it should return null when the object it's trying to find is not in the scene but that does not seem to happen.
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Re: Stackoverflow exception Tools.GameObjectHardFind

Post by Tony Li »

I'm looking into this right now. I'll reply back as soon as I have more info.
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Re: Stackoverflow exception Tools.GameObjectHardFind

Post by Tony Li »

Hi,

Sorry in advance to bombard you with questions. This issue has my full attention.

What version of Unity are you using?

What version of the Dialogue System?

Does the problem occur in any of the Dialogue System's example scenes?

If there a difference in editor OS that causes the problem to occur? (e.g., Windows vs. Mac)

Is there a different in build target that causes the problem to occur? (e.g., WebGL vs. Xbox)

What's your Dialogue Manager's Display Settings > Camera Settings > Default Sequence?

Can you please set the Dialogue Manager's Debug Level to Info, reproduce the problem, and send me the log file?

Would it be possible for you to send a reproduction project or reproduction steps to tony (at) pixelcrushers.com? I understand it's a 50/50 shot of reproducing the issue on my boxes, but it's better than nothing. :-)

Here's a link to your support case and [EDIT: put patch package on customer download page].
Ders
Posts: 18
Joined: Thu Mar 10, 2016 3:53 am

Re: Stackoverflow exception Tools.GameObjectHardFind

Post by Ders »

Hi Tony,

No problem, I'm glad to help :)

First of all, I want you to know that I seemed to have fixed the problem. We have a manager that handles states in our game based on a list of gameobject who handle a "chapter" in the game. So, our "Chapter Manager" has this list, and when I started my scene it only had 2 in there (out of the 4 we need) so I changed the list size from 2 to 4 and rearranged the objects as was needed.
Now, the fix was to set the list to 0 size so that it is cleared, then set the size to 4 and add the objects again.

To answer your questions (maybe this is still a problem in the DialogueSystem you can fix).

- We are using 5.3.4p3 Unity
- version 1.5.9 (we are using the DLL's not the source code)
- Haven't tested
- Editor OS's we tested on are one Windows 7, two Windows 10 and one Osx El Capitan
- Build targets are all set to PC, Mac and Linux Standalone
- The Sequence setting is: Delay({{end}}) (I don't think we've touched this)
- The logs stop after it said it's starting the conversation with actor and conversator set to null

If you still want a reproduction of this problem; let me know and I can send it to you but it'll take some time (I can't just start sending the whole project)
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Re: Stackoverflow exception Tools.GameObjectHardFind

Post by Tony Li »

Hi,

No need for a reproduction unless it you happen to have one handy at some point.

I put a patch on the customer download site and sent you a PM with your access info. This patch adds a configurable recursion limit to Tools.GameObjectHardFind() to prevent stack overflows. The default is 256 levels of recursion. You can change it by setting Tools.maxHardFindRecursion.

Since GameObjectHardFind just traverses the scene graph, I suspect one of the GameObjects in your scene somehow got into a state where a child was pointing to a parent. In any case, the patch above should at least prevent the stack overflows.

If I can help any more with this issue, just let me know.
Ders
Posts: 18
Joined: Thu Mar 10, 2016 3:53 am

Re: Stackoverflow exception Tools.GameObjectHardFind

Post by Ders »

Hmm, I pushed the working scene from this weekend to my desktop and it's still the same error there (Laptop is still doing fine). I'm going to upgrade the DialogueSystem to the new version you gave me access to. I might also try going with the source code so I can set some breakpoints and let you know exactly where it's going wrong (or on which object)
User avatar
Tony Li
Posts: 22098
Joined: Thu Jul 18, 2013 1:27 pm

Re: Stackoverflow exception Tools.GameObjectHardFind

Post by Tony Li »

Sounds good. I'm glad the Dialogue System update seems to have worked as a fix/workaround. If you dig into the source code, I suggest doing it in a separate project or branch since you'll have to update your scenes' and prefabs' references to Dialogue System components. In version 2.0 of the Dialogue System (tentative release date end of summer), you'll be able to switch between DLLs and raw scripts without having to do anything special.
Post Reply