0
\$\begingroup\$

After a long break, I am now trying to learn some basics in networked gaming in Unity. I've installed the latest beta client (because I want to ultimately make a network multiplayer game but it will be many months of learning and building barebone prototypes to ensure I can get game objects spawning correctly and be controllable by the correct client etc etc

I have some experience in Unet, by extending the NetworkBehaviour class. I don't remember exactly but there were things such as [Client RPC] and [Command] and also OnServerStart() methods etc.

But I am aware Unet is being removed. And I tried to extend my class from NetworkBehaviour (I also tried NetworkBehavior lol) and it doesn't recognise it anymore.

So what replaces OnServerStart() method and [ClientRpc] instruction? Ideally I want to use a Dedicated Server solution (which I will run on my own computer in order to play small tests online of my game). The game im trying to make to start off with is extremely simple. The 'player' is just a capsule which can shoot small cubes and give damage to other players. Also the player object 'you' are controlling will appear blue, but all the other players will be grey.

Using Unet I was able to make the above small game idea work. But now I am unable to.

\$\endgroup\$
  • \$\begingroup\$ We don't answer "where to start" questions \$\endgroup\$ – Bálint Mar 17 at 16:26
  • \$\begingroup\$ i will rephrase it \$\endgroup\$ – Big T Larrity Mar 17 at 16:27
  • \$\begingroup\$ Why vote to close the question when editing one sentence was all that was needed? \$\endgroup\$ – Big T Larrity Mar 17 at 16:33
  • 1
    \$\begingroup\$ Because I don't know what you are thinking and rephrasing the question might stray from the original intention \$\endgroup\$ – Bálint Mar 17 at 17:05
  • \$\begingroup\$ hmmm, well i just removed the "where to start" part of the sentence and left the rest of the actual question as is. I do acknowledge the question is rather messed up and confused, but sadly that reflects my situation because the more I 'research' online the more confused I've become on this issue. (Hence asking here for you kind folks' help) :D) Anyway, I have found an open-source solution which I am now studying hard called MLAPI on Github and I am hoping I can learn it and find a way to solve my problem. thanks \$\endgroup\$ – Big T Larrity Mar 17 at 17:08
2
\$\begingroup\$

As of right now, there is no production ready replacement for UNET. UNET is currently deprecated. UNET has four main components, HLAPI, LLAPI, relay server, and legacy matchmaking. The HLAPI will be last shipped with 2018.4 LTS and supported until early 2021. The LLAPI will be last shipped with the 2019.4 LTS and have support until Spring 2022.

Therefore, unless you’re using a beta, UNET is currently deprecated but in the engine as of writing this post (2018.3.8 is the current official release). If you’re having problems, make sure you import the correct namespaces.

The new networking system is currently in alpha. You can can read about it here and see the source here.

Here is the transition timeframe: Unity Networking Time Transition

Currently, the official advice is:

What should I use if I am making a multiplayer game today or have already shipped a multiplayer game?

Already launched: If your game has shipped and uses our Relay service, it will continue to run as expected until at least Spring 2022. By that time, we will either extend the Relay service or provide a clear transition plan to new technologies.

To be shipped in the next 0-6 months: If you’ve already completed most of the work on your multiplayer game using the LLAPI or HLAPI, it is okay to ship it using the 2018.4 (LTS) or prior versions of Unity. However, P2P architectures of all forms struggle with scalability, inconsistent connection quality, and hackable clients, so we recommend most games move to a dedicated server model if possible.

To be shipped in 6+ months: You should immediately consider moving to dedicated servers to determine what it will take to create a server-authoritative version of your game. Stay tuned for more details soon about the upcoming Preview packages to build your game with the new networking, dedicated servers, and matchmaker.

From here.

Additionally, there are other networking alternatives such as Mirror which strives to mirror UNET while providing fixes and improvements.

\$\endgroup\$
  • \$\begingroup\$ Hi there, thank you for this information. I had already seen this but it confused me since we are in 2019 now and the graph states 2018 for the "New Multiplayer Features". I have started to use Mirror and MLAPI. If you are able to please could you check my new question here as I have trouble syncing the rigidbody I am using as a hockey puck (spawned network object with rigidbody) gamedev.stackexchange.com/questions/169257/… --many thanks \$\endgroup\$ – Big T Larrity Mar 22 at 0:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.