What Unity Networking Solution Should I Use?
Vložit
- čas přidán 6. 06. 2024
- Today we'll be delving deep into some basic multiplayer networking as well as going over some of the popular networking solutions in unity to determine which one is right for you in your multiplayer projects! Hopefully this helps you with your game development journey into multiplayer!
___________________________________________________________________________
Be sure to like and subscribe for more game dev content!
For updates, follow my other socials!
Twitter: / khodowstudios
IG: / khodowstudios
00:00 Introduction
01:26 Multiplayer Components
02:34 Multiplayer Models
06:11 Multiplayer Solutions in Unity
09:55 Conclusion - Hry
Just the video I needed! Thanks!
found your channel via the algorithm, prepare for 15k+ views
Really useful video! I think that Mirror is a great solution for not so complex games.
Very good video! Good job bro!
open source solution like mirror,fishnet is great if you willing to learn beyond multiplayer and don't mind dealing with Kubernetes but just getting it deployed in a single server instance is good too
I'm using photon when I multiplayer. Great video. Learned a good lot :D
Is this easy for voice chat and multiplayer?
Yes!@@idontunderstandnihongoqwq940
Nice vid good Quality :D
This is a great video thank you.
Ive also been looking for a video explaining the programing logical differences between setting up singleplayer vs multiplayer and what practices I should implement while coding a singleplayer project that would make it easier to switch to multiplayer if I decided to.
Thanks so much! 😄
a few...separate out input from character & vehicle control and movement code, so you can pass it in from the player, or any player or from Ai. Do the same with creation of all objects, characters, projectiles... and pass in the creation data as a class/struct that can be easily sent across the network. include the player/owner ID with everything. Try to make your code deterministic, not random. ITs easier to keep things in sync ( or looking in sync ) across machines.
Hi. Thanks for the video. I'd just like to ask a question though as I've found conflicting information. From what I've read, Pun 2 and Fusion are Hybrid models (Client-server p2p) as a client always needs to have ownership of an object in order to run logic on it. Is this statement accurate of is the information I've been finding on this incorrect and you're actually able to run logic on the server without a client owning it?
Good vid! 🙂
Saw the video on my feed.
Wanted to jump in to throw my grain of salt as I've worked professionally with networking in Unity for a while now.
We've had to use both Netcode for game object and Photon Pun2 on different projects.
Netcode still has a very long way to go compared to photon's solutions.
It's getting there, but with photon you can just plug and play so much stuff that you have to code yourself with Unity's solution (lobby/Relay especially).
With Pun2, if you want a lobby and you know your way around the base concepts of RPCs, you can make a solid reusable one in a couple of days, alone, easy peesy.
With unity, it took one of our guy something like 1 week and a half of fighting the code base to get the bare minimum of a lobby for delivery.
After that, it all comes down to a price question.
What can you afford for your project.
Whichever you choose, the knowledge transfers very well from one solution to another. As well as from one engine to another. Rpcs are Rpcs, netvars are netvars, and so on.
Thanks for sharing your knowledge!
You forgot one: Making the backend yourself^^
It's the hardest solution, but at least for turn based games this could be an option.
I don't really see the point though unless you just want to learn and play around. You can easily build a turn based games on top of any of these APIs with RPCs or custom message channels.
@@mattseaton5832 it's more cost efficient and scales better. Turn based games use nearly to no traffic, so you can handle lots of players at the same time.
The premade solution are payed via active players count, so they are all more costly.
@@KeyboardKrieger if you mean hardware servers, ok. I thought he meant software.
are there like any tutorials on how to do it?
@@azrail7896 I don't know any for real time stuff. But for turn based you basically just need an API or a signalr connection. If you know how to do this for regular software it's no problem to transfer this knowledge to unity
I really want to use Unity's own networking but I just can't trust them.
Unity has a history of deprecating systems without having made replacements beforehand. The older Unity Networking systems received the same treatment. How do I know they won't deprecate this system in two years either?
Same. But I do think their solutions will stick around this time. The bigger issue is how long before they get the features you need. Fishnet already has CSP, rollback, network LOD, etc.. But I really want to use NGO just because there's so much code available in their example projects. But I don't have the time or knowledge to build all these features by myself.
I wish you included more details for Pun 2, Fusion and yes, Bolt. Bolt and Fusion are both newer and support things that Pun 2 doesn't, like client-side prediction and lag compensation (see their feature comparison page) and Pun 2 will only support Unity 2019 - 2022. That said, the pricing for Pun 2 and Bolt are cheaper than for Fusion for the same CCUs.
@@KHodow No problem. Have a great week!
Also, you should've included Photon Quantum. Even tho it's still premium (so you pay 250$ per month to use it), it's by far the most superior solution I've ever worked with.
Except its awful unless youre making a 4 player lan game or a host-client game. If your game needs dedicated server you cant use any of these solutions youll need to either roll your own pure code server side API or use an existing one like smartfox
mirage, the only sensible >FREE< solution currently with server authoritative architecture
Hi great video thanks, maybe you can help me. i'm working on a turn based game meant to be deployed as webGL, i started with Relay but i realized the Unity Transfer protocol is not supported in webGL. What do you suggest using?
i am trying to find for Pc and VR game similar to game called: Davigo, Can I get some hints on which free solution I can build such in a local network?
What about Alteruna multiplayer?
They give free servers.
I haven't heard of that one! Thanks for the tip!
Can you please explain how does pricing works ? I checked a few services but I don’t understand their pricing and I’m unable to decide which one to go for.
@@KHodow photon fusion vs netcode of unity game services. Can you help me with the pricing part. My game will be a 2D platformer
I'm making an open world game, where there is a lot of entities to manage at the same time, I also need to have the possibility for the client to Host is own game (not only dedicated servers), and so other clients can see the hosted lobbies in a lobby list (a sort of servers list) and join them. I wanted to go for Netcode for gameobjects, but not really sure if that's performant enough for what I want. What would you advise ?
Netcode is definitely one of the more performant ones. Although you'll probably want to use some kind of chunk loading and entity despawn system for something like an open world game since something like that will definitely start to lag real quick no matter what framework you use!
@@KHodow Okay thanks for the infos.
@@K3rhos Ofc good luck with your project!
@@KHodow Great video, man! Is it possible to make a sort of "server list" where players can click the "join" button to join games in Fishnet? I've been looking for ways to do that in Mirror (without using FizzySteamworks. It's difficult for me to test via Steam since I can only use one account at a time) but I couldn't find anything on it. Thanks!
Maybe a dumb question, but since Mirror is open source do I need to pay them if i were to publish a game. Or do I have to mention them in the game?
No mirror is absolutely free! Although if you use a third party service for dedicated servers, you may have to pay for that!
What happens if you go over your allowed concurrent players in pun 2
Please, please, I need more Unity's Networking content..... Especially for the FishNet tutorials.
@@KHodow there is alreadg lobby system in fishnet already made by the creator of fishnet.
FishNet is a bloated mess, it uses RPCs for everything and its full of bugs, I suggest staying away. Unless you want to make a super simple LAN game for up to 4 players.
I am planing to make a poker card game , can you suggest the best solution?
I would suggest netcode for gameobjects if you're starting new. It's pretty well supported and not too hard too use. There's a really good codemonkey tutorial on it! Fishnet is also a good option but it's a little less documented.
Is fishnet good for Voice chat? Need a Voice chat like Mirror for free or opensource
and pun if you want as simple as possible and client authoritative, p2p arch
I want to make low poly fps shooter game but I'm hesitant because I don't have money to buy servers and pay for them and I'm afraid to use unity networking xd can you help me
@@KHodow thank you
i tried fishnet, the tutorials were pretty garbage. photon 2 has been incredibly easy. got multiplayer working with other people in 2 days of light work
Yea I wasn't too keen on fishnet's documentation either. Although in it's defense, I probably could've put more effort into learning it! Good to hear that you got photon working well! 🙂
normcore on top
Unity gaming services are restricted in my country how can i make my game online?
Fishnet mirror photon…
How about netcode?
good choice
6:02
so what's the solution thas used in brawl star
@@KHodow so Can I make a game similar to brawl star with netcode or photon?
@@KHodow thanks you much
Happy to find your channel
Normcore
Fish is full of bugs and the framework is a mess, loads of bugs aswell. Its OK if you want to make a 4 player LAN game, anything even remotely more complex will be much easier to make with other solutions.
Grammer: which^
not useful , information is so narrow, with this i can not decide which is good choice... but thank anyway
You said nothing
Wtf are you top Comment for us? No offense, but… Screw you, dude. At least he’s trying to contribute to the public forums in a legit and constructive manner. Whereas you do not, from thus-far interactions. Sure, it’s basic stuff. But basic stuff is still super important to explain in an engaging manner. This dude did better than many other YTers that have tried. You make a vid and get back to us, eh?
Edit: Added “no offense”