Game host build freezing randomly (but very often) (losing my mind!) with PUN

I've spent a week banging my head trying to figure out what the problem is. Every time I thought I isolated it to particular code and fixed it, it would freeze. This led me to believe it was something overall with Photon/PUN.

Here is a video example:
https://screencast-o-matic.com/watch/cFhZoKbmKF

What happens:
I run two client executables of the game. One client creates the room, the other client joins it.


The first two times I do this, it runs perfectly. Each time I exit out of the builds.


The third time, the client that created the room locks up and crashes the build.


There is no flow for reproduction. Sometimes its the second time I run the build. Sometimes the first. Sometimes the third. But at some point, the creator build always locks up. Same thing happens whether I'm in the Unity editor or a compiled build. I can barely even playtest my game because the Unity editor freezes constantly.

I tried a Disconnect() when the Application quits, in case it was some cleanup issue, but that doesn't help.

Build with: Unity 2017.3.1f1
PUN version: 1.90 (currently using the Free version from the Asset Store until I release the game)

Link to download the compiled build if that helps:
https://drive.google.com/file/d/1b3gYdFBizq_JmsfcUcfPtjNGnw-JxdJC/view?usp=sharing

Help would be greatly appreciated! I'm not sure what is left for me to do to try and debug this.

Comments

  • Hi @Mekjal,

    thanks for sharing screenshots, the video and the build. I have taken a look at the built version and for me the crash happens on the first time when a second client joined the game. Sadly, I can't give you any further information, but maybe a hint how you can take a closer look at the problem yourself. I have noticed that the built version is not a development build. So the first thing you can do is to enable the Development Build option in the build settings and rebuild the project. Then run your tests with the new build again until the crashes occur again. Afterwards you can check the log file(s) the game has created. You can find them in C:\Users\user name\AppData\LocalLow\M7 PRODUCTION\The Division kit 1.8 if you don't change any of the Player Settings. There will be an output_log.txt file which you can check for warnings and errors. There is also a Crashes folder, which you can check. I guess Development Builds will put something there.

    If you can find the error, please let us know. If you can't find it, please let us also know and maybe post important parts of the log file here.