Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization I’m Curtis.

Slides:



Advertisements
Similar presentations
Present & Apply The final resting place of the OSI layers.
Advertisements

Introduction to Macromedia Director 8.5 – Lingo
Colyseus: A Distributed Architecture for Online Multiplayer Games
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010 modified July 2011.
Game Programming Patterns Game Loop
Dead Reckoning Objectives – –Understand what is meant by the term dead reckoning. –Realize the two major components of a dead reckoning protocol. –Be capable.
Least squares CS1114
Gameplay Networking Jacob Steinfort. Importance of Multiplayer Games If gamers had to choose either a single-player game or a multiplayer game, most people.
CS 1220 – Object Oriented Design 1 Project Info Term Project Overview 1.You need to read in a circuit description Consists of list of gates, what nodes.
Lecture 3  A round up of the most important basics I haven’t covered yet.  A round up of some of the (many) things I am missing out of this course (ATM,
Network synchronization of Online Games Li, Zetan.
Dead Reckoning Andrew Williams. Dead reckoning Process of estimating a position using known information from the (recent) past. If you know the speed.
CS514: Intermediate Course in Operating Systems Professor Ken Birman Vivek Vishnumurthy: TA.
DT211/3 Internet Application Development JSP: Processing User input.
Online Chess Project 3 Due date: April 17 th. Introduction Third in series of three projects This project focuses on adding online support –2 players.
Introduction What is this ? What is this ? This project is a part of a scientific research in machine learning, whose objective is to develop a system,
SM3121 Software Technology Mark Green School of Creative Media.
SE320: Introduction to Computer Games Week 8: Game Programming Gazihan Alankus.
Multiplayer Online Games
1 Functional Testing Motivation Example Basic Methods Timing: 30 minutes.
Mixed-level English classrooms What my paper is about: Basically my paper is about confirming with my research that the use of technology in the classroom.
Databases with PHP A quick introduction. Y’all know SQL and Databases  You put data in  You get data out  You can do processing on it very easily 
Collision and Animation Systems in Games Jani Kajala Lead Programmer / Chief Technology Officer, Pixelgene Ltd (0)
Networked File System CS Introduction to Operating Systems.
A 2-D, multi-player tank game developed in PLT Scheme ~ ~ ~ Ben VandenBos, Tim Reeves, Justin Hall, and John Ericksen ~ ~ ~ Senior Project - CS496 Spring.
Network Physics Created by Ruslan Yavdoshak for Nikitova Games, 2008.
.:::The EA FEAR Division Presents:. When you download FEAR you should be able to load it pretty quickly, so if it’s taking long consider the problems.
Introduction to Networked Graphics Part 3 of 5: Latency.
Technology vocabulary slides assignment. Application Definition : A program or group of programs designed for end users. Application software can be divided.
Time Manipulation.  The game states rendered at the clients are different because latency is dependent on the location of the client from the server.
Understanding the TigerSHARC ALU pipeline Determining the speed of one stage of IIR filter – Part 3 Understanding the memory pipeline issues.
Burnout 3: Case Study (Outline) What is Burnout 3? What is Burnout 3? What does this mean? What does this mean? How did we satisfy these constraints? How.
Moving Around in Scratch The Basics… -You do want to have Scratch open as you will be creating a program. -Follow the instructions and if you have questions.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 15.
Diagnostic Pathfinder for Instructors. Diagnostic Pathfinder Local File vs. Database Normal operations Expert operations Admin operations.
TownMUD An Interface for a Text-Based Multiple User Dimension.
“The perfect project plan is possible if one first documents a list of all the unknowns.” Bill Langley.
Unit 1 – Improving Productivity Instructions ~ 100 words per box.
Reference: The Game Loop Animation / Game loop 1. Update variables 2. [Get input from the user] (GameLoop only) 3. Draw (using variables)
This document gives one example of how one might be able to “fix” a meteorological file, if one finds that there may be problems with the file. There are.
Networked Graphics Building Networked Virtual Environments and Networked Games Issues in Networking Graphics.
Debugging Computer Networks Sep. 26, 2007 Seunghwan Hong.
Real-Time & MultiMedia Lab Synchronization Distributed System Jin-Seung,KIM.
Networked Games Objectives – –Understand the types of human interaction that a network game may provide and how this influences game play. –Understand.
Dynamic Gaze-Contingent Rendering Complexity Scaling By Luke Paireepinart.
Dead Reckoning. Outline Basic Dead Reckoning Model (DRM) –Generating state updates –Position extrapolation Refinements –Time compensation –Smoothing.
Game Programming Patterns Game Loop From the book by Robert Nystrom
Warlords Patrick Levoshko SE 558 – Multiplayer Game Design.
Week 6. Statistics etc. GRS LX 865 Topics in Linguistics.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Game program main loop.
High Level Architecture Time Management. Time management is a difficult subject There is no real time management in DIS (usually); things happen as packets.
T HE G AME L OOP. A simple model How simply could we model a computer game? By separating the game in two parts: – the data inside the computer, and –
1 CO Games Development 1 Week 3 Game Agents 2 Gareth Bellaby.
Network Replication Possibly the ugliest thing to learn this semester Many different states Simulated Functions Is it an Event or function? Roles.
Networked Graphics Building Networked Virtual Environments and Networked Games Chapter 11: Latency and Consistency.
Instructor: Craig Duckett Lecture 07: Tuesday, October 20 th, 2015 Conflicts and Isolation, MySQL Workbench 1 BIT275: Database Design (Fall 2015)
RTP and playout delay compensation Henning Schulzrinne Dept. of Computer Science Columbia University Fall 2003.
Repetition everywhere – comparing while in a method and as an event Susan Rodger Duke University July 2010.
© 2015 albert-learning.com How to talk to your boss How to talk to your boss!!
CSC 108H: Introduction to Computer Programming Summer 2011 Marek Janicki.
Multiplayer Online Games
Cleveland SQL Saturday Catch-All or Sometimes Queries
Introduction to Python
CSCI1600: Embedded and Real Time Software
CIS 488/588 Bruce R. Maxim UM-Dearborn
CSS432 (Link Level Protocols) Reliable Transmission Textbook Ch 2.5
Game Loop Update & Draw.
WebDriver on Windows 10 Greg
CSCI1600: Embedded and Real Time Software
Presentation transcript:

Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization I’m Curtis

Networked FPS games are difficult to make –But not too interesting if they’re not networked Broadband is pretty nice –But we can’t rely on it 

Basic Architecture Client / Server set up –Server handles logic –Clients (initially) just to get player input Simplified version below

Client Frame Loop Sample clock to find start time Sample user input Package up and send movement command using simulation time Read any packages from the server from the network system Use packets to determine visible objects and their state Render scene Sample clock to find end time End time minus start time is the simulation time for the next frame What about ‘framerate jitter’?

Server Loop Sample clock to find start time Read client user input messages from network Execute client user input messages Simulate server-controlled objects using simulation time from last full pass For each connected client, package up visible objects/world state and send to client Sample clock to find end time End time minus start time is simulation time for the next frame

Not the only way to do it Suggestions?

Half-Life User Input Most important fields in the struct are –Interpolation time on client –Duration in ms of command –Command view angles –Forward/Sideways/Upwards velocity –Attack buttons –Other stuff –Any comments?

So here’s what happens Client creates and sends a user command to the server Server executes the command and sends updated positions of everything back Client then renders the scene Simple, and doesn’t do well in real situations. Why?

Client is too stoopid All it does is react. If there’s a certain amount of latency the client has no choice but to wait. So what does the client need to do?

Client Side Prediction One option: perform it locally and assume the sever is going to be cool with it. –Client still not in control –Server will shove objects back where they should be –Can look pretty crappy

A better way Client samples input (same) Client sends off the commands (same) Client keeps a copy of each command and when it was generated (different!) First perform the last acknowledged movement from server Then performs any outstanding commands in a similar method as the server would.

Algorithm for last slide “from state” /*state after last command acknowledged by server*/ “command” /*first command after the from state*/ while (true){ run “command” on “from state” to generate “to state”; if (this was the most up to date “command”) break; “from state” = “to state”; “command” = next “command”; };

Client will run same commands over and over until acknowledged Sounds should not be re-created Server should not send info predicted by the client. Client still has to re-run the old commands Fix: client marks those not yet predicted and only plays if it’s the first time

Client only state data If none, just use last state from server as a starter and run prediction commands If any, you need to store the intermediate results of prediction Store them in a ‘sliding window’ Actuate them as they should be, using server acknowledgment So far, just using this for movement

Weapon firing We can do the same as the last slide for weapon firing Need to know –Which weapons are being held –Which is active –How much ammo each has Can be complicated if client and server shooting logic is difficult

Why stop there? This leads us to also predict... –Weapon switching –Deployment –Holstering “Umm, This is a Lot of Work” –Do they expect us to do this for MazeWar?

You still need to have a feel for your latency to determine how to lead your targets Quake3 made a sound when you hit someone to make it easier Jitter will make it very hard to get a good feel

But enough about me... Now we need to worry about rendering the other players correctly Two main methods – Extrapolition and Interpolition

Extrapolation Other players/objects simulated forward in time Works nicely for people running in straight lines Bad news: many players move like Mexican jumping beans with too much coffee Can clean this up a bit by putting a limit on the extrapolation time This can make it so there is less warping, which will hurt gameplay and nullify the reason for putting extra work in

Interpolation Always moving objects in the past Slow render a bit to compensate for some lag Missed a packet? –Extrapolate the player position –Or have the player rest (and stutter the movement)

Interpolation Algorithm Each update contains the server time stamp for when it was generated From the current client time, the client computes a target time by subtracting the interpolition time delta (100 ms) If the target time is between the timestamp of the last update and the one before that, then those timestamps determine what fraction of the time gap has passed. This fraction is used to interpolate any values (e.g., position and angles

It’s basically buffering an additional 100 ms of data on the client Any longer is a trade off, since the smoother vision will make others harder to hit It requires a fixed time interval between server updates Problems?

Interpolation visual quality For example: if the player is jumping around they spend the average of the time at the middle of their jump If we interpolate at the last position they might just be seen floating up and down without ever reaching the ground or the height of their jump.

Vision fix Each server update creates a new position history entry Search backwards through the history looking for a pair that straddles the target time What if something was SUPPOSED to teleport? Set a flag

Lag Compensation Normalizing server-side the state of the world for each player as that player’s user commands are executed. Algorithm on the next page

Before executing a player’s current user command, the server: –Computes a fairly accurate latency for the player –Searches the server history (for the current player) for the world update that was sent to the player and received by the player just before the player would have issued the movement command –From that update (and the one following it based on the exact target time being used), for each player in the update, move the other players backwards in time to exactly where they were when the current player’s user command was created. This moving backwards must account for both connection latency and the interpolation amount8 the client was using that frame. Allow the user command to execute (including any weapon firing commands, etc., that will run ray casts against all of the other players in their “old” positions). Move all of the moved/time-warped players back to their correct/current positions

Now a player can directly aim at other players without wondering if they’re actually there. Is this fair?

Well, someone with a lot of lag could shoot someone with less lag after that person had taken cover... But does that happen very often? Who is right in those cases? Half-Life gives the points to the shooter Probably because it’s more fun to shoot

So, it’s still inconsistent with a perfect view of the world But the benefits still outweigh those inconsistencies Benefits?