> Sounds like servers handling lots of small UDP packets would be hit pretty hard.
> Sounds like servers handling lots of small UDP packets would be hit pretty hard.
NAME
sendmmsg - send multiple messages on a socket
SYNOPSIS
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <sys/socket.h>
int sendmmsg(int sockfd, struct mmsghdr *msgvec, unsigned int vlen,
unsigned int flags);Online games work today with fixed ticks and polling usually at half of full frame rate which means that the server updates and polls the client 30 or 60 times a second or any other even multiplier of the expected synced frame rate.
Latency is still absolutely an issue. I play games from Japan with my friends in the states and I often have a ping of 140 ms or so. That is latency, and properly implemented games (Rocket League, for example) will deal with it using UDP among other techniques.
Slower paced games can still use TCP though because latency issues are less sensitive.
You're wrong. Head of line blocking is a real thing that happens very often in TCP.
Edit: parent poster removed that part of the comment between me reading and submitting a reply
Source: I used to write networking stacks for realtime games.
If it's a latency sensitive (like a twitch FPS), UDP is the way to go. Having up to date data is more important than having all the data.
If it's a synchronized game (like a turn based game or an RTS where all clients run at the same logic framerate), or not latency sensitive (an MMO like WOW), TCP is fine and probably easier.
From userspace' perspective, even if the same data isn't being broadcast at every client, just building up a big array (perhaps while looping over the input from recvmmsg()!) and spitting it out once would have the same semantics as just calling sendmsg() immediately on each, etc
These aren’t stats of the gameplay servers, these are the backend servers that handle matchmaking, player stats, inventories and progression.
For things like getting stats, probably from a HTTP endpoint, sure, but for gameplay? The lag would be very bad, no? Lose a packet and everything is slowed down
I see this, which indicates it uses UDP: https://imgur.com/al6KTwT
and according to wireshark it's used heavily when in a game, so I assume that's the gameplay protocol. Also when I left my game (but stayed in the lobby), immediately the port 61879 stopped listening.
I'm not sure about UE4, but previous versions of the unreal engine used UDP for replication and RPC.
I worked on a huge open world third-person shooter always-online AAA game and it uses TCP for everything.
I've worked on a variety of engines which were either UE or Quake based. All of them use UDP for temporal game state updates to avoid head of line blocking[2][3].
[1] https://answers.unrealengine.com/questions/197713/is-replica...
[2] https://stackoverflow.com/questions/39323556/why-do-game-dev...
[3] https://www.gamasutra.com/view/feature/131781/the_internet_s...
It also uses HTTPs to load a lot of other data such as server data, friends list, chat etc.
Unreal Engine comes with a version of chromium built in which is used for many in game things like social tabs, news, and in game purchases these all work over HTTP/S.
Game data is sent over 5222 TCP.
As far as I know, in Linux there is no support for multi-packet UDP vectored I/O. I wonder if it would be possible to "simulate" that with a raw socket....