Hello,
i am currently trying to set up Multiplayer for my game, in which i have chosen to take the dedicated server route.
this means that if a game of 2 players is running there will be only one instance of the game on the server where the server will only recieve input from the clients…
(please correct me or update me on this info)
i would like to know what is the best method for running an instance of a unity game on servers to increase max potential instances on each server, considering they are 8 core 16 thread…
also how is the best method to set up my game for the server…
im considering linux as the operating system this since i read that it is better…
also i would like to know if photon server or any other of the like comes into play in this scenario.
also is this a hard process or is it as simple as installing the game on the server and running it, and connecting clients and user input?
(obviously with a few extra steps)
thanks in advance
The “best” method depends on your game.
For example, if your game was a card game, where you don’t need things like server side physics or even server side representations of gameobjects at all, you could potentially have thousands of players in hundreds of games all connected to the same server applications running all of them. In that case it wouldn’t necessarily need to be a Unity build at all.
If you want things like server authoritative physics, or other Unity features on the server, Unity isn’t really set up for running multiple independent scenes at the same time which won’t interact with each other, so you’re probably going to go with a separate instance of the server app for each match and a master server coordinating. I haven’t used Photon, and there’s a few different iterations of it, but for something like physics I think you’d have one of the clients handle it since the photon server itself doesn’t have its own physics engine last I checked a few years back.
As far as a single instance of a game running on your own server, in its simplest form yes it is as easy as installing the game on the server and running it, then having clients connect to its IP address. A master server managing server instances complicates it a bit.
1 Like
Since I am currently reading into the same topic, I got a question towards this here:
I hope it’s okay, EliJNemer, if I add a follow up question:
My project is supposed to end up as an RTS game. Generally, peer-to-peer was/is recommended for something like this but it seems that because of the complexity that emerges with the Lockstep Protocol, and also improving bandwidth for more and more people, a server-client solution becomes more viable.
By “separate instance”, are we talking about a headless instance (the game without rendering) which runs as an authorative server (with physics simulations) for other players or how can this be understood?
In any case: Is there anything that can get me going with a dedicated server for a Unity game? I find it hard to get started since most tutorials or blogs use the standard NetworkManager (peer-to-peer) approach.
yes…
im not exactly a reliable source of info on this, as in my own project i am attempting to make a dedicated server solution but i am currently considering changing to peer to peer approach since i found it a little difficult and am going with the simpler is better motto…
if i were to do a dedicated server, with the info i have procured up till now. i understand that there is AWS Gamelift, which is good with the server infrastructure, i was using photon bolt for callbacks and such, and playfab for client logins and personal preferences…
(as i am not a pro, please anyone feel free to correct me)
1 Like
Hi!
I have found an interesting project (GitHub - Unity-Technologies/multiplayer: Unity multiplayer packages and samples) which might be a good starting point. It seems that it allows a dedicated server and client build on the new DOTS stack. I admit, there could be more documentation but maybe it’s a good point to start.
However, I do not know whether this is suitable for an RTS with a high unit count nonetheless.
NetCode docs: Unity NetCode | Unity NetCode | 0.0.4-preview.0