Download

Handling Multiplayer for a FPS

How’s it going! Not sure where to post this as the other subjects don’t cover this. So… where to start. A couple of my friends and I have just finished college, computer science, and we want to build a small FPS and develop our programming skills in the process while learning Unreal, a couple of birds with one stone.

The game is going to need to be able to accommodate 20-30 players. The game being a FPS it will need relatively fast response times.

The server architecture is the most daunting for us at the moment. Unreal has a built-in dedicated server architecture, but is this enough or will there be problems down the road when the game begins to get heavier. There are multiple subjects that need to be looked at, client-side prediction. server reconciliation, entity interpolation, lag compensation, all of these taken from the article gabrielgambetta.com. Are these systems that are integrated with Unreals built-in network architecture, or is it something we would need to build ourselves. If it is, where do we start?

Fortnite has 100 players and uses Unreal Engine and its server side. So i think that should say enough. Prediction of shooting, etc would need to be handled yourself. Character movement is already predicted and can be extended to accomdate different things, like floor sliding, etc.

I started devolving an online FPS myself recently, already having to shipped games under me i gotta say you guys are very brave if you are going to start with a multiplayer game from the get go.

One of the thing i learned from searching is that if you want to build something like the multiplayer games we have today with matchmaking and ranked play the architecture is kinda different from what you might imagine, first of all your not gonna have 1 unreal server, your are gonna have multiple servers, 1 per match to be precise. The matchmaking aspect and room creation should be coded by yourselves (some c++ sockets that talk with unreal i assume) OR you can use stuff like steam or amazons gamelift (the one i am considering tight now).

Another thing is that you are not gonna code the the server itself, all the server logic is done inside the unreal engine itself (client but not exactly), some unreal classes like the gameMode only exist in the server while some exist both in the server and the client, honestly is confusing and i am still trying to get my head around it too.

I believe most of the stuff that you mentioned like lag compensation and prediction you don’t have to worry about, unreal’s server probably does a good enough job to handle all that unless you wanna build something very different from the engines purpose.

One server can run multiple matches each match just needs a unique port.

A GameMode can exist on a client while the client is not connected to a server, however when connected to a server the client won’t be able to get the GameMode since it is only spawned on the server.

You do have to worry about lag compensation and prediction, the only exception is if you use the CharacterMovementComponent since this giant component has it built in.

Can you elaborate on a server running multiple matches on different ports? i was under the impression that, that wasnt possible, i saw somewhere that the guys that do rocket league have multiple servers on multiple ports all waiting for players to join.

When you launch a server you can set which port to use and when a client join it uses the server IP and Port number. The port number should match the game session / match you want to join.

A matchmaking server can be used to list or match players looking for a game automatically and would direct the players to the IP and port of the server available.

Oh so you were talking about the actual physical server, when i mentioned server i was talking about the actual software, thats why i was confused.

Oh right. Yes sometimes I also use the terms interchangeably but a Server should refer to a device (or virtual machine) and a Game or Game Session is a process running on said device.