![]() It’s called when PUN gets you into the lobby. One of the callback methods in PUN is OnJoinedLobby. Type PhotonNetworkingMessage, followed by a period character (a dot), and a dropdown will list the names and a description. So autocompletion in MonoDevelop can give us a quick hint which methods our script might have. ![]() There is also an enum with all those method names in code. The list of methods PUN will call can be found in the documentation. Currently, we are interested in something like “arrived in the lobby” or “found a room” and “didn’t find a room”. Like Unity, PUN will call certain methods in our code when something interesting is happening. This makes it easier to find the scripts later on and we don’t rely on the camera being active all the time. We create a new, empty GameObject and name it “Scripts”. ![]() With a minimum of GUI, the code looks like this: If started this would get us connected and into the lobby. The gameVersion should be any short string as identification for this client. This will read our settings and use them. We did the setup with the Wizard, so we can use PhotonNetwork.ConnectUsingSettings() and pass “0.1” as gameVersion. It’s similar to Unity’s Network class and contains almost all methods we’re going to use. The most important class in the PUN package is called PhotonNetwork. Create a folder “Marco Polo” and a new C# script: “RandomMatchmaker”. The Photon Cloud is built with “room-based games” in mind, meaning there is a limited number of players (let’s say: less than 10) per match.īefore we do anything else, we need to get our players into a room where we can move around and let others know about it. Even though Photon Cloud is not completely free, the costs are low, especially compared to regular hosting, and you can find subscriptions available on the Unity Asset Store . Servers are added on demand, so any number of players can be dealt with. This “cloud” of servers is maintained by Exit Games and offered as hassle-free service for your multiplayer games. So, what exactly does this “Photon Cloud” do?!īasically, it’s a bunch of PCs with the Photon Server running on them. Click “Setup” in the Wizard and copy & paste the app ID”. If the address is known, we registered it before fetch our “app ID” from the account page. For now, we just enter our mail address and the Wizard does its magic: If the mail address is unknown to the Cloud, we will get an “app ID” right away. You can use the free 30 day subscription without obligation. During import, un-check the “DemoWorker” folder (and the complete sample). Get the Photon Unity Networking package from the Asset Store. Best of all, it comes with a 6 month, 100 CCU cloud service subscription! Preparation If you like the workflow, you can get the free intro package , including one month of hosting, or you can get a running start with the comprehensive Photon Networking Guide, a starter kit with in-depth tutorials by expert Unity educator and author of the Ultimate Networking Tutorial, Mike Hergaarden. In this tutorial, Exit Games developer Tobias Schweers explains how to use the new Photon Cloud multiplayer network service to create a fun game inspired by the classic children’s game, Marco Polo. If you still have trouble you should rather directly contact the makers of the asset.Exit Games is a well-known provider of high-performance network multiplayer server and hosting solutions both inside and outside the Unity development circles. There might still be some changes to do and I'm not saying this will completely fix that asset. See Packages for more information about the PackageManager and packages in general. In order to still be able to use the HLAPI for now you have to go to the PackageManager ( Window → Package Manager ) and find and import the Multiplayer HLAPI package. It will soon be (almost) completely deprecated. This has been ** known for quite a while** already. I would suspect maintanace kind of stopped quite a while ago and there will at minimum be some severe hickups in implementing it into most latest Unity versions over 3 years later. When using an asset from the Asset-Store that says Unity version 5.2.1 or higher. You should rather make incremental step-wise updates and also when you do be aware of what changes each version in between brings. you can expect a lot of API changes between over 3 years apart software versions in general. You shouldn't make huge jumps in Unity versions.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |