D
D
Dmitry .2020-11-28 16:28:58
Game development
Dmitry ., 2020-11-28 16:28:58

How do match sessions work in online games?

I'm interested in a game dev question: How do match sessions work in multiplayer games?
Is every game session with 10 players a new process on the server? Or is it implemented in some other way?
I want to write my own multiplayer game for training and I don't fully understand this question.

I hope for your answer.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
dollar, 2020-11-28
@MrProper5050

Depends on the number of players and the game itself.
Taking into account the fact that individual sessions are independent of each other (they are not connected in any way and do not affect each other until the end), it is beneficial and true to do it in separate processes or threads . At the end of the session, its results lead to a change in the database, which may affect the next session (matchmaking, initial conditions, etc.)
But if there is some tricky mechanic that links the sessions, then this may not be an option .
Also, a separate session can be achieved in a situation where one of the players is, as it were, a server ( host). In this case, a separate server is practically not needed. You only need a server for the selection of players (matchmaking), and then they support the session themselves.
With a large (huge) number of players, one server is not enough at all. Then you already need to think about how to scatter sessions across different servers. Thus, the session selection is one server, then it sends the players the information on which server they will play on, as well as the keys to access this server, and then they interact with a specific server. And nearby there are other servers for sessions. Something like this. In general, it is very similar to the situation when one of the players hosts, only official servers from the game developer are used.
The most difficult option is, of course, an MMO with an open seamless world. There are thousands of players in the same world, but they can overlap over time, although most of the time they are far apart and do not touch. They use tricky server distribution algorithms. But if all the players gather at one point, then most likely everything will break down. Thank God it's unlikely that all the players of a conditional game server (consisting of many physical ones) will want to gather in one place.

S
Saboteur, 2020-11-28
@saboteur_kiev

Is every game session with 10 players a new process on the server? Or is it implemented in some other way?

Differently.
It may be a separate process.
Maybe a separate thread.
Maybe one process for everything.
Depends on the game, on the match, on the requirements for performance and synchronization.

F
freeExec, 2020-11-28
@freeExec

Well, imagine creating a process for 10 players and uploading a 10GB map to them. Q: How many maximum players can play on your server?
Or vice versa, here you have 4999 players and 1 mum hacker. And now he sends a crooked request to a server and it crashes. Question: how many players were left without a game?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question