Skip to main content
Share Your Experience: Take the 2024 Developer Survey
125 votes
Accepted

Is UDP still better than TCP for data-heavy realtime games?

No, UDP is still superior in terms of performance latency, and will always be faster, because of the philosophy of the 2 protocols - assuming your communication data was designed with UDP or any other ...
Peter's user avatar
  • 9,925
65 votes

What's the performance benefit of saving all logged in characters in MMOs in regular intervals?

This is not for performance. This is a failsafe. If the world saves every few minutes, then if something happens to the server and it shuts down everyone will only lose a few minutes' progress. By ...
Aric's user avatar
  • 595
49 votes
Accepted

How to handle a large number of pickups in a MMO game

By simply only loading those parts of the world into memory which are close to the player. Anything else is suspended to hard drive. When there is a tiny object laying around two kilometers away, then ...
Philipp's user avatar
  • 120k
43 votes

How does delta compression reduce the amount of data sent over the network?

There are times when you cannot avoid sending the full game state - such as on load of a saved multiplayer game, or when a resync is needed. But sending full state is usually avoidable, and that's ...
Engineer's user avatar
  • 29.9k
32 votes
Accepted

Acknowledgement reliability using UDP

This is a form of the Two Generals Problem, and you're right - no number of retries is enough to perfectly guarantee receipt. In practice in games, there's usually a time horizon beyond which the ...
DMGregory's user avatar
  • 135k
24 votes

How does delta compression reduce the amount of data sent over the network?

You have the wrong delta. You're looking at the delta of the individual elements. You need to think of the delta of the entire scene. Suppose you have 100 elements in your scene, but only 1 of them ...
corsiKa's user avatar
  • 994
22 votes

How to handle a large number of pickups in a MMO game

You have two very different things to manage: The server must manage the entire world, in an authorative manner. For that, communication with N clients (where N is "massive") is necessary. The client ...
Damon's user avatar
  • 1,384
19 votes

Is UDP still better than TCP for data-heavy realtime games?

We agree upon both TCP and UDP being protocols built on top of IP, don't we? IP specifies how messages are delivered across the internet, but nothing is about the messages structure, format. Here come ...
liggiorgio's user avatar
  • 4,831
12 votes
Accepted

What is the difference between a "ping" and "RTT" (round-trip time)?

A ping is a method to measure round trip time. The process of "pinging" is to send a "ping". A "ping" is a network message which serves no other purpose than to get an immediate response from the ...
Philipp's user avatar
  • 120k
12 votes

Should damage calculation in a competitive multiplayer game be done client-sided or server-sided?

Rule number one for multiplayer netcode design: Anything that matters for gameplay should be calculated server-sided. Never trust the client. The client is in the hands of the enemy. You can not ...
Philipp's user avatar
  • 120k
11 votes

Should damage calculation in a competitive multiplayer game be done client-sided or server-sided?

Option 3: The client sends a click event to the server, the server decides where this click event has landed, decides if there is a hit or a miss, then applies the damage and sends the updated world ...
Vaillancourt's user avatar
  • 16.3k
9 votes
Accepted

Does it make sense to use both TCP and UDP at once?

It results in packet loss for UDP due to contention between the two protocols - remember that UDP is not guaranteed delivery, while TCP is. More TCP packets will get through while UDP suffers - TCP ...
Engineer's user avatar
  • 29.9k
9 votes

Is UDP still better than TCP for data-heavy realtime games?

TCP <- Transmission Control Protocol. It's made to control transmission. TCP was created to be a good and diplomatic network citizen. It focuses on making the networking a good experience for ...
Stormwind's user avatar
  • 1,063
9 votes
Accepted

How to compensate for moving objects with client side prediction?

During the 6 months since I asked this question, I ended up developing a complete open source game server to deal with this exact issue (and many others!): https://lance-gg.github.io/ The R&D ...
OpherV's user avatar
  • 655
9 votes

How does delta compression reduce the amount of data sent over the network?

Very often another compression mechanism will in combination with delta encoding like for example arithmetic compression. Those compression schemes work much better when the possible values are ...
ratchet freak's user avatar
9 votes

Acknowledgement reliability using UDP

The approach TCP uses is that the sender will keep resending the packet until it receives an acknowledgement. The receiver will ignore duplicate packets, but still send acknowledgements for them. The ...
Quitting Due To Antisemitism's user avatar
8 votes
Accepted

Why do multiplayer games/chat services ever need to be able to open all NAT ports?

Just to make sure we're all on the same page in terms of terminology: What is NAT? NAT is an acronym for "Network Address Translation". It's a system designed to allow a router to allow a ...
Trevor Powell's user avatar
8 votes
Accepted

Where should multiplayer games start? Client or server?

You develop both at the same time, inside the same executable or a DLL loaded by the game executable. The game always run on a server, even when running single-player. When running single player ...
Stephane Hockenhull's user avatar
8 votes

How does delta compression reduce the amount of data sent over the network?

You are right that a naïve delta calculation on its own, with the result stored in the same size data structure as the operands and transmitted without any further processing would not save any ...
Peter Green's user avatar
8 votes

How does delta compression reduce the amount of data sent over the network?

You are broadly correct, but missing one important point. Entities in a game are described by many attributes, of which position is only one. What kind of attributes? Without having to think too ...
Maximus Minimus's user avatar
7 votes
Accepted

Client side prediction physics

Client-side prediction depends very heavily on a deterministic physics model that exactly replicates the way the game object behaves on both the client and the server. Even small floating point errors,...
RelicBloodvayne's user avatar
7 votes

Determing winning on the server side or client side?

Hello visitors of Jindsay's Card Game Forum. Here is your friend xXx_GameH4x0rPhilipp_xXx with another cheat for you. Do you want to win every game? Here is a simple hack which works with every web ...
Philipp's user avatar
  • 120k
7 votes

Acknowledgement reliability using UDP

If you want to reinvent TCP, it makes sense to look at TCP first, which deals with the exact problem you describe (part of the solution is to use user defined values for retry attempts and timeouts). ...
Peter's user avatar
  • 9,925
7 votes
Accepted

Architecture of networked game engine

TLDR - start simple and build up. Getting to AAA quality networking in an action game is complicated but may not even be necessary for your game. So basically: When client connects to the server, ...
Sean Middleditch's user avatar
6 votes
Accepted

Resolving prediction error from client side prediction and server reconciliation

I solved the problem on my own. My previous implementation of the networking engine made reconciliation impossible. The code I am using is private, though I plan on open sourcing the Box2D server/...
pjrader1's user avatar
  • 332
6 votes
Accepted

Networked projectiles in an authoritative server

This is what we ended up doing: Client side Detect player clicks button to shot missile Immediatley simulate rocket visuals on client In parallel, send command to server Once predict hit something, ...
Ron's user avatar
  • 656
6 votes
Accepted

Network protocol for chat -- UDP or TCP

When it comes to chat systems, reliability is far more important than latency and bandwidth. That would usually make it a typical TCP/IP use-case. However, using both TCP and UDP in parallel through ...
Philipp's user avatar
  • 120k
6 votes

How does delta compression reduce the amount of data sent over the network?

While most answers talk about how delta encoding is about only sending the changes to state as a whole, there is another thing called "delta encoding" that can be used as a filter for reducing the ...
fluffy's user avatar
  • 407
6 votes

What is the difference between a "ping" and "RTT" (round-trip time)?

While Philipp is mostly right, a ping may not be identical to the round-trip time. It differs in that most ping tests are executed within the transport protocol using ICMP packets. In contrast, RTT is ...
allieatcsio's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible