How to create multiplayer in the game? - server

I'm creating a multiplayer FPS game on Unreal Engine 4.
And don't know one thing - if it is multiplayer so it have to have more than one player. If I want to do this should I rent a server? From which hosting?
I want to release my game on Steam - what should I do to create servers for player? I really don't know and need a steps list.
It won't be a game with a big players count, so I don't need a big and strong server.

To start there is 2 ways of doing multiplayer.
You can either do it with dedicated servers (server will calculates all actions and send them back to each clients connected to it) or you can make a specific client a "host".
Wich ever you chose depends on the type of game you want to create, an open world type of game like a survival wich needs to be up 24/7 with players going on and off from it would require a dedicated server. On the other hand a coop game or a game wich can stop when player wants with 2 or 3 players could run on a client acting as an host.
If you choose to go for dedicated servers you can work inside unreal engine and tick the "run dedicated server" in the launch menu. As for releasing it and setting up multiple dedicated servers that's out of my knowledge

Related

Unity Matchmaking how it works / dedicated Server

I create a 2D ffa multiplayer game for android with Unity/Netcode. Now my question is how i could set up a dedicated Server with matchmaking. Do i have one Unity instance who is waiting for requests. And when it received enaugh question. It creates a new Unity instance as 'real' server and send pack the port. But we only have around 64k ports. So i would realy intrested how at the end, the server is started. Or is there only one Unity instance with multiple game Scences? I know unity has a hosting/matchmaking service. But i have not much money. And i want run specific code on Server for other stuff in the game for example database and a Trading system. Maybe somebody has an idea.
Thanks for your time.Lyksel
I was thinking of openmatch but i didn't find out if i can use it on a dedicated server.

Methods to test Unity WebGL multiplayer game server scalability

I am looking for a method to test the scalability of my WebGL multiplayer game (built in Unity 3D). The game is currently based on the PUN (Photon Unity Network) library and cloud service for multiplayer communication. I would like to know how to efficiently find out if the server hardware and architecture can support, let's say, 20, 50, or even 100 players in one room, with the limited number of computers at my disposal. Ideally I would like to know the frame rate each player will experience. I do have access to some powerful servers. A preliminary idea I have now is to run a bunch of virtual machines on these servers, each of which runs a browser tab with the game. Just want to know the industry practice or what you think would work. Thanks!
Framerate is hardware dependent and if you are sending data to the server EVERY frame you are doing it wrong.
Basic premise on doing it right would be, a player shoots a projectile..
Get its spawnpoint, direction and speed and then pass that to the other players/server to then process without the need to send data each frame.
This is a simplified example but gets the point across.

Multiplayers online game (MMO) | Architecture | Learning Path

I want to learn game development.
I'm coming from Web, Desktop and Mobile Applications.
where is no really REAL-TIME programming.
And all architecture templates and life cycles is very different.
Now I have 1 idea for game. I don't know if this will very good game, but for first game my main goal is - Get experience
My game is online game with 2 players.
The players has cards (like in Clash Royal) and will player release the card - game need to do something.
Now question is in Architecture....
In applications that I made - all business logic was on SERVER SIDE..........
But If i understand right - here is Game on Players phone do all business logic..and server is just "message provider" ??
The second question is - If I have to use online service (like Photon) or build my TCP/UDP server.. (Its not so hard and for first game I think I can do it by myself)
UPDATED:
The main question what is resources I need to read for get more information about type of Architectures in Game Dev?
Thank you for your answers.
There is no RIGHT ANSWER for your question, as there are many ways to do an on-line game, and everyone have their pros and cons, like:
Host & Clients, where one of the players is acting like a server.
Authoritary Server, where all the logic is calculated on one side, and then update the others.
If you are working on Unity I recommend you to look the different network api's over there: Photon, Unet...
You can use the server services that Unet provides, or build your own system.
But one advise: don't mess with physics on on-line games, will be punishing.

Unity5 - Make a server only for multiplayer game

I followed the Unity tutorial of an online multiplayer game (here), and the architecture is the following :
But I would like to have this architecture :
I would like to really separate the client part and the server part in an online game. I'm new with Unity and especially with online multiplayer game and I really don't know how to do that. I don't want the solution, but maybe idea of how to do that.
Thanks a lot for helping me.
I am surprised you didn't learn the Tut and post this question. obviously you can make separate server.
As unity UNet basic concept stated:
In the unity networking system, games have a Server and multiple
Clients. When there is no dedicated server, one of the clients plays
the role of the server - we call this client the “host”
Three Modes of UNet Multiplayer Game:
A Networking multiplayer game can run in three modes - as a client, as a dedicated server, or as a “Host” which is both a client and a server at the same time. Networking is designed to make the same game code and assets work in all of these cases. Developing for the single player version of the game and the multiplayer version of the game should be the same thing.
NetworkManager has funcions for entering each of these modes:
NetworkManager.StartClient()
NetworkManager.StartServer()
NetworkManager.StartHost()
Check UNetManager for more details
You can open a Unity instance as a dedicate server.
NetworkManager.StartServer();
However for current state of UNET you can only have 1 room per Unity instances.
Which mean if you want to open many game room at the same time it'll cost you a lot of hardware.
Run as headless mode (No GUI) will help you a bit but that's not enough (Currently I've done that on DO).
So my recommendation is don't use UNET if you want massive users on your game.

Is P2P or client-server architecture better for my game?

I'm about to develop a simple 2D game something like chess, checkers, or reversi. There are only simple animations of the players pieces. No complicated math nor graphics therefore I'm wondering if it is better to go with P2P over a client/sever approach.
The game will be an iPhone/iPod Touch game (and later on run in a Web browser game using Cappuccino). Two iPhone players can play when near each other via bluetooth/bonjour. Or the game can be played against other remote iPhone players via the internet, iPhone to iPhone; (and later on - iPhone to Browser; or browser to browser).
The game starts off with two players, each having an agreed upon number of pieces to place on the board.
Both players are constantly connected because the game will have a countdown timer that is set to an agreed upon time limit of 10, 20, 30 seconds in which the active player (Player A) must make a move. If the Player A doesn't make a move before the timer counts down to zero the Player A will lose his turn and the opposing player (Player B) will become the active player. The timer count is displayed on each player's screen.
The game ends when the players run out of pieces, with the player having the most pieces on the board declared the winner.
Can I please get your thoughts on which is better for my game? P2P or client/server?
To some extent, it depends on your desired feature set. For example: are you going to have "high scores" or "saved games"? Are you certain your players are going to be near enough to always play via bluetooth? If not -- how will you "connect" them to each other if they're just using the internet? Do you have server infrastructure in place now?
Also, it would be helpful to know if this is just an "experiment/toy" you're doing or something you intend to commercialize/release to the public.
At the end of the day, you can do it either way. The 'which is best' depends on your specifics.
I don't know much about iPhone development but I think it would be better to support both if possible.
For the "local" scenario P2P is the way to go. The players can easily discover each other and start a game without the hassle of setting a server and connecting to it.
On the other hand if you want the game to be playable over the internet, I think a client-server model is more suited. You can also host statistics on the server (high scores?) organize tournaments and more.
In my opinion if it is something where latency could be annoying in-game then go p2p, adding a server into the mix is just going to increase latency.
Because of the low bandwidth required per session, you could probably use a scaled server approach. I'm not familiar with iPhone development, but you can keep the application requirements on the client low with a Web standards approach. The servers can be balanced on the back end, and tied to a unique session with multiple clients connected to a session.