Unity multiplayer, using dedicated servers

Question

Hello! I'm trying to figure out the best way i can achieve multiplayer functionality in my games. The two most popular ways seem to be Photon and Unet. But from what i understand they are both cloud based. I also seen someone do multiplayer with socket.io and node js. I wanted to ask you guys, what you think the best solution would be for me to look in to. Thanks!

Posted Sep 23, 2017, 1:53 PM UTC

37
OisannGame Dev Student at Nord University•

I disliked working with Unet as a whole. This semseter we decided to work with socket.io instead of unet that we used this spring. You might be able to host a unet server, but it's not easy or might not even be possible with your game. It works for simple games or prototypes, but I would suggest going for socket.io if you can. I haven't worked alot with Photon. I think it's a better alternative than Unet, but I don't know much about it. Working with socket.io requires a little more work, since you wouldn't get premade components.

4
BeerRush•

What do you need for your game? Low latency? High player count? High throughput? Budget? There is no simple answer to this. I've worked with UNet and it has more pitfalls then you would expect, but in general it works and there exist some Tutorials.

3
LumpySpoonOP•

Low latency and budget. Mainly, I just want to host my server, on my computer. Could i do this with UNet?

2
BeerRush•

Sure. You may need port forwarding or a VPN. But besides this, this may work.

2
Vytek75•

Please see my code based on Hazel Library: https://github.com/Vytek/HazelTestUDPClientUnity

1
dxxxi2•

would unet be okay for running a 100 max player game with base building? Sort of like rust, ark or minecraft with maps with large entity counts. I know rust is a unity game using raknet but i wonder if it's possible with unet

2
Crayz92Hobbyist•

Lidgren is a fair solution if you want to avoid using external services. The developers of Rust used Lidgren for quite some time but eventually made the switch to Raknet to increase on performance and reduce garbage, although I believe Lidgren is plenty capable of running just as fast with no garbage overhead.

3