Search Unity

Photon Unity Networking

Discussion in 'Multiplayer' started by tobiass, Aug 23, 2011.

  1. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    Fusion should not require the definitions via Editor, no.
    When there is a public beta (no ETA yet), we should figure out how nice it plays with your personal framework.
     
  2. miracletechteam1

    miracletechteam1

    Joined:
    Sep 18, 2019
    Posts:
    15
    Hi Tobiass, is there any link to get Old PUN?
     
  3. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    No, we don't distribute old versions. If you want to let us know about your case, mail us: developer@exitgames.com.
     
  4. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    RPCs are not serialized to only consist of a byte[], so at the moment, ByteArraySlice can't be used for them.
    Use RaiseEvent, send only a byte[] as content and enable the usage of ByteArraySlice, so the receiver will also use it. This is currently the best option.
     
  6. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    Ok, can you tell me if you are thinking about adding support for this in future?
     
  7. exltus

    exltus

    Joined:
    Oct 10, 2015
    Posts:
    58
    And what about OnSerializeView - is somehow possible to avoid allocations?
     
  8. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    At the moment, this is not possible or planned, sorry.
     
  9. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    We just released a new version of PUN 2. The big change is an overhaul of the PhotonView.ViewID assignment, Owner and Controller caching. Let us know if this causes issues in any projects.

    v2.28 (23. February 2021)
    Changed: PhotonView code to cache Owner and Controller, as well as storing the sceneViewId for objects which load with the scene. This is a bigger change and complex, so it may break some projects, despite the testing! Mail us, if you run into issues with ViewIDs, Ownership, etc: developer@photonengine.com.
    Added: DisconnectCause DnsExceptionOnConnect and ServerAddressInvalid (which might be renamed).
    Changed: Inspector to trim the values of AppId fields.
    Fixed: Likely fixes issue with Resources.Load failing to find prefabs in latest Unity versions. This is more of a workaround for Unity problems/changes.
    Changed: The re-usable list of PhotonViews in RemoveInstantiatedGO() is now cleared when it's no longer needed to avoid lingering PhotonView references (memory leaking).
    Added: OfflineMode to StaticReset(). So fast play mode (without domain reload) will not keep the client in offline mode.
    Changed: PhotonNetwork.Server for offline mode. It will now report the GameServer when an offlineroom is existing.
    Added: In OfflineMode, PhotonNetwork.LeaveRoom() will now also call the OnConnectedToMaster() callback. As the OfflineMode changes values immediately, the timing of callbacks might be slightly different than in online mode. Joining a room offline is instantaneous.
    Updated: Library to v4.1.5.0. which includes using the new Native Encryptor API (v2), a fix for NonAllocDictionary.Remove() and new StatusCode entries for DNS and IP issues.
     
  10. Lesha-VH

    Lesha-VH

    Joined:
    Jul 3, 2012
    Posts:
    90
    Hello, Tobiass!

    I would like to run dedicated server application for realtime multiplayer game (console unity executable for windows) in Photon Cloud.
    Is it possible or only way is to run self-hosted photon server?
     
  11. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    You want to run an instance per Photon room?
    It's not possible to host Unity (headless) instances in the Photon Cloud. Multiplay would be a suitable service for that.
     
  12. Lesha-VH

    Lesha-VH

    Joined:
    Jul 3, 2012
    Posts:
    90
    Yes, I want run 1 instance of console application per room. Instance will be authoritative server - all others just clients.

    What do you mean under "Multiplay service"?
    I did not find in "https://dashboard.photonengine.com/en-US/" anything about running executable instances in the Photon Cloud.

    Could you please give me link to read about how to upload and run console application (that acts as dedicated server) in Photon Cloud?

    I can done it via self-hosted Photon Server, but this is not an option for scale and low-ping (I need servers in each region).

    Thank you!
     
  13. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    We do not run executables in the Photon Cloud. Unity Multiplay does.
     
  14. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    There is a known issue in PUN 2.28 and 2.281. in which scene objects won't always initialize their ViewID, Owner, etc before OnEnable() is called on some other scripts on the same object.

    The workaround is to set a negative value for Photon.Pun.PhotonView in the Script Execution Order!

    We will work on a better solution.
     
    Munchy2007 likes this.
  15. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    We released updates to fix a few annoyances.
    Here are the changes:

    v2.28.3 (03. March 2021)
    Fixed: PhotonView.AmOwner was not updated.

    v2.28.2 (03. March 2021)
    Fixed: A potential issue with the execution order of the PhotonView component. It now sets it's own execution order to -16000 to get initialized before other scripts (especially on scene loading).
    Changed: Conditionals and logging output for Xbox builds. In the Editor, it's impossible to get a token, so PUN should not enforce this.
    Changed: PhotonView.ControllerActorNr will make sure the PhotonNetwork.LocalPlayer is not null when accessing the actorNumber through that.
    Changed: Instantiate will set PhotonView lastOnSerializeDataSent and lastOnSerializeDataReceived to null (which keeps instantiation for reused objects cleaner).
     
    Last edited: Mar 3, 2021
  16. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    We updated PUN 2 in the Asset Store. Now, development and upload happens in 2018.4.22!

    If you update a project that runs on Scripting Runtime Version ".Net 3.5", please set it to .Net .Net 4.x as we use .Net Standard 2.0 dlls by default now. Alternatively use the PhotonLibs\Photon3Unity3d.dll via the inspector settings.

    v2.29 (15. March 2021)
    Updated: Minimum supported Unity version to 2018.4.x. We develop PUN 2 in Unity 2018.4.22 from now on. Also the language compatibility level '.Net 4.x' or '.Net Standard 2.0' is now expected.
    Updated: Export settings for the dlls in Assets\PhotonLibs. All platforms will use .Net Standard 2.0, except the UWP export with .Net Runtime (which uses Metro with a placeholder being the lib in PhotonLibs\).
    Removed: Setting of protocol 1.6 when connecting directly to a Master Server. This was a workaround for older Photon Server SDKs.
    Note: If you host Photon yourself, you can set the LoadBalancingClient.SerializationProtocol to SerializationProtocol.GpBinaryV16, before you connect.
    Fixed: The PhotonView's "Find" button was not saving the observed components in scenes, which meant the script wasn't called at runtime.
    Added: IPunOwnershipCallbacks.OnOwnershipTransferFailed. This helps react when an Ownership Transfer request failed (due to earlier changes). This might mean you have to implement OnOwnershipTransferFailed in some scripts.
    Changed: PhotonView OwnerActorNr and ControllerActorNr to make use of the new Room.GetPlayer() option (to get the Master Client instance if the owner/controller is set to 0).
    Updated: Library to 4.1.5.2.
     
    Last edited: Mar 29, 2021
  17. MrBlueSky

    MrBlueSky

    Joined:
    Jan 7, 2013
    Posts:
    20
    Hello,

    I just switched a copy of one of my projects to Unity 2020.3.2f1 and updated to the latest version of PUN2, and now I have a NullReferenceException on NetworkingClient.AddCallbackTarget(target) in the PhotonNetworkPart.cs.

    NullReferenceException: Object reference not set to an instance of an object
    Photon.Pun.PhotonNetwork.AddCallbackTarget (System.Object target) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:109)
    Photon.Pun.MonoBehaviourPunCallbacks.OnEnable () (at Assets/Photon/PhotonUnityNetworking/Code/PunClasses.cs:111)

    I use Unity RuntimeInitializeOnLoadMethod with RuntimeInitializeLoadType.BeforeSceneLoad to instantiate my managers that are both derived from MonoBehaviourPunCallbacks.
    If I use RuntimeInitializeLoadType.AfterSceneLoad, it is working fine.
    I don't have the error with Unity 2020.1.17f1.
     
  18. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    PUN 2 also uses RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad), so this is a race condition and you probably were lucky to not have the issue before.

    Registration for callbacks is only possible after PUN 2 was initialized.
    Can you add your managers to the initial scene and have them initialized with the rest of the code?
     
  19. MrBlueSky

    MrBlueSky

    Joined:
    Jan 7, 2013
    Posts:
    20
    Of course I can use AfterSceneLoad but is there not a way to solve this with execution order ?
     
  20. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    I don't know if execution order also applies to this attribute. You'd have to figure out.
     
  21. somosky

    somosky

    Joined:
    Feb 15, 2014
    Posts:
    138
    @tobiass Hi so I'm using Opsive's Ultimate Character Controller and running into this issue.

    So I've used UCC and the Pun 2 addon before and have never had this issue.

    First of all the demo scene works fine. So there's certainly nothing wrong with the asset in general.

    However I've created several different characters to test this out with and they all give the same error message.

    "Changing a ViewID while it's in use is not possible (except setting it to 0(not being used)."

    I've created the characters in the normal way to set up characters. Then I have added them to the addon screen and set them up for pun. Then created them as prefabs and set them into the pun game object to be instantiated. However I get this error message every time. Even if I bring my character into the demo scene and add it into the pun game object it still doesn't work.

    It seems to be a issue of the characters photon view not changing when it is instatiated. For example in the prefab screen the photon view says "Set at Runtime" however if I drag the prefab into the scene it states a number (example :300). So when the player in created that 300 number does not change and that's where I am getting my error.

    In the editor console it's pointing to SpawnManagerBase cs 144 and SpawnManagerBase cs 95.

    I know that Nolan is working in the demo scene but could someone try converting another character to a pun character for a test because I'm wondering if something isn't working correctly with the editor window for creation.

    Also I'm on Unity 2020.3.1f1 LTS.
     
    Last edited: Apr 7, 2021
  22. jadeboye59

    jadeboye59

    Joined:
    Mar 27, 2021
    Posts:
    1
    Please how do i load my scenes as rooms using photon.
     
  23. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
  24. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    We just released PUN v2.30. This is a small-ish release with some fixes for ownership handling and some additional checks to prevent usage errors. If your workflow now stops where you didn't expect it, check the console output.

    v2.30 (13. April 2021)
    Changed: When the PhotonView.ControllerActorNumber should be set to 0, it now sets the backing field to the Master Client's actorNumber instead. This prevents misunderstandings when updates are sent with the Master Client's actual actorNumber
    Changed: Setting the PhotonView.ControllerActorNumber will now refresh the Controller in all cases. This makes sure that (e.g.) scene objects get a Controller value OnJoinedRoom (they might exist before a room is joined).
    Updated: EventSystemSpawner to log an error and pause the execution, if only the new input system is being used. The PUN demos are not compatible with it unless you set Active Input Handling to "Both".
    Note: Only the PUN demos are incompatible with the new input system. PUN itself is not affected. As the demos are in separate folders, you can easily delete all of them and use the new input system in your project.
    Updated: Realtime API to 4.1.5.4, preventing several error cases.
     
  25. xi_Michael

    xi_Michael

    Joined:
    Oct 21, 2020
    Posts:
    17
    Hello @tobiass

    I am trying to find a way to reconnect to MasterServer after disconnecting from Photon and then using Application.Unload. If I unload Unity, when I try to reconnect I will get hung up on ConnectingToNameServer. If I use Application.Quit instead of releasing memory with unload then I am able to reconnect and all is well.

    The problem is I cannot use App.Quit since in my case,Unity is a child of a native iOS app and it consequently quits the parent native app as well. Unload is what we need to use to have Unity put in the background after a game is over but it is causing issues with reconnecting back to MasterServer to then search for a lobby.

    I was wondering if I could get any insight on this? Perhaps some memory is being released on Unload that Photon is requiring?

    Thanks in advance.
     
    RMurphyXIMedia likes this.
  26. RMurphyXIMedia

    RMurphyXIMedia

    Joined:
    Oct 20, 2020
    Posts:
    2
  27. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    Good question.
    When you disconnected, you can normally disconnect. So yes, apparently Application.Unload is acting odd.
    You can enable the SupportLogger and check the logs as a first step. Anything interesting?
    There is some initialization going on in StaticReset(). Maybe you check if this gets called?

    I would suggest to mail us. This will be easier for communication.
     
  28. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,267
    Getting "abnormal disconnect" on WebGL in builds, any idea how to fix this?
     
  29. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    Please mail us: developer@photonengine.com
    We would like to know the AppId (don't post this here) and some context. Send a full log file please.
     
  30. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    We just updated to PUN 2.31.
    As usual, there are a few fixes and improvements. This time, the bigger changes are in the Photon dlls. Resending reliable messages and timeout detection got refactored which should help prevent a few disconnects. Let us know if you notice a difference.

    v2.31 (19. May 2021)
    Fixed: RpcList updating. Assumptions about editor-callbacks order were incorrect and caused a variable to not be set as needed.
    Changed: The PhotonViewHandler now resets the sceneViewId to 0 for prefabs. This avoids leaking sceneViewIds to the prefabs.
    Updated: Export platforms for .Net 3.5 lib. It was still enabled for some platforms accidentally. Now the minimum of data is in that meta file.
    Updated: Export platforms for .Net Standard 2.0 dll. It should be used in all platforms except .Net UWP.
    Internal: AccountService can now send an "origin" as reference to the package the registration originates from.
    Updated: Library to 4.1.6.0 with various changes for timeout detection and resends.
     
  31. xi_Michael

    xi_Michael

    Joined:
    Oct 21, 2020
    Posts:
    17

    I actually was able to figure out was being released/destroyed on unload. Thank you for the speedy response though.
     
    tobiass likes this.
  32. xi_Michael

    xi_Michael

    Joined:
    Oct 21, 2020
    Posts:
    17
    @tobiass

    Hi again,

    I was wondering If there is some more info explaining ResentReliableCommands. For whatever reason 30seconds-1min into a networked game they start spiking to 5000-30000(by this time I disconnect).

    Is there a way to clear this build up?
     
  33. HailorHL

    HailorHL

    Joined:
    May 28, 2021
    Posts:
    1
    looking forward to photon's performance under massive players circumstance.
     
  34. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    It is very likely your client sends a lot of data in that time and either your connection gives in and/or the throtteling on the server is kicking in. Figure out how much you send and if you could reduce it.

    The simple answer is: It depends a lot on the case. What do you want to achieve?
     
    xi_Michael likes this.
  35. xi_Michael

    xi_Michael

    Joined:
    Oct 21, 2020
    Posts:
    17
    Thanks, quickly found what it was.
     
    tobiass likes this.
  36. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    One question from our side:
    If you are using PUN 2.31, did you notice any change in connection stability?
     
  37. psyhama

    psyhama

    Joined:
    Sep 4, 2018
    Posts:
    13
    Hi, we have some trouble keeping RPC list order. (Photon v2.18 / v2.31)
    When I clone an Unity project from git and open with Unity Editor, which includes PhotonServerSettings.asset, the settings will be reset and RPC list are sorted and become different order, which is problematic.

    Here is the easy way to reproduce this problem.
    1. Open any Photon PUN demo project with Unity.
    2. Input App Id PUN in PhotonServerSettings
    3. Close Unity Ediotor.
    4. Delete "Library" folder.
    5. Open the project again.
    6. Then, the Photon Setup Wizard will open and the contents of PhotonServerSettings.asset is missing, which is not good.

    I inspect a bit and the problem seem to be at PhotonEditor.OnProjectChanged().
    It looks like that if the project assets are not imported yet, OnProjectChanged is called before PhotonServerSettings.asset become ready to be read.
    And the current code saves PhotonServerSettings.asset at that timing on getter func of PhotonNetwork.PhotonServerSettings property, called by PhotonEditor.OnProjectChanged().

    So please be sure not to save PhotonServerSettings.asset at the timing of OnProjectChanged().
     
    Last edited: Jun 7, 2021
  38. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    We will look into this. Sorry for the hassle.
    Which Editor version are you using?
     
    Last edited: Jun 8, 2021
  39. psyhama

    psyhama

    Joined:
    Sep 4, 2018
    Posts:
    13
    Thank you tobiass!
    We're using Unity 2019.3.6f1.
     
  40. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    We released v2.32 to fix the issues with the PhotonServerSettings.
    Let us know if this covers all your cases!

    v2.32 (09. June 2021)
    Fixed: Editor scripts to not overwrite the PhotonServerSettings when upgrading projects or loading them without a library folder. While the Editor starts up, the settings may be blank but not null. As before, if the asset is not available, it gets created.
    Updated: Library to 4.1.6.1 with several smaller adjustments. More details in changes-library.txt.
     
    psyhama likes this.
  41. xi_Michael

    xi_Michael

    Joined:
    Oct 21, 2020
    Posts:
    17
    Sorry for being late response wise. No I can't say I have seen any change, so far everything is OK.
     
    tobiass likes this.
  42. psyhama

    psyhama

    Joined:
    Sep 4, 2018
    Posts:
    13
    Hi tobiass, it was really fast!
    I tried the new version in my sample project and the problem seems to be solved! I will update the working project and see what happens but anyway I appreciate you for the very very fast fix! ;)

    And by reading the fixed code, I found that my guessing of the reason was a bit off...:confused:
     
  43. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    Well, yes and no. In the previous version, the RPCs were updated early and that accessed and saved the settings. What's new: PUN no longer saves the settings this early. We use a delayed call to register for project changes. It sets an internal flag and we re-load the settings with the difference: Due to the flag we also may save it (if not found).
     
    psyhama likes this.
  44. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    We just released an update to PUN 2 which fixes some issues with ownership when rejoining a room.
    Known issue: When the Master Client has a disconnect locally and rejoins the game, it will lose state of the networked objects (due to the disconnect). If this client reconnects before the server assigned a new Master Client in the room, this desyncs the clients and the Master Client.
    It is unlikely that we fix this. A workaround is to make a Master Client wait (for the server timeout time) before calling ReconnectAndRejoin.
    There is no fix planned for this, as it will require a bigger refactoring. This will be addressed by our upcoming product: Fusion.


    v2.33 (23. June 2021)
    Fixed: Calculation of PhotonView.AmOwner. It is possible that the owner is set to actorNumber 0, which instead will apply the Master Client as owner. This caused AmOwner to be wrong.
    Fixed: Controller updates when players enter a room. Every client has to update the views, as an owner may return and regain control.
    Fixed: ControllerActorNr assignment will check if the assigned controller is inactive. In that case, the Master Client will step in (right during assignment).
    Added: Additional check if the settings file exists, to avoid using CreateAsset, when it does.
    Added: JoinRandomOrCreateRoom(). This was implemented in Realtime but not PUN.
    Changed: The enumeration CustomAuthenticationType was changed to fix naming inconsistencies. Use PlayStation4 and PlayStation5 respectively. Old variants are available as obsolete.
    Fixed: In Asteroids Demo, remote ships are not reacting to input when remote controller is inactive.
    Fixed: Potential KeyNotFound issue in the Asteroids Demo, PlayerOverviewPanel if remote players left or the object got destroyed.
    Added: PlayerDetailsController.OnDisable() override (used in cockpit) to unsubscribe from callbacks which are subscribed in OnEnable(). Both override the inherited implementation and call base.
     
  45. digiross

    digiross

    Joined:
    Jun 29, 2012
    Posts:
    282
    Any new info on Fusion and a release date? I think it's going to be a gamechanger.
     
  46. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,586
    Is the implication here that Fusion will eventually replace PUN? This seems difficult to believe taking into account the difference in cost currently.
     
  47. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    PUN 2 will not be deprecated soon but we also don't plan to refactor it considerably anymore. It basically goes into LTS mode. Games (released or upcoming) that run with it are safe, of course.

    Maybe you mix up Fusion with Quantum? Fusion will be free to develop with and only has a CCU based fee like PUN. Yes, the pricing per CCU may be a bit higher but not much. The results that Fusion enables should be much smoother and predictable though.
     
  48. Munchy2007

    Munchy2007

    Joined:
    Jun 16, 2013
    Posts:
    1,586
    You're right, that's exactly what I did :)
     
  49. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,688
    We released three updates since v2.33 with several fixes and improvements:

    v2.33.3 (07. July 2021)
    Fixed: Skipping cleanup of PhotonViews if they never had a legit ViewID. This could result in a NullReferenceException (e.g. when exiting play mode). Introduced in v2.33.2.
    Internal: RegisterPhotonView will set view.removedFromLocalViewList to false now. This is an internally used value.

    v2.33.2 (06. July 2021)

    Fixed: Assigning photonView.ViewID = 0 will remove the PhotonView from the list of active views.
    Added: Namespaces for various classes that were not having any.

    v2.33.1 (24. June 2021)
    Updated: Library to 4.1.6.3. More details in changes-library.txt.
    Note: This has no distinct value for PhotonNetwork.PunVersion and no separate release in the Asset Store (the previous release was on the same day).
     
    Last edited: Jul 7, 2021
  50. utkarshdwivedi3997

    utkarshdwivedi3997

    Joined:
    Aug 11, 2017
    Posts:
    22
    Hi! I am not sure if this is the right spot to ask for help on crashes that could potentially be caused by Photon, so please point me in the right direction if this isn't. If this is the right spot, please read ahead and let me know if you can offer any advice on the matter.

    My game is running into a crash on scene/level load that I have identified to be caused potentially due to a change in how we are loading levels using Photon. The game on a pretty old version of PUN 2 - PUN 2.14, Photon lib: 4.1.2.17, so it does need to be upgraded.

    Context for the issue: Earlier I was using PhotonNetwork.LoadLevel() with PhotonNetwork.AutomaticallySyncScene set to true. This was working fine, except for reloading levels (as is also mentioned in the documentation for this method in PUN 2 - reloading levels doesn't work on non-master clients). The level restart in my game works by actually reloading the scenes, so I changed the level loading system to use Raise Event instead. An event is raised from the master client, and then everybody does their own level loading once they receive the event.

    My team noticed that this introduced an inconsistent crash during level loads in our game. More specifically, the crash seems to be happening when we try to use PhotonNetwork.InstantiateSceneObject() or PhotonNetwork.Instantiate(). In the PhotonNetwork.NetworkInstantiate() function overload that is called when an Instantiate event is received in the OnEvent() function, I added a simple log: "trying to instantiate <name of gameobject>". While this isn't conclusive, it could help to see if all gameobjects that are supposed to be instantiated print those logs before the crash happens. On checking the crash log, I was only able to see ONE out of THREE such messages (the level spawns 3 different objects right after loading, but the crash seemed to have happened right after the spawn call for one of these objects). I'm attaching the crash dump, output log and error log for this crash.

    I can't say with 100% certainty that the cause for this is the level load change, but that is one of the only few things that I changed about how levels are loaded in the game after which this crash started happening. I have made the following observations about this crash, however:
    • It is NOT a consistent crash, it seems to happen randomly.
    • If a level is constantly making Unity or the standalone build crash when trying to load the level, going offline and loading it once in offline mode will stop the crashes from happening for the rest of that session. This is why I think this issue could be related to something that I might have broken in the level load in online mode.
    • The crash seems to only happen on non-master clients.
    • The crash seems to happen more often on lower end devices.
    The only difference that I could find in the level loading done via PhotonNetwork.LoadLevel vs the Raise Event loading is the lack of pausing of online messages queue. The new Raise Event loading doesn't set PhotonNetwork.IsMessageQueueRunning to false. Could this be potentially causing the said issue? I plan to add this in our custom loading anyway, so I wanted to confirm what would be the ideal places to pause and unpause the message queue. My understanding is that the IsMessageQueueRunning bool should be set to true when a level load message is received and we start loading a level, and then as soon as the level has finished loading, set this bool back to false.

    Any help on this matter is greatly appreciated.
     

    Attached Files:

    Last edited: Jul 12, 2021
unityunity