Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Third Party Photon Unity Networking

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

  1. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    Nice game! Cool to read you use (and love) Photon! :)

    Photon does not save the list of friends. You just send the list with FindFriend, to check who's online and playing which games.
    The list itself must be managed by some community. Your trailer mentions FB but you can also use PlayFab, e.g.
     
  3. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    It's about time to roll out another PUN update. This time, we have lots of improvements and fixes and a lot of work got done under the hood in preparation for getting certified on consoles.

    Thanks everyone for the continued support and feedback!
    Over 1300 people gave PUN some star-ranking in their Asset Store downloads - this is amazing!


    v1.74 (15. August 2016)
    Fixed: PUN+ is now compatible with Unity 4.7.2 Free again and can export to iOS and Android as expected. If you have Unity 5.x or 4.x Mobile Pro, you were not affected.
    Fixed: TCP Socket for Windows Store 8.1 and UWP.
    Changed: Due to upcoming new encryption options, exports now must use API Compatibility Level ".Net 2.0" instead of ".Net 2.0 Subset". We hope this is a minor issue. Let us know if not.
    Note: When the Bytecode Stripper fails, see the note above about Compatibility Level.
    Fixed: Compatibility with Unity 5.4 by not adding a MonoBehaviour as Component. Instead, a derived class is used.
    Added: Optimization if a observed component implements IPunObservable. If so, we use a shortcut to call OnPhotonSerializeView(). This can speed up observed component calling in PhotonViews.
    Fixed: NetworkingPeer.HandleEventLeave() inactive state missing masterClient assignement during first leave call (A second leave call will be made after playerTtl expires).
    Improved: DemoChat : Exposed FriendsList to the inspector to prevent hardcoded friends references, and allow for easier testing without code modification
    Fixed: PhotonEditor.cs: Pun+ plugins libs paths discovery. For Unity 4.7.2, the wizard window detects PUN+ correctly again.
    Internal: Changed the workflow for setting up protocols. One method aggregates this now.
    Internal: NetworkingPeer.SetupProtocol(). Gets called before each PhotonPeer.Connect().
    Changed: PhotonNetwork constructor no longer sets protocols for special cases.
    Internal: Updated the IPhotonSocket implementations to set their "IPv6-resolved" state.
    Updated: To new library build with new internal workflow for the "Init Request".
    Improved: PhotonPlayer.cs: Implemented IComparable and IEquatable.
    Fixed: NetworkingPeer.cs: Check for null view before adding view's GameObject.
    Fixed: Room.ClearExpectedUsers() is now sending it's current, local "expected users" to update the server with "CAS" (Check and Swap). This gives the client an update when the values become valid (which updates the local cache after the roundtrip).
    Added: link.xml file to preserve some classes from being stripped. This is in Assets\Photon Unity Networking\.
    Changed: The name/string of the "OnPhotonInstantiate" callback is now cached once, instead of using enum.ToString() each time. This is a minor performance improvement.
    Changed: The initial Dictionary size used in a PhotonView. This stores the the observed components and their methods to call.
     
  4. protoshape

    protoshape

    Joined:
    Aug 2, 2015
    Posts:
    9
    Hi,

    We are trying to use GameClose, Type: "Save" web hook.

    We are using custom room properties heavily during gameplay and we need to persist in game close hook.

    In our tests we see that custom room properties do not exist in under CustomProperties tag in received from photon web call. Instead custom room properties are under debuginfo tag in json.

    How can we save custom room properties GameClose, Type: "Save" web hook and load them later ?

    Additionally, how can I set EmptyRoomTTL to 300000 and PlayerTTL to 0 in PUN Free ? There is no EmptyRoomTTL parameter in RoomOptions class as far as I can see.

    Thanks.
     
    Last edited: Aug 17, 2016
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    I will have to forward the questions about WebHooks and the content of the "save" hook to my colleagues. Those are best discussed in a dedicated thread in our forum.

    About PlayerTTL and EmptyRoomTTL: In PUN you can only set one to simplify matters. PUN is not fully compatible with persisted games (using PhotonViews and ownership is a bit tricky, when you return to the room). But it seems you rely mostly on props.
    If you would set PlayerTTL to 0, any player who loses connection will be timed out and can't simply return to the room.
    Let me guess, you try to create a persistent world with as many/few players as happen to be there?

    Please post more details of what you want to achieve in our forum. A discussion of this is too complex for this super long thread. http://forum.photonengine.com
     
  6. protoshape

    protoshape

    Joined:
    Aug 2, 2015
    Posts:
    9
  7. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    I am sorry about the recent IPv6 issue in v1.74. This version is a minor update to fix iOS and UWP exports.

    v1.75 (23. August 2016)
    Fixed: The Photon assemblies (.dll) to support IPv6 correctly again. This was broken temporarily in v1.74.
    Fixed: UWP assembly. It now contains Photon's Hashtable, as all other libraries do. This fixes Windows 10 UWP exports.
    Changed: PhotonMessageInfo is now a struct (was a class). This is less garbage to collect.
    Changed: Demo script "ColorPerPlayer" to use less resources. When entering a room, it ignores property-changes until an initial check is done "on join".
    Changed: Internally, the ServerSettings class now contains a VoiceAppId field. This allows easier merging with PUN Voice.
    Changed: Internally, OnSerializeRead() now re-uses a stream object and just applies new, incoming values to it. This saves a bit of garbage.
    Fixed: Compatibility with Unity 5.4, where OnLevelWasLoaded is obsolete and SceneManagement.SceneManager.sceneLoaded should be used to register "on loaded" callbacks.
    Updated: To Photon assemblies v4.1.1.1.
     
  8. Marceta

    Marceta

    Joined:
    Aug 5, 2013
    Posts:
    177
    I have one problem with my multiplayer game, I'm using photon. This is realtime multiplayer quiz, and when some popup happens on top of my game (for example Viber app) at that time user is not receiving any data from opponent which breaks my game.
    Is there some quick way to check if user received last message or something like that. Any idea for avoiding this kind of problem?
     
    Last edited: Aug 29, 2016
  9. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    When a popup happens, the game goes to the background and loses focus.
    On Android, the game should be able to still receive network messages but PUN's logic is not going to dispatch it. This means: The game is paused and queues the incoming messages.
    When you return focus to the game, more than one message might be dispatched/executed in a frame.

    Check if your game disconnects on application pause. If it doesn't, check if you get the messages when you return (add debug log to the handling methods).

    What should happen while a player is paused? Can the other continue?
     
    Marceta likes this.
  10. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    515
    tobiass, in my 3rd person shooter game I have tried to use both uNET and PUN to compare results. I can tell for sure that PUN looks more flexible in use, but unfortunately I had flitches on character transform sync. I fixed it using my custom sync method instead of PhotonTransformView
    Code (CSharp):
    1. public void OnPhotonSerializeView (PhotonStream stream, PhotonMessageInfo info) {
    2. //            /*
    3.             if (stream.isWriting) {
    4.                 stream.SendNext(m_Transform.position);
    5.                 stream.SendNext(m_Transform.rotation);
    6.             } else {
    7.                 m_NetworkPosition = (Vector3)stream.ReceiveNext();
    8.                 m_NetworkRotation = (Quaternion)stream.ReceiveNext();
    9.             }
    10. //            */
    11.         }
    12.  
    13.         void OnAnimatorMove () {
    14.             if (!photonView.isMine) {
    15.                 // teleport player if distance is too big (cause by bug or respawn)
    16. //                if (Vector3.Distance(m_Transform.position, m_NetworkPosition) > 2f){
    17.                 if ((m_Transform.position - m_NetworkPosition).magnitude > m_teleportationDistance){
    18.                     m_Transform.position = m_NetworkPosition;
    19.                     m_Transform.rotation = m_NetworkRotation;
    20.                 }else{
    21.                     m_Transform.position = Vector3.Lerp(m_Transform.position, m_NetworkPosition, Time.deltaTime * m_Smoothing);
    22.                     m_Transform.rotation = Quaternion.Lerp(m_Transform.rotation, m_NetworkRotation, Time.deltaTime * m_Smoothing);
    23.                 }
    24.             }
    25.         }
    The bad thing is I still didn't find a way to fix flicking animations on jump. I use RPC to start Animator.CrossFade() method and don't use PhotonAnimatorView, because all values there are set in each character instance after receiving the RPC call. As a result I get Jump animation "cutted" in a beginning and character position flicking. The same logic runs great in uNET, without any flickers.

    Any suggestion, how to deal with it? I don't want to migrate to uNET only because of that issue
     
  11. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    @novaVision, thanks for explaining your case. I think we should tackle this, so we will try to reproduce and solve it.
    Maybe we can move this conversation to a mail thread (developer@exitgames.com) to discuss details.

    First thought: The RPC triggers an animation? And that is stuttering in the beginning?
    Maybe the animation AND the data in OnPhotonSerializeView both affect the position and PUN can't resolve what exactly should happen (and why).

    Can you send us a test case? Or at least a video/gif to show the effect, plus some code and animation to set this up?
    It will be easier to fix when we can reproduce it in a project.
     
  12. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    515
    Sure, I will send videos by email. I was trying to create a discussion on your forum, but unfortunately not a lot of actions there. In a sooner development step we will use payed version (20+ CCU) and not sure how to discuss some specific questions - here, at your forum or by email?
     
  13. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    In general, I prefer a thread per topic, be that mail or forum.
    The forum is monitored by us but we can't answer everything all the time. We try to. Mail is better when we share code, snippets or AppIds, etc.
     
  14. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    515
    Ok, thanks for info. I have recorded videos, but 100% not sure, is it PUN specific case or my project.. Unfortunately I can't easily switch between 2 network services to compare the same project. I will check it in details, to avoid time wasting about my case
     
  15. Keith90

    Keith90

    Joined:
    Sep 27, 2013
    Posts:
    116
    Hello,

    I'm currently trying to implement Photon into my game. So far I have two characters that can run around and the running animation plays. I have four questions.

    Question 1:

    When the second player joins, an error gets logged saying: "The variable anim of PlayerNetworkMover has not been assigned.". The error only is logged once, so could it be that it shows before the animator is referenced in the script?

    What I've Tried:


    I've made sure that in the script, the animator gets reference (private Animator anim = this.GetComponent<Animator>(). When I check the inspector, it shows that it is indeed being referenced.

    Question 2:

    For my players, I have child objects that when the player gets hit, the child objects get unparented and have a force added to their rigidbody to be pushed away. The objects are not seen over the network, so would I have to add a Photon View Transform or Rigidbody to each child object so it seen as it's own object and is shown moving accordingly?

    What I've Tried:

    I've tried putting a Rigidbody View and a Transform View on the child object but it doesn't work.

    Question 3:

    My players have an integer that I use to determine which mesh for the body to swap to. I can't seem to get the integer to sync to make it show the appropriate mesh over the network.

    What I've Tried:

    I tried putting it in OnPhotonSerializeView like the animator booleans but it seems unlike the animator booleans, it doesn't sync.

    Question 4:


    For some strange reason, I get this error: "Received OnSerialization for view ID 1002. We have no such PhotonView! Ignored this if you're leaving a room. State: Joined". It pops up a few times with different view IDs. From what I can gather from the NetworkingPeer.cs script, it means that whatever is suppose to have a PhotonView is missing one. How would I be able to determine which objects those are?


    If anyone has any knowledge or advice, I'd greatly appreciate it. Thanks. :)
     
    Last edited: Sep 3, 2016
  16. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    @Keith90:

    A1: I can't find "PlayerNetworkMover" in the scripts of PUN. What is it? We need at least a callstack to even think about this.

    A2: I would not put synchronize individual parts of a networked game object, unless necessary. Try to instantiate and move it as one.
    You can send data with the PhotonNetwork.Instantiate to setup your networked object (and childs).
    When a hit happens, separate the parts. If the separated object is not game-relevant anymore, you don't have to sync it at all. Just include some initial force information in the hit.

    A3: Unless it changes frequently, I would not sync it in OnPhotonSerializeView. That is for frequently changing values.
    Use a property of the player or send it as data in Instantiate.
    https://doc.photonengine.com/en/pun/current/tutorials/synchronization-and-state
    If something does not sync via OnPhotonSerializeView, you either didn't send it or didn't observe the script you put it in.

    A4: This can happen when you're destroying networked GameObjects. Maybe you're not using PhotonNetwork.Destroy in some case? If you have to find out which object this relates to, you have to log a look up table.
     
  17. Keith90

    Keith90

    Joined:
    Sep 27, 2013
    Posts:
    116
    The objects are game-relevant. Should I put a transform view on them?

    Also, I try to get a RPC to send to another player but it keeps getting called on my own player. When I hit a player using a trigger, I get their PhotonView and send the RPC.
     
    Last edited: Sep 6, 2016
  18. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    When the objects are game relevant, then you might have to put a view on them. If it's a TransformView or something you create base on it should depend on the use case. Whatever looks OK and does not cause a lot of messages ;)

    The RPC is not meant to be a message to one player (the owner) but it's (by default) meant to make all clients call a method on a game object.
    The RPC method has an overload with a "Target". Check the options here and pick the one that targets a player and sent it to the owner.

    Hope that helps.
     
  19. Briner

    Briner

    Joined:
    Jul 8, 2015
    Posts:
    25
    Hi.

    I have troubles exporting my game to WebGL, right after import Photon in my project (with WebGL target) I get this error:
    as the error say there are not none 'WebSocket' plugin in the PUN folder only Metro folder, but I have see in the hierarchy in asset store that it appear but when I import there are not folder of it also of Uwp.

    Maybe WebSocket folder are not added in the package or a asset store problem?
     
  20. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    Import again. There is a Assets\Plugins\WebSocket folder in the pack, which must be in your project.

    In that folder, you will find a dll, which you maybe have to setup in the Inspector. The "websocket-sharp.dll" is only for the Editor. Else, webGL exports will use the browser's websockets.
     
  21. Briner

    Briner

    Joined:
    Jul 8, 2015
    Posts:
    25
    Thanks for the reply.

    Sure, I have try import again but without results, for you can see what I'm talking about look this:
    the hierarchy from asset store show that the folders are in the package

    and when I import in unity this appear: (In PUN free and PUN Plus)

    I have try import the 'WebSocket' folder from an older project with a old version of photon but when I build the project I get this error:

     
  22. Squalol

    Squalol

    Joined:
    Jan 27, 2015
    Posts:
    7
    I've been able to implement PUN without much hassle in my project but isn't there a way to make the server authoritative so that it cant be cheated so easily? Also, if Im not mistaken, right now the first one to enter the game "hosts" it, so if a laggy client is the first to join, everyone will have lag :/ Is there no way around this? I've looked at the photon server, but cant find any tutorials at all on how to set it up and i dont have a computer degree background, so I dont know much of programming outside of Unity.
     
  23. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    Unity 5 no longer uses the folder names to define which dll gets used for the exports. The folders are an indicator but in the end, you need to select each dll in the Editor/Project and set it up in the Inspector. It has checkboxes for each platform and per platform you can also setup more details.
    When you delete our Photon plugins (.dll, .pdb, .mdb and any other file beginning with Photon), you can usually re-import those from the fitting package, including correct settings for most exports.

    Old Photon libraries will rarely work for new PUN versions. We don't support mixing those versions.
    Your first screen shows the current setup.

    Select websocket-sharp.dll and check "WebGL" as export.


    @Squalol: We think it's usually better to enable all clients to look out for cheaters, instead of making one player authoritative. As you say, you never know how good that connection is or if the player stays in-game or cheats.
    If all players detect cheats, you are more safe and independent from one "opinion", which could be cheated.
    Then you need an account service to properly handle cheaters, too. Why? Cause you can kick a cheater but unless you keep them from coming back, you didn't gain much. So you would need an account service which has cheater reporting and (temporary or permanent) user banning.

    Or you can go the authoritative route.
    Sadly, I can't take away the complexity of creating authoritative anti-cheating on a server by just posting some magic advice. This is harder to do and or means more load for the server, which will cost money in the long run.
    Mind you, I'm not saying this is impossible! It's just more work.
    Read up on Photon server development on our doc pages and post questions in our Server Forum. Then we can properly help.

    Another tip: Do buy a cheat protection package for the client from the Asset Store to make your client side less vulnerable. There are several and they will save you a lot of work. Anti-cheating is an ongoing effort and it might make sense to buy it and ask there for tips on the topic.
     
    Squalol likes this.
  24. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    If anyone runs into this compile error "UnityException: Failed to run serialization weaver", please make sure that the .pdb and .mdb files for your assemblies (.dll) are up to date! You can delete those files and just keep the .dlls but if they are not matching, it can cause issues.
     
  25. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,647
    I'm having a problem finding a gameObject with a PhotoneView component attached to it.
    Is my logic right on this?
    Its getting the correct PhotonView ID but it just can't find it afterwards.

    Code (csharp):
    1.  
    2. void SetupMotherShipsStats(GameObject ship) {
    3.  
    4.     clientGameSetup.GetComponent<PhotonView>().RPC("SetupMotherShip", PhotonTargets.All,ship.GetComponent<PhotonView>().viewID);
    5.  
    6.   }
    7.  

    Code (csharp):
    1.  
    2. [PunRPC]
    3. public void SetupMotherShip(int PhotonViewId) {
    4.  
    5. GameObject UnitGameObject = PhotonView.Find(PhotonViewId).gameObject;
    6.  
    7. UnitGameObject.SetActive(true);
    8.  
    9. }
    10.  
     
  26. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    Are you destroying it, maybe? Did you use PhotonNetwork.Instantiate() to create it? Any errors?
     
  27. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,647
    Ya I'm using PhotonNetwork.Instantiate. It shows up in my Hierarchy.
    I get error NullReferenceException: Object reference not set to an instance of an object

    according to the hours of research :) I believe I'm doing it correctly.

    I ran into someone else that had a issue like this and I think he said you have to wait till the next frame to access it. I surely hope not that be a bit more trouble on coding.

    My code is super simple too. Wanted to make sure this was working before I went full throttle on development.

    im going to do a test to see if it finds the photonView with out grabbing the gameobject on the same line.

    Code (csharp):
    1.  
    2. void LoadMotherShips() {
    3.    SetupMotherShipsStats(PhotonNetwork.Instantiate("Mother Ship", newVector3(5000,1000,0), Quaternion.identity, 0));
    4. }
    5.  
    6.  
    Code (csharp):
    1.  
    2. void SetupMotherShipsStats(GameObject ship) {
    3.  
    4.    clientGameSetup.GetComponent<PhotonView>().RPC("SetupMotherShip", PhotonTargets.All,ship.GetComponent<PhotonView>().viewID);
    5. }
    6.  
    7.  

    Code (csharp):
    1.  
    2. [PunRPC]
    3.  
    4. public void SetupMotherShip(int PhotonViewId) {
    5.  
    6.    GameObject UnitGameObject = PhotonView.Find(PhotonViewId).gameObject;
    7.  
    8.    Debug.Log(UnitGameObject);
    9.  
    10.    UnitGameObject.SetActive(true);
    11.  
    12. }
    13.  
    14.  
    15.  
     
    Last edited: Sep 19, 2016
  28. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,647
    Ya if I try this it returns null
    Code (csharp):
    1.  
    2. PhotonView UnitGameObject = PhotonView.Find(PhotonViewId);
    3.  
    I do keep getting this error though. I'm not sure what to make of it. I try setting it to 0 but it always goes back to 13. Even though during the game it assigns 1001 to it and increments past that for each one added. Which matches the PhotonViewID I grab to find it.

    PhotonView on persistent object being fixed (id and prefix must be 0). Was: View (0)13 on Mother Ship (scene)
     
  29. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,647
    Ahh I figured out whats wrong :) Apparently PhotonView.Find() doesn't work if its on a Inactive GameObject. Which stinks a bit.

    I was going to load all the settings for the ship before activating it. Will have to come up with something else.
     
  30. CreativeGirl

    CreativeGirl

    Joined:
    Sep 20, 2016
    Posts:
    2
    Hy,
    I need a little help!
    Im try to build an ios app, but every time im failed because :

    stdout:
    Fatal error in Mono CIL Linker
    System.Exception: Error processing method: 'System.Void ExitGames.Client.Photon.EncryptorManaged.CryptoBase::Init(System.Byte[],System.Byte[])' in assembly: 'Photon3Unity3D.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void System.Security.Cryptography.AesCryptoServiceProvider::.ctor()
    at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00000] in <filename unknown>:0
    at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00000] in <filename unknown>:0
    at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x00000] in <filename unknown>:0
    at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x00000] in <filename unknown>:0
    at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in <filename unknown>:0
    --- End of inner exception stack trace ---
    at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00000] in <filename unknown>:0
    at Mono.Linker.Steps.MarkStep.Process () [0x00000] in <filename unknown>:0
    at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
    at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x00000] in <filename unknown>:0
    at Mono.Linker.Driver.Run () [0x00000] in <filename unknown>:0
    at Mono.Linker.Driver.RunDriverWithErrorHandling (Mono.Linker.Driver driver) [0x00000] in <filename unknown>:0
    at Mono.Linker.Driver.RunDriver (Mono.Linker.Driver driver) [0x00000] in <filename unknown>:0
    stderr:

    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:98)
    UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:104)
    UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String[], String[], String, String, String&, String&, String, IIl2CppPlatformProvider, IEnumerable`1, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:97)
    UnityEditorInternal.AssemblyStripper:RunAssemblyStripper(String, IEnumerable, String, String[], String[], String, IIl2CppPlatformProvider, RuntimeClassRegistry, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:208)
    UnityEditorInternal.AssemblyStripper:StripAssemblies(String, IIl2CppPlatformProvider, RuntimeClassRegistry, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/AssemblyStripper.cs:128)
    UnityEditorInternal.IL2CPPBuilder:Run() (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:205)
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry, Boolean) (at /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/Il2Cpp/IL2CPPUtils.cs:132)
    UnityEditor.HostView:OnGUI()

    Unity version : 5.4

    What cause the problem ?
    Im tried to reimport dll, change build target but nothing worked.
     
  31. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    In your Player Settings for iOS, did you set "Compatibility Level" to ".Net 2.0"?
    In the next update of PUN, we will be ".Net 2.0 Subset" compatible again, but in v1.75 you need to not select the subset.
     
  32. CreativeGirl

    CreativeGirl

    Joined:
    Sep 20, 2016
    Posts:
    2
    Thanks for your help! Its working.
     
    tobiass likes this.
  33. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    We just released a new version. For some, the first point in the changelog will be most important: ".Net 2.0 Subset" can be used again. Aside from that, we have a few fixes, an improved (but still really simple) Chat UI and cleaner assemblies.

    v1.76 (21. September 2016)
    Fixed: Compatibility with ".Net 2.0 Subset". This can be used again.
    Updated: Some minor things to support Unity 5.5 beta. As always, this is work in progress. Let us know if you run into issues.
    Fixed: Values in enum DisconnectCause are now assigned with the ones from the lower level StatusCode, so that the values make sense again.
    Fixed: NetworkingPeer ReconnectAndJoin procedure by not cleaning up Ip Address on disconnection.
    Added: RoomOptions EmptyRoomTtl are now available. You can set how long a room stays in Photon Server's memory before it's being cleaned up or saved/persisted.
    Improved: Remove initial drifts on remote PhotonView transform values for ThirdPersonNetwork and PhotonTransformView components. When using these components, the first "life update" defines the position of a GO (instead of lerping there from the instantiate-position).
    Updated: The Chat Demo. It has a new text-input command and shows channels and private conversations properly.
    Updated: To Photon assemblies v4.1.1.3. which includes a fix for WSA builds. Also, only one WSA compatible dll is used across Windows Store exports (8.1 and 10).
     
  34. BrianND

    BrianND

    Joined:
    May 14, 2015
    Posts:
    79
    I've imported 1.76 and I can't seem to compile under .net subset. It looks like in the link.xml

    <assembly fullname="System">
    <namespace fullname="System.Net.Configuration" preserve="all"/>
    </assembly>

    is included which is not under the mono 2.0 subset support.
    https://docs.unity3d.com/352/Documentation/ScriptReference/MonoCompatibility.html

    Is this namespace required?

    I have a plugin that auto merges the link.xml to a top level one but so it will bring that into the final build.
     
  35. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    @BrianND: I didn't notice issues with that in the test exports. Please remove it. I think it's a remnant of the last release, which was overall not Subset compatible. I built v1.76 with the Subset and it was fine.
     
  36. AlienMe

    AlienMe

    Joined:
    Sep 16, 2014
    Posts:
    93
    @tobiass: We are deciding which network to use for a game we are working on, and we have some questions about PUN, Photon Cloud, etc.


    1- If you have a 8 players in a room, but the 'master' client happens to be one with a slow connection.. won't this affect the whole game performance?

    There is lag from p1 to Photon Cloud, and then from Photon Cloud to each other player.. and if there is a round trip RPC, we are talking P1 -> Cloud -> Master -> Cloud -> P1, assuming 50ms lag per leg, we'd be talking 100ms for one way call, or 200ms lag for a roundtrip call.

    Wouldn't this make for a very laggy experience?

    In Pixel Gun 3D, which is in your site's showcase as using Photon PUN, you can see this lag, by playing with an iPad and an iPhone, making one jump, you see a delay of 1+ secs before the jump gets sent to the other device. Maybe that's an issue specific to that game. But the question with addition of lag still remains.


    2- Can we use Photon Cloud for a FPS? We tried UFPS Photon Multiplayer, but it uses simple movement averaging.

    What we need for an FPS is Entity Interpolation, as explained here. But for this we need some kind of server side scripting. Even if it is done in JS due to security concerns.

    We looked into your dedicated server product, as well as Photon Cloud Enterprise, and while these are still options, we'd love to use Photon Cloud or one of its variants.

    One of our games is currently using SmartFox with several C# backend servers.. handling about 2-3000 CCU. But for our next game, we are looking for a pure C# stack.

    Thanks!
     
  37. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    1. It might, if you rely a lot on the master client to make decisions. While we point out a MC, it does not mean you should make this client do the heavy lifting. As with someone hosting a uNet game, you don't know if the MC has a decent machine, connection and enough time to finish the game.
    You can usually extrapolate the results of input/actions and hide lag, just like you would with less hops in between. Lag can spike even if you directly communicate with the server.

    Depending on your needs, you might want an authoritative server. In that case, you can either run Unity instances (which know the scenes and physics) or you can implement a standalone server (and you need to export whatever you need to know about Unity's scenes).

    Our product Bolt is not using Photon Servers. Players connect to a Host, just like in uNet. This is not well suited for mobile games but good for PC / Standalone.

    2. Yes. See Pixel Gun and others on the showcase page. Of course it depends on your needs and requirements.
    You can use Photon Server and code the server side in C#. It just doesn't simply know the scene. You need to export the levels, etc. to make that available in a Photon Server.
    If you use the Photon Server Plugins, we can run it in a Photon Enterprise Cloud for you.
    With that many CCUs, you might want a Enterprise Cloud anyways.
     
  38. CodemasterGames

    CodemasterGames

    Joined:
    Aug 11, 2014
    Posts:
    8
    Hey! first of all, sorry for my bad english.

    Is PUN+(v1.76) supports ipv6 on unity 5.4.1f1?
    I rejected 3 times from apple reviewers.

    1) I created nat64 network.
    2) I got ipv6 adress to iphone
    3) I played my game without ipv6 problem.

    But apple reviewers said "We discovered one or more bugs in your app when reviewed on iPad and iPhone running iOS 10.0.1 on Wi-Fi connected to an IPv6 network."

    When they trying to play my game with their ipv6 network, it didnt work. What should i do?

    Thanks :)
     

    Attached Files:

  39. Grinchi

    Grinchi

    Joined:
    Apr 19, 2014
    Posts:
    130
    can anyone confirm this problem ?
     
  40. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    This is a known problem and we're on it. We recently got info that their very own test procedure does not prepare your app for the App Store sufficiently and apps get rejected.
    We're going to find out how to test properly and what we need to change.
    In the mean time let Apple know you tested with their test environment. Please follow the suggestions in this post:
    http://forum.photonengine.com/discussion/7702
     
  41. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    515
    Hi,

    I have met the same trouble as mentioned here but that solution didn't work for me
    link

    I totally can't understand how can I get that ExitGames.Client.Photon.LoadBalancing namespace, according to that manual page
    That namespace just do not exists. May be I did something wrong?
     
  42. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    @novaVision: The forum post you linked to is about the other API we have: LoadBalancing. While PUN is based on that, it implements things in a more Unity-alike manner, so you can't find all classes of the other package (and vice versa).

    Skip that using line and rely simply on PUN, as shown in the demos. The ConnectAndJoinRandom file could be a good start and so is our PUN tutorial.
     
  43. DavveTheGamer

    DavveTheGamer

    Joined:
    Dec 27, 2015
    Posts:
    34
    If i download Photon Free (https://www.assetstore.unity3d.com/en/#!/content/1786) , then am i able to upgrade to more slots from there? Or do i have to delete it and download something else? Or what, how do i do this?

    I want first, the free version, then i want more slots in the future, is it possible without having to recode everything in your game? How?
     
  44. Alexsander

    Alexsander

    Joined:
    Nov 26, 2012
    Posts:
    17
    Help! Optional parameter value `' cannot be converted to parameter type `PhotonMessageInfo'

    [PunRPC]
    void SyncSteps(string t_corrutine,string m_material,PhotonMessageInfo m_info = null)
    {
    StartCoroutine(t_corrutine, m_material);
    }
    public void PlayClipAtPoint(AudioClip clip,Vector3 position,float volume,AudioSource sourc)
    {
    GameObject obj2 = new GameObject("One shot audio");
    obj2.transform.position = transform.position;
    AudioSource source = (AudioSource)obj2.AddComponent(typeof(AudioSource));
    source.minDistance = sourc.minDistance;
    source.maxDistance = sourc.maxDistance;
    source.panStereo = sourc.panStereo;
    source.spatialBlend = sourc.spatialBlend;
    source.rolloffMode = sourc.rolloffMode;
    source.priority = sourc.priority;
    source.clip = clip;
    source.volume = volume;
    source.Play();
    Destroy(obj2, clip.length * Time.timeScale);
    }
     
  45. ChristianSimon

    ChristianSimon

    Joined:
    Jun 20, 2016
    Posts:
    8
    Hey @Alexsander,

    the PhotonMessageInfo can not be null any longer. The reason for this is, that it is not a class any more, it is a struct now which can not be set to null. So you need to remove = null from the function's parameter list.
     
  46. Alexsander

    Alexsander

    Joined:
    Nov 26, 2012
    Posts:
    17
  47. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    515
    I wish to setup auto-join to the server with a lower latency, and add a custom region selection for the user, that's why I was looking to that LoadBalancing. I didn't find any standard methods to implement it using your tutorials.
     
  48. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062
    PUN Free is exactly the same package as PUN Plus and it's really seamless to increase the player limit whenever needed.
    When you use the Photon Cloud, you get 20 CCU (concurrent users) for testing/development. No matter how long that takes. Buying PUN Plus will give you a 100 CCU subscription for the Photon Cloud (useful for early access, more testing and even for releasing a title).

    @novaVision: Good I asked. You were running in the wrong direction ;)
    You can set the PhotonServerSettings to Hosting Type "Best Region". This pings the servers once and saves which region was best (to return to this later on).
    If you have region selection, use ConnectToRegion(CloudRegionCode region, string gameVersion).
     
    novaVision likes this.
  49. Afif-Faris

    Afif-Faris

    Joined:
    Oct 11, 2013
    Posts:
    16
    I am trying to develop deterministic lockstep system using photon, but it looks like exitgames already adding deterministic lockstep feature called "truesync". I want to test it in my prototype game but I don't see any documentation, how to try it ??
     
  50. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,062