How do you design a client-server multiplayer game? I know how to write a simple chat application...

How do you design a client-server multiplayer game? I know how to write a simple chat application. But how does Sup Forums make their mmo's?

Other urls found in this thread:

ibm.com/developerworks/library/ar-powerup1/
twitter.com/SFWRedditImages

Clients are constantly sending status updates to the server and receiving the status of nearby players.

So you just send movement actions to the server that keeps track of coordinates and let the clients recieve them and draw objects according to them

I was trying to find a cool article on the subject but apparently gpwiki is a shitty clickbait news site now? What the fuck happened?

it's the same principle you send chunks of data, but instead of using TCP or websockets, you create your own over UDP.

Also you define certain heuristics to deal with package loss and to define which chunks to send (for example in a CS match not every player is receiving your position and orientation only the closest ones).

It's a non trivial problem.

Yes that's the basic idea.

might as well make a single player mmo, server stuff are annoying and no one actually plays for the social aspect

Non trivial means hard, right?

yea

Why go through all that hazzle instead of simply using tcp?

Just because you don't have friends does not mean others don't or don't wont to make new ones.

A player sends updates to the server.
These updates can be a series of movements, rotations, actions or whatever.

Server does one of these:
sends these updates out to every other player
does some operation depending on the state of players. (game won, lost, explosion, whatever)

Something a stupid number of games DO NOT DO is do anti-cheat.
The very simple reason is it slows the server process down by quite a bit for any good anti-cheating systems.
This can easily add 20ms ping on to an average player, if not 40 on server hardware that is weaker.
Worse yet, some games do code which should BE ON the server on client machines.
A common one is physics done on client end, which is fucking retarded.
Your game engine should be entirely deterministic in design. Randomness is shit for physics. The only randomness should be player actions, which should be used to create pseudorandom events like explosions or physics. This way you can remove a fucking stupid amount of overhead in trying to sync client-side physics like a retard. Takes a little more work to do the pseudorandom physics route, but it seriously pays off in elegance and server-resources.

A common thing to deal with lag is to send series of movements rather than exact position polling.
This allows very smooth movement instead of jumpy movement.
Some games also do interpolation to smooth out further noise and any lost data. This is why sometimes some games show visible rubberbanding / acceleration in a direction, GTA very common for that hilarious scenario
Some do the interpolation to poll position less and deal with less data on the server.
Neither have an advantage over each other really, depends on the game which is the best to use.

this + scaling features

basic anti cheat has very minimal overhead. Even more aggressive ones wouldn't make your ping go up by 20ms. I've seen ML based anticheat (mostly targeted towards aimbots) that works without lagging out the clients. Often you can offload this work and just do checking in parallel and ban a cheater later.

Go read up on how shit like slither.io is made

Because TCP has more overhead to ensure recovery of lost packages, which for a game is not needed and not really wanted either.

If games are 1v1, you could just implement a client-server connection to handle lobby-based matchmaking, i.e. you all players who want to play a match connect to the server and wait for another player's challenge. If the challenge is accepted, the two players can start a peer to peer connection.

You forget that an average Steam game is not equal to most MP games. Not even slightly.

A large large number of FPS games, E-sports faggotry and so on barely have any decent anti-cheat.
It is so bad on consoles especially.
But even shit like TF2 can be wallhacked pretty easily.

Basic anti-cheat like position-checking is fine, especially if you optimize it heavily by not checking for impossible scenarios.
But when you get to more complex things, it can eat away at resource use pretty heavily.
On shitty servers, it does increase ping by those amounts pretty easily.
It's happened even in things like Minecraft servers, or Space Engineers.
Aimbots are also pretty easy to deal with most of the time since most bots tend to have unnatural movement. Smarter bots can analyse your mouse movements to pick out the weird imperfections in the sensor, which some anti-cheat systems look for. (as does Googles new captchaless system, along with other stuff)
But the more you try to detect these things, the higher the chance of getting false positives and risk losing players because you never checked for something, or checked too much, or implied there can't be X happening when you only tested a small subset of X.

As you said, yeah, there are growing numbers of delegated anti-cheat systems that analyse things in parallel and ban later.
Monitoring all interactions with the server and client, seeing if anything sticks out as blatantly cheating, ban.
If there is something that looks like cheating but it is unsure, it might get passed to a human to check further.
The better computers get, the better it is to be able to cheat for you.
A little bit of realtime pseudorandom generation tends to get past any bot detection I have come up against.
I've still to try out Googles new system.

>(for example in a CS match not every player is receiving your position and orientation only the closest ones).
This is incorrect

LOL this girl looks like SUCH a nerd! JEEZ

I know right? we always watch Dragonball and play Zelda together.

I'll get to work on the logo.

This should prove useful

ibm.com/developerworks/library/ar-powerup1/

>I am retard
>There are basically free books that describe multiplayer development
>I better shitpost here