Upcoming 1.4

Tobias
Tobias admin
We recently found quite a big incompatibility between our server caching and the way Unity Networking works.
This affects all players that join running games where Instantiates and RPCs are buffered. Up to v1.3, we don't keep their order and if you instantiate something with a view, then call RPCs on that, joining players won't be able to execute the RPC.

The solution is to implement an alternative cache, which we did in the past 3 days.
Now we want to make sure this works as expected and when it does, we will update the packages in the Asset Store and the Cloud.

If you are not yet using v1.3, you might want to wait for the v1.4 update. It's likely to arrive sometime next week.
«1

Comments

  • Thanks for the heads up there and upfront information.

    I'm looking forward to 1.4 then and upgrading our implementation to it.
  • Is it possible to move .userprefs to Assets folder so it could be synced via Asset Server? :oops:
  • We updated the cloud service and the package for Photon Unity Networking today but due to a minor issue with Unity's asset store, we don't know yet when it's in there.
    The Viking Demo and Angry Bots demo submitted just fine, so those should show up soon.

    In the mean time, get Photon Unity Networking v1.4 here:
    http://db.tt/jXxUn6ST

    List of changes:
    v1.4:
    Fixed: Caching of RPCs and Instantiates. This is a major fix, affecting all situations where players join a room where RPCs and Instantiations were done previously. This fix is "hidden" by the API, so no code changes are necessary in a game.
    Changed: The new cache is no longer cleaned by the server if someone leaves. The "MasterClient" will delete another user's RPCs and Instantiations, when someone leaves (auto cleanup is by default ON).
    Changed: Internals of RPCs and Instantiates. Their events are streamlined and contain only data that's not a default value. This is incompatible with v1.3 clients.
    Fixed: Position and rotation synchronization is now done local to the object. This helps with positions relative to ancestor objects.
    Fixed: PhotonNetwork.Destroy().
    Improved: If you disable the message queue (while loading levels), a thread will keep the connection alive. Timeouts are less frequent this way. Use isMessageQueueRunning.
    Improved: The framework now discards older incoming unreliable updates. By default, everything past the newest 20 unreliable updates (like pos syncs) gets skipped. Reliable data is not affected.
    Changed: RPC calls now can be called without any parameters (null), too.
    Added: PhotonNetwork.SendOutgoingCommands() which is useful to send RPCs before the client will load (and suspend sending) for a while.
    Updated: To new Photon client library v3.0.0.6.

    Hope this helps you all :)


    Gnoblin: We will think about it. I'm not sure if this would have side-effects. Until then, you should be able to move it yourself, no?
  • Is it possible in one of the future updates to add a Unity RPC option to send to everyone (including back to the sender?). I'm a rookie so I may be way off base, but I think that might in a way make it so I can use Photon as the server itself... kinda thinking sending movement keystrokes to Photon and then having Photon broadcast them back to everyone including the player and having the player movements based on what is sent back.

    Its probably not exactly equal, but should be pretty darn close for all players. I'm having a heck of a time with network rigid body predictions and I think this would eliminate or maybe reduce alot of it
  • It seems that there is a problem in PUN 1.4 related to instantiation.

    The following error appears, when a client tries to call PhotonNetwork.Instantiate after joining a room:

    OperationResponse 253: ReturnCode: -1 (Invalid cache operation 4). Parameters: {}
    UnityEngine.Debug:LogError(Object)
    PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:121)
    NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:816)
    NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:832)
    ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
    PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:75)

    This also happens in your own DemoWorker testGame scene.

    Whether this is because, you've made changes to the PhotonServer SDK that you haven't yet made available, I'm not sure. I'm running a local Photon 3-0-12-2468-RC4 server.
  • It seems to be working, when I run the game on the cloud, but that I need a new Server SDK to host my own games.
  • Yes, I also noticed that we need to update the server SDK. It's on it's way (next few hours).
  • rhamm1320:
    It is possible to call the RPC for everyone already. This is currently done by sending the RPC to everyone else and then calling the RPC locally.
    It eliminates the lag for just the sender, which I guess gives you the trouble you see.

    I'm not sure if we want to change this behavior - this is still to be discussed.

    You can change the code of the Photon Unity Networking package though. It should be easy to spot the RPC places, use PhotonTargets.All and then comment-out the places where RPCs are called locally. Then you're done.
  • The new RC5 server is now also available. Please update if you host yourself for Photon Unity Networking v1.4.
    http://www.exitgames.com/Download/Photon
  • Gnoblin: We will think about it. I'm not sure if this would have side-effects. Until then, you should be able to move it yourself, no?
    Sure, this is just a suggestion!

    Can I continue to use PhotonCloud if my PUN version is still 1.3?
  • Thanks for the update, it's running smoothly now :)
  • Yes, the cloud is compatible with pun v1.3. It's better to use v1.4 though, if possible. It has too many fixes in comparison.
  • I am still doing tests with 1.4 but I see a BIG improvement in the engine! Much more stable and smooth than ever! I am using it with cloud and it is running fantastic!

    Thanks for this update!

    PS: Just one question though about cloud: Where are the server located? Because I am getting a ping of about 170ms - 250ms here in Brazil.
  • They are currently in Chicago but that's not the final location. We will host them in several centers around the world and then will be able to offer a much better ping.

    Good to read that the improvements are obvious :)
  • gnoblin wrote:
    Is it possible to move .userprefs to Assets folder so it could be synced via Asset Server? :oops:
    What .userprefs file do you mean and what is it used for?
    I'm not aware of any prefs that are saved to a file outside of the editor.
  • Tobias sent me a PM telling that this .userprefs is related to monodevelop - so probably I simply misunderstood what's going on. Sorry!

    Btw, Tobias, I can't reply your PM as you have them disabled :).
  • Ah, right. I didn't want PMs :)
    I try to answer as much as I can but not as 1:1 support.

    Good to know this is clear then!
  • I just uploaded RC5a (note the "a") as fix for RC5's memory leak. This is important for those who don't use the cloud.
    RC5a is compatible with PUN v1.4, too.
  • UPDATE - I only got this error while working at a coffee shop. If I change to a different wifi hotspot everything works go figure ?
    I download 1.4.1 and updated the DemoWorker example and I get the following connection error:

    Connect() failed: System.Security.SecurityException: Unable to connect, as no valid crossdomain policy was found
    at System.Net.Sockets.Socket.Connect_internal (IntPtr sock, System.Net.SocketAddress sa, System.Int32& error, Boolean requireSocketPolicyFile) [0x00000] in <filename unknown>:0
    at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0
    at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0
    at System.Net.Sockets.Socket.Connect (System.Net.IPAddress address, Int32 port) [0x00000] in <filename unknown>:0
    at ExitGames.Client.Photon.NConnect.StartConnection () [0x00000] in <filename unknown>:0


    And
    Received unknown status code: SecurityExceptionOnConnect
    UnityEngine.Debug:LogError(Object)
    PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:121)
    NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:816)
    NetworkingPeer:OnStatusChanged(StatusCode) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1160)
    ExitGames.Client.Photon.NConnect:StartConnection()
    ExitGames.Client.Photon.EnetPeer:Connect(String, String, Byte)
    ExitGames.Client.Photon.PhotonPeer:Connect(String, String, Byte)
    NetworkingPeer:Connect(String, String, Byte) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:170)
    PhotonNetwork:Connect(String, Int32, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:538)
    PhotonNetwork:ConnectUsingSettings() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:494)
    MainMenu:Awake() (at Assets/Photon Unity Networking/DemoWorker/Scripts/Menu/MainMenu.cs:24)
    UnityEngine.GameObject:set_active(Boolean)
    EnableScript:Awake() (at Assets/Photon Unity Networking/DemoWorker/Scripts/Menu/EnableScript.cs:27)
  • Obviously, your server's port 843 TPC was not available:

    Connect() failed: System.Security.SecurityException: Unable to connect, as no valid crossdomain policy was found

    This is required by webplayer builds. Open this port to the respective network(-type), then it will work.
  • I was connecting to the cloud
  • Then the timing might have been bad enough to get into an update. This is not happening anymore, right?
    We will implement a "status" page soon, then you can check if we are maintaining the service or if everything should run smoothly.
  • I can see there has been an update of PUN to 1.4.1 and the Photon server SDK to RC7.

    Any release notes available for the two?
  • The release notes for PUN 1.4. are in the Asset Store (when you click the version number) and here:
    http://forum.unity3d.com/threads/101734 ... Networking

    The RC7 update fixes a issue with peer counting but aside from that, I didn't get a proper change list. Sorry.
  • Tobias wrote:
    The RC7 update fixes a issue with peer counting but aside from that, I didn't get a proper change list. Sorry.

    Are there release notes available for the RC's? I just recently updated to RC6 since I was informed of a memory leak, but it would be nice to see what has been updated in each of the RC's. Perhaps I just don't know where to look for it, but if the release notes can be found somewhere for RC7 and any upcoming updates, I would be interested in reading them.

    Thanks,
    Michael
  • On Asset store is version 1.6? why this thread is still here?
  • How can I change the sendrate of the network? So the data gets send more often.
  • on the client through PhotonNetwork.SendRate etc

    on the server you can't if you use the cloud, it would be a matter of configuring it.
  • Please note: The Cloud offer has a message cap per second and room. A high send rate means you reach this cap earlier.
    http://blog.exitgames.com/2011/12/photo ... -feb-2012/

    Better think about how you can make less updates give a smooth impression.
  • I have feature request!

    Would be great if you could switch between Photon Network and Unity Network in runtime easily

    So it would be possible to play on Android phones on LAN without Internet connection