Photon PUN+
PUN implements Unity’s well known networking API on top of Photon. Keeping the API simple, this gives you dedicated servers (OnPremise or in Photon Cloud), fixes, tweaks and ongoing support.
This package contains a setup wizard, the fully integrated API, Editor extensions and the client library. It’s compatible with the Photon Cloud Service, so you don’t even have to setup a server!
Photon Unity Networking Plus (short: PUN+) enables exports to Android and iOS from Unity 4.7.x Free and upgrades a Photon Cloud Free Subscription to 100 concurrent users for a one-time price. The CCU upgrade stacks with a paid subscription.
Unity 5 does not need a special Unity license to export PUN to mobiles!
The Small Print
The upgrade of a Free Photon Cloud Subscription is not fully automated. Please follow the simple instructions in the readme.txt.
Only one Free Subscription can be upgraded for one title/game. This offer can not be applied to Photon Server licenses.
Any number of titles/games can be exported to iOS and Android with PUN+ of course.
Compatibility
PUN+ is compatible with the free PUN package. Both use the same API and will be updated alongside each other but you should make sure you use one or the other.
PUN+ in Unity 4.7 can’t use TCP as protocol. All exports with the native plugins must use our reliable UDP protocol.
Photon Chat is now included!
Updates and Change Log
Always backup your project before updating PUN. Read the changelog.txt which is in the package.
Feedback is welcome! Just reply here.
This post will be edited over time with more info, updates, etc.
I just uploaded a new version.
The biggest change is that we now have a “Unreliable On Change” mode for syncing positions or script-created updates in PhotonViews. It’s the default case for new PhotonViews. With it, updates are sent unreliably while the sent data changes. When the logic detects that nothing changed, it sends a final update as reliable and skips further updates until the synced data changes again from update to update. With the final reliable update we make sure all clients get the final state before we drop sending news (which aren’t news at all). This is (e.g.) good for objects that sometimes move but also might stop moving.
Check out the other news, too:
v1.24 (18. October 2013)
Changed: CustomTypes is now endianness independent and also streamlined
Added: New synchronization mode “Unreliable On Change”. It’s basically a mixed mode which uses unreliable when things change. When the data doesn’t change, it’s sent a last time in a reliable mode, so everyone gets the final state for sure. Then, similar updates will be skipped. This can be applied to anything observed: Transforms, Rigidbodies and even scripts.
Changed: The new “Unreliable On Change” observe mode is the default for any new PhotonView. Existing PhotonViews on prefabs are not changed but you might consider doing this for objects that might stop moving / change.
Added: New internal values for PhotonViews.
Added: JoinRoom option to create a room if it doesn’t exist currently.
Changed: JoinRoom calls OnCreatedRoom() if the room was created due to JoinRoom() option “createIfNotExists”
Added: Room.SetPropertiesListedInLobby() to set the list of properties sent to a lobby. This is useful when createIfNotExists creates a new room and you want specific properties shown in the room listing.
Changed: PingCloudRegions and RPC class conditional compilation to: #if !(UNITY_WINRT || UNITY_WP8 || UNITY_PS3 || UNITY_WIIU)
Updated: To new Photon assembly v3.2.2.1.
Purchased the plugin and very disappointed cause it does not work
The standard code:
_peer = new PhotonPeer(Instance, ConnectionProtocol.Tcp);
_peer.Connect(serverAddress, applicationName);
Runtime results:
Connect() failed, because SocketImplementation or socket was null. Set PhotonPeer.SocketImplementation before Connect().
NullReferenceException: Object reference not set to an instance of an object
ExitGames.Client.Photon.EnetPeer.DispatchIncomingCommands ()
ExitGames.Client.Photon.PhotonPeer.DispatchIncomingCommands ()
ExitGames.Client.Photon.PhotonPeer.Service ()
And googling “PhotonPeer.SocketImplementation” yielded nothing. I’ve tried a piece of code from NetworkingPeer.cs, it helps to avoid runtime error but also Connect() fails silently.
TCP is not supported by PUN+ at this point. I admit: We forgot to point this out clearly.
We don’t think it’s a big loss though, because our Reliable UDP protocol gives you more options and is reliable on demand.
Please give the default UDP protocol a try. If it’s no fit for you, mail us and we find a solution: developer@exitgames.com
“Do I have to change a lot to switch to PUN+?”
Nope. You don’t.
It’s the same api and you basically just replace the libraries and add a few scripts. Everything else stays the same.
I guess you’re ok with an english answer
I was looking at this asset as I don’t have Unity Pro and almost all other networking solutions won’t work in Unity free because of the lack of .NET socket support. This looks promising for indie users on the mobile platforms. Do you have an ETA when windows store/WP8 will be supported? I assume it has to do with the different .net classes available in the API on WP8/Win 8. Since one of the platforms for my game will be WP8 this would hold me back from purchasing currently.
I realize product roadmaps are high level I’m just looking for a ballpark answer on if and when there are plans for this product being compatible with the Microsoft mobile platforms.
In theory Win 8 Store and Phone could be supported already. It’s a matter of organizing the different files for the platforms.
You could copy the Win 8 related folders from PUN Free to PUN+ and in theory you’re done.
The next release of PUN+ should cover Win 8 Store and Phone out of the box.
It should be out within a month from now. It depends a bit on demand, found issues, etc.
We are currently looking into some issues with Android exports in Unity 4.3. In some cases, the app will crash with a log entry “Unable to find ‘PhotonSocketPlugin’”.
A short update on the current state of the Android-specific bug. It’s a Unity-related issue and Unity 4.2 works in all (known) cases.
Unity Team told me: “… the bug is still not fixed, but it was marked as necessary to fix. So if nothing will change, it should be fixed with the next minor update that we will release.”
Sounds good to me. I will get an update when the bug is fixed and will let you know, too.
I’ve found some references to a friends list in the photon forums, but can’t find any definitive info about such a thing. Does PUN+ have a way to remember friends, or is that possibly an upcoming feature?
The friends list is not kept in Photon. But combining Photon to some community with UserIDs you can send the list to find out if one of your friends is online and in which game he/she is.
Check PhotonNetwork.FindFriends() and the callback (which you have to implement) OnUpdatedFriendList() as well as PhotonNetwork.Friends.
Just checking in a few months later to see if this is still anticipated somewhere in the pipeline out of the box? The asset store still shows the same version so I assume WP8/win store are not yet incorporated without the need for modifying the package.
I am in the final stage of releasing an update which also supports Windows 8 Store and Phone in PUN+.
We had a bit of feature creep (adding just one feature more before release) and now we want to make extra sure we didn’t introduce issues in some exports.
I said this before but: It’s coming
I just updated the PUN and PUN+ packages in the Asset Store to v1.25.
This update has a long change list and even a few breaking changes compared to v1.24. Before you update, make sure to backup your work (as always).
The list of changes is too long to repeat here (it’s in the initial post) but some highlights that come to my mind now:
PUN and PUN+ are more compatible with each other and the PUN+ will now also export to Windows 8 Store and Phone.
JoinOrCreate is a new and simpler method to get into a room once your players decided on a roomname. You can set room properties for creation, too.
Support for multiple lobbies and types of lobbies. The two available types are what you know already and the new SQL-Typed lobby for more elaborate matchmaking.
RaiseEvent offers a way to send your own, custom messages to the others without the PhotonView context. This alternative communication is not depending on scenes and GOs.
Fixed some (but most likely not all) issues with offline mode.