Photon Unity Networking Get it. No server setup needed - runs in the Photon Cloud. No obligation due to free plan. Download from the Asset Store: http://u3d.as/2ey Overview This package implements Unity's well known networking API on top of Photon. Keeping the API simple, this gives you standalone, dedicated servers, fixes, tweaks and ongoing support. This "plugin" 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! Requirements Unity v4.7 or up. Export to Standalone, Web, Win 8.1 Store, Win 8.1 Phone, UWP and more. Unity 5 exports PUN Free also to Android and iOS. Unity 4 exports to Android and iOS with the PUN+ package or "Unity Pro" licenses for mobile. Server Options Photon Cloud Service: www.photonengine.com/en/Realtime Free for 20 concurrent users. Photon Standalone server: www.photonengine.com/en-US/OnPremise/Download Free 100 concurrent users (CCU) license. Registration required. v1.83 (13. April 2017) Fixed: A bug of v1.82, which caused disconnects. v1.82 (12. April 2017) Fixed: Memory allocation in OnSerializeWrite(), when the view doesn't write data to the stream. Removed: Conversion Wizard for very old Unity Networking projects of Unity 4.x. There is no automatic conversion possible for Unity 5.x "uNet" networking. Moved: hasVoice and hasChat values are now in the general PhotonEditorUtils as HasVoice and HasChat, available to more Photon editor-classes if needed. Also, make sure to use HasCheckedProducts. Added: RoomOption.DeleteNullProperties. When set to true, the server will delete Custom Room properties, when they are set to null as value. Defaults to off/false but can be really useful to keep the number of room-properties in check. This becomes available on the Photon Cloud after the Easter holidays. Fixed: Room.SetCustomProperties() to delete keys with null as value (the client that was setting the custom props did keep the key/value until until it was updated). The callback OnPhotonCustomRoomPropertiesChanged still has the keys with null values. They just don't get stored in Room.CustomProperties anymore. Changed: Interest Groups IDs are now of type byte, as used by the Photon servers. It was an integer before but for the wrong reasons. This affects PhotonView.group, PhotonNetwork.SetSendingEnabled() and PhotonNetwork.SetReceivingEnabled(). The method SetReceivingEnabled is replaced by SetInterestGroups(). When you update, make sure to use the correct order of parameters. Changed: UtilityScripts folder. Some scripts were not useful and got moved or deleted. General clean up. Removed: PlayerVariables script content. It's completely replaced with the ColorPerPlayer script, which is more versatile. Added: Checks of mandatory configuration values for console exports to make sure no setting is missing. In doubt, look out for error logs or a NotSupportedException on connect. Fixed: The server selection "Best Region" now supports clusters, if sent by the Name Server. Clusters are optionally used by Exit Games as set of machines in a region. As before, PUN only stores the best region, not the cluster. The idea is that this automatically selects a fitting region (not a specific cluster). Added: PhotonNetwork.CloudRegion to make the currently used Cloud Region accessible. This is mostly to expose existing values and to make debugging a little easier. Updated: To Photon3Unity3D.dll v22.214.171.124 with some additional improvements in terms of memory usage. v1.81 (16. March 2017) Updated: Basic Demo Launcher.cs: removed Log Level setup, it's now done in the Photon Settings. Updated: Chat Demo ChatGui.cs: removed running in background setup, it's now done in the Photon settings. Fixed: NetworkingPeer.cs: Fixed Scene Object OwnerShip transfer on late Join. Fixed: ColorPerPlayer.cs and ColorPerPlayerApply.cs for a more robust connection with PlayerRoomIndexing.cs instance. Fixed: Ownership handling when returning to a game. Updated: Setting the log levels via code will now override the logging settings ("Pun Logging" and "Network Logging") from the PhotonServerSettings config. Updated: Demo Hub scene to better highlight tutorial links versus links to online documentation. Updated: Link for PhotonAnimatorView trigger doc url. Added: Callback OnOwnershipTransfered. Called when a PhotonView Owner is transfered to a Player. Added: Callback OnPhotonPlayerActivityChanged. Called when a remote Photon Player activity changed. This will be called ONLY is PlayerTtl is greater than 0. Check PhotonPlayer.IsInactive for the player. Added: GetCustomRoomList(). Enables you to fetch a short, filtered list of room names from an "SQL lobby". Fixed: Basic Demo Launcher: Fixed 5.4+ SceneManager OnSceneLoad callback to not throw errors when coming back to the demo hub Fixed: ColorPerPlayerApply.cs: Disable routine was not safe and would throw errors Changed: WebGL exports will now use secure https "GetPing" requests. This enables Best Region for content on https hosting. Changed: The fallback thread to keep connections doesn't have to run when in offlineMode. Updated: The Photon assemblies to v126.96.36.199, which includes several fixes. E.g. "WouldBlock Exception" and "BlockCopy Exception". More info is in the release history file for the dll. v1.80 (15. December 2016) Fixed: PhotonTransformView first take routine to take in consideration what to update instead of forcing position, rotation scale no matter what. Updated: PlayerRoomIndexing.cs to account for potential race conditions when masterClient is transfered and new player joins. SanitizeIndexing() is now in place. Fixed: Fix ownership management for scene objects when MasterCLient is/was changed. Updated: Chat demo, with new Friend Status update and message implementation available in the Interface as a friends' List. Added: "Best Region" support for WebGL exports (uses http to measure roundtrip times). This will require a server-side fix for CORS, coming in January. Working preliminary. Fixed: JoinRandomRoom() will now correctly send ExpectedUsers to the Game Server (if any were set in the RoomOptions). This fixes issues when you wanted to reserve slots in a room for other players. Added: A null-reference check in FindGameObjectsWithComponent(), which could fail in rare cases otherwise. Changed: Setting RunInBackground is now done in the PhotonSettings file. It's enabled by default but in a few exports, this could lead to issues. Added: The internal "AuthEvent". This event by the server can now update the client's token anytime (before that expires). Good for longer play sessions. Removed: Surplus debug log output. Changed: Public variable- and property-naming to PascalCase (beginning with an uppercase character) in RoomInfo, Room and PhotonPlayer class. The old naming is still available but attributed as Obsolete, so you should update asap. Sadly, this is extra work for everyone but we want to make the API more stringent. Changed: The PhotonPlayer.name is now .NickName to make it more obvious that this is not the user's ID (and might be changed at will). Removed: Obsolete PhotonView.observed. Since a while, each PhotonView has a list of observed components instead. If you have a very old (!) project, check your PhotonViews and make sure they still observe the scripts you meant to observe. Newer projects won't be affected. v1.79 (18. November 2016) Changed: PUN will no longer aggregate the data from ALL objects in a group into ONE message. Instead, a maximum of 10 objects will be sent together. The idea is to avoid huge messages, which need fragmentation. Fragmentation needs to be avoided, because fragments are always reliable (and you basically lose "unreliable" updates when you send too much). There is a new variable for this: NetworkingPeer.ObjectsInOneUpdate. Changed: As we send max 10 gameobject-updates in one message (by default), we can use a byte as type for their ID (instead of short). This minimally saves data but makes this PUN incompatible with older builds. We separate PUN versions for you so there won't be a clash. PhotonNetwork.versionPUN is inserted into your Game Version to separate players. Updated: PunTeams to keep PlayerPerTeams Listing up to date. Updated: PlayerRoomIndexing improved consistency across various network contexts. Fixed: SocketWebTcp for WebGL was time scale dependant and would stop receiving events when Time.TimeScale = 0. Updated: DemoChat UI reworked to match demo Hub look and feel. Updated: DemoHub pixel Perfect Canvas fix. Added: Two more regions: Korea, Seoul (kr) and India, Chennai (in). If you're using the hosting option "Best Region", you may want to update the configuration in your PhotonServerSettings file. Release History All updates are detailed in the changelog.txt in the package. Download Asset Store Special thanks go to Jean, Vadim, Leepo, Hamza and Olli for their great work, feedback and support. Thanks also to Caitlyn and team for getting this live incredibly fast Upcoming Support for more platforms, more useful components and lighter networking. Known Issues When you load a new scene, all instantiated GameObjects are destroyed only locally but not on the server. Anyone who joins the room later on still creates those GOs. To work around this, PhotonNetwork.Destroy your instantiated game objects before loading a new scene. Or use: PhotonNetwork.RemoveAllInstantiatedObjects(player). Changing the group of a PhotonView is only done locally and not synced. If you Instantiate a new object in a group that wasn't subscribed first, then the local client won't create the GameObject (it is culled by Interest Group). When you use multiple scenes, the viewIDs of PhotonViews in those scenes will always start at 1. Edit the PunSceneSettingsFile in your project to enter a minimum ViewID per scene if needed. Feedback is welcome! Just reply here. This post will be edited over time with more info, updates, etc.