Thursday, November 7, 2013

External program crashing unity

We have been investigating a problem where our open source audio engine (Pure Data) fails to start correctly, and unity entirely crashes (not the editor). Once PD has failed to load correctly, starting vinyl will only result in a crash. So we are working on getting our game playable on more computers.
For a lot of computers manually killing PD in the task manager and then restarting vinyl will make the game work. If we fail to connect with PD we kill it, starting vinyl when PD is broken doesn't kill it though. So we believed that we were unable to end the process.
However running the kill command (Process.kill() in C#) does seem to work. So now we believe unity is crashing before it gets to the point where it kills PD and tries to restart it.

There is code that could cause an exception early in the initialization process. The biggest thing we are wondering about is why Unity would entirely crash if anything there went wrong. For most of unity if an unhanded exception is raised it will just stop the thread and continue the rest of the game. However for some reason an error in the initialization of PD is cause the entire system to crash.
So we are going to look at making the code safer (try catch blocks) and hopefully we can make it more recoverable from an error.

1 comment: