SlideShare a Scribd company logo
Game Networking
MMO Games
Massive multiplayer online games - a genre of game
played over internet with a large number of players.
Limitations
◇ Network bandwidth limitations
◇ Networks packet take time to travel (ping time)
◇ Hard to synchronize client & server states
Client-Server
Client-Server:
◇ Expensive to maintain
◇ Server acts as a host
◇ Prevent hacking
◇ Heavy testing needed
Peers to peers:
◇ No maintenance costs
◇ Playable through LAN
◇ Easy to setup
◇ Hard to prevent hacks
Server simulates the game in time steps called ticks.
Default, the timestep is 15ms, so 66.666 per second.
Each tick, the server processes incoming user
commands, runs a physical simulation, checks game
rules, and updates all object states.
Counter-Strike, Left 4 Dead and Team Fortress.
Dedicated Server
Client is used as a host and acts as a server.
This client will receives messages from other clients.
Proceed them as a normal client would, executes
physics, checks for logics, and then send back new
states to other clients.
UNet uses this model.
Client as Server
Because the game has to keep going.
Latency Compensation
Design & Optimize
To solve network issues, techniques such as data compression and lag compensation are implemented.
Client then performs prediction and interpolation to further improve the experience.
In games such as Half Life, Quake and Unreal, there is a single server which is responsible for
running game logic. To it are connected one or more "dumb" clients. These clients were nothing
more than a way for user input to be sampled and forwarded to the server for execution.
Using the above data structures, first, the client creates and sends a command to server. The
server then executes user command and sends updated positions of everything back to client.
Which, the client renders the scene with all of these objects.
The main problem is that the client truly is "dumb",all it does is sampling movement inputs and
wait. If the client has 500 milliseconds of latency, then it will take 500 milliseconds for any
client actions to be acknowledged by the server and for the results to be perceptible on the
client.
Because internet connection is not to be trusted.
Client Side Prediction
Each user command (and time it was generated) is stored on the client. The prediction
algorithm uses these stored commands. In Half-Life, minimizing discrepancies between
client and server is accomplished by sharing identical movement code for players in both
the server code and the client-side code
The firing logic can be layered on top of the movement logic because the state of firing
buttons is included in the command data structure that is shared between the client and
the server.
typedef struct usercmd_s
{
// Interpolation time on client
short lerp_msec;
// Duration in ms of command
byte msec;
// Command view angles.
vec3_t viewangles;
// Forward velocity.
float forwardmove;
// Sideways velocity.
float sidemove;
// Upward velocity.
float upmove;
// Attack buttons
unsigned short buttons;
} usercmd_t;
Because every player is a big fat cheater.
Shooting prediction.
Although you hear weapon fire immediately, the results the shot is subject to latency. If you
aim at a player and you have 100 milliseconds latency and the player is running at 500
units per second, then you'll need to aim 50 units in front of the target to hit the target.
The greater the latency, the greater the lead targeting needed. Getting a "feel" for your
latency is difficult.
- When you shoot, client sends event to server with timestamp and exact aim of shot.
- Server gets input with timestamps, it reconstruct the world at any instant in the past.
- The server can know exactly what was on weapon’s sights instant you shot.
- It was the past position of your enemy’s head, but the server knows it was the position of
his head in your present.
- The server processes the shot at that point in time, and updates the clients.
Because everything has to be sum up.
Summary
- Server gets inputs from all the clients, with timestamps
- Server processes inputs and updates world status
- Server sends regular world snapshots to all clients
- Client sends input and simulates their effects locally
Client get world updates and
- Syncs predicted state to authoritative state
- Interpolates known past states for other entities
From a player’s POV, this has two important consequences:
- Player sees himself in the present
- Player sees other entities in the past
Summary

More Related Content

PPTX
Game Design Document - Step by Step Guide
PPTX
The Art of Game Development
PPTX
20 Game Ideas You Should Steal
PPTX
Introduction to game development
PDF
Efficient Rendering with DirectX* 12 on Intel® Graphics
PDF
Game Engine Overview
PPTX
서비스중인 게임 DB 설계 (쿠키런 편)
 
PPTX
Phases of game development
Game Design Document - Step by Step Guide
The Art of Game Development
20 Game Ideas You Should Steal
Introduction to game development
Efficient Rendering with DirectX* 12 on Intel® Graphics
Game Engine Overview
서비스중인 게임 DB 설계 (쿠키런 편)
 
Phases of game development

What's hot (20)

PPTX
웹서버와 ProudNet 서버간 상호작용 가이드
PPTX
Game development in android
PPTX
Game development pipeline
PDF
2-Game Design (Game Design and Development)
PPTX
Breaking the Rules of Idle Game Design in Trailer Park Boys: Greasy Money
PPTX
Game Design
PPT
Game balancing
PPT
Creating a Game Design Document
PPT
Intro to Game Design
PDF
3-Game Graphics (Game Design and Development)
PDF
06. Game Architecture
PDF
Android Application And Unity3D Game Documentation
PPT
Video Game Design: Art & Sound
PDF
Unreal Engine Basics 02 - Unreal Editor
PPT
What Is A Game Engine
PPTX
Game dev process
PPT
Game development Pre-Production
PDF
Unity 2D game development
PPTX
PRESENTATION ON Game Engine
PPTX
Course Presentation: Games design
웹서버와 ProudNet 서버간 상호작용 가이드
Game development in android
Game development pipeline
2-Game Design (Game Design and Development)
Breaking the Rules of Idle Game Design in Trailer Park Boys: Greasy Money
Game Design
Game balancing
Creating a Game Design Document
Intro to Game Design
3-Game Graphics (Game Design and Development)
06. Game Architecture
Android Application And Unity3D Game Documentation
Video Game Design: Art & Sound
Unreal Engine Basics 02 - Unreal Editor
What Is A Game Engine
Game dev process
Game development Pre-Production
Unity 2D game development
PRESENTATION ON Game Engine
Course Presentation: Games design
Ad

Similar to Game Networking for Online games (20)

PPT
Realtime html5 multiplayer_games_with_node_js
PPTX
Developing Multiplayer Games in Unity3D
PDF
Jan Hloušek, Keen Software House
PDF
Scalability & Big Data challenges in real time multiplayer games
PDF
Akka for realtime multiplayer mobile games
PDF
Akka for realtime multiplayer mobile games
PDF
Lets Play Together
PPT
Realtime html5 multiplayer_games_with_node_js
PDF
Introduction to the Unreal Development Kit
PDF
Making Sense of Multiplayer
PDF
Developing a Multiplayer RTS with the Unreal Engine 3
PPT
NetRacer for the Commodore 64
PPTX
Unity networking
PDF
CS4344 09/10 Lecture 2: Consistency
PPTX
MIGS18 Transforming from peer-to-peer to dedicated servers on a live game
PPTX
Networking Architecture of Warframe
PDF
38199728 multi-player-tutorial
PPTX
Unity Class 13 Presentation - .
PPTX
Asynchronous Multiplayer on Mobile Network
PPT
Multiplayer Games Chapter 6 Network Topologies.ppt
Realtime html5 multiplayer_games_with_node_js
Developing Multiplayer Games in Unity3D
Jan Hloušek, Keen Software House
Scalability & Big Data challenges in real time multiplayer games
Akka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile games
Lets Play Together
Realtime html5 multiplayer_games_with_node_js
Introduction to the Unreal Development Kit
Making Sense of Multiplayer
Developing a Multiplayer RTS with the Unreal Engine 3
NetRacer for the Commodore 64
Unity networking
CS4344 09/10 Lecture 2: Consistency
MIGS18 Transforming from peer-to-peer to dedicated servers on a live game
Networking Architecture of Warframe
38199728 multi-player-tutorial
Unity Class 13 Presentation - .
Asynchronous Multiplayer on Mobile Network
Multiplayer Games Chapter 6 Network Topologies.ppt
Ad

Recently uploaded (20)

PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Big Data Technologies - Introduction.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Machine learning based COVID-19 study performance prediction
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
MIND Revenue Release Quarter 2 2025 Press Release
Digital-Transformation-Roadmap-for-Companies.pptx
Spectroscopy.pptx food analysis technology
NewMind AI Weekly Chronicles - August'25 Week I
Big Data Technologies - Introduction.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Advanced methodologies resolving dimensionality complications for autism neur...
Spectral efficient network and resource selection model in 5G networks
Machine learning based COVID-19 study performance prediction
Chapter 3 Spatial Domain Image Processing.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Understanding_Digital_Forensics_Presentation.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
The Rise and Fall of 3GPP – Time for a Sabbatical?
Building Integrated photovoltaic BIPV_UPV.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf

Game Networking for Online games

  • 2. MMO Games Massive multiplayer online games - a genre of game played over internet with a large number of players.
  • 3. Limitations ◇ Network bandwidth limitations ◇ Networks packet take time to travel (ping time) ◇ Hard to synchronize client & server states
  • 4. Client-Server Client-Server: ◇ Expensive to maintain ◇ Server acts as a host ◇ Prevent hacking ◇ Heavy testing needed Peers to peers: ◇ No maintenance costs ◇ Playable through LAN ◇ Easy to setup ◇ Hard to prevent hacks
  • 5. Server simulates the game in time steps called ticks. Default, the timestep is 15ms, so 66.666 per second. Each tick, the server processes incoming user commands, runs a physical simulation, checks game rules, and updates all object states. Counter-Strike, Left 4 Dead and Team Fortress. Dedicated Server
  • 6. Client is used as a host and acts as a server. This client will receives messages from other clients. Proceed them as a normal client would, executes physics, checks for logics, and then send back new states to other clients. UNet uses this model. Client as Server
  • 7. Because the game has to keep going. Latency Compensation
  • 8. Design & Optimize To solve network issues, techniques such as data compression and lag compensation are implemented. Client then performs prediction and interpolation to further improve the experience.
  • 9. In games such as Half Life, Quake and Unreal, there is a single server which is responsible for running game logic. To it are connected one or more "dumb" clients. These clients were nothing more than a way for user input to be sampled and forwarded to the server for execution.
  • 10. Using the above data structures, first, the client creates and sends a command to server. The server then executes user command and sends updated positions of everything back to client. Which, the client renders the scene with all of these objects.
  • 11. The main problem is that the client truly is "dumb",all it does is sampling movement inputs and wait. If the client has 500 milliseconds of latency, then it will take 500 milliseconds for any client actions to be acknowledged by the server and for the results to be perceptible on the client.
  • 12. Because internet connection is not to be trusted. Client Side Prediction
  • 13. Each user command (and time it was generated) is stored on the client. The prediction algorithm uses these stored commands. In Half-Life, minimizing discrepancies between client and server is accomplished by sharing identical movement code for players in both the server code and the client-side code
  • 14. The firing logic can be layered on top of the movement logic because the state of firing buttons is included in the command data structure that is shared between the client and the server. typedef struct usercmd_s { // Interpolation time on client short lerp_msec; // Duration in ms of command byte msec; // Command view angles. vec3_t viewangles; // Forward velocity. float forwardmove; // Sideways velocity. float sidemove; // Upward velocity. float upmove; // Attack buttons unsigned short buttons; } usercmd_t;
  • 15. Because every player is a big fat cheater. Shooting prediction.
  • 16. Although you hear weapon fire immediately, the results the shot is subject to latency. If you aim at a player and you have 100 milliseconds latency and the player is running at 500 units per second, then you'll need to aim 50 units in front of the target to hit the target. The greater the latency, the greater the lead targeting needed. Getting a "feel" for your latency is difficult.
  • 17. - When you shoot, client sends event to server with timestamp and exact aim of shot. - Server gets input with timestamps, it reconstruct the world at any instant in the past. - The server can know exactly what was on weapon’s sights instant you shot. - It was the past position of your enemy’s head, but the server knows it was the position of his head in your present. - The server processes the shot at that point in time, and updates the clients.
  • 18. Because everything has to be sum up. Summary
  • 19. - Server gets inputs from all the clients, with timestamps - Server processes inputs and updates world status - Server sends regular world snapshots to all clients - Client sends input and simulates their effects locally Client get world updates and - Syncs predicted state to authoritative state - Interpolates known past states for other entities From a player’s POV, this has two important consequences: - Player sees himself in the present - Player sees other entities in the past Summary