• Changes to Server go to this thread http://overzealousgamers.com/threads/etpub-changelog.6665/

LAGO-METER EXPLAINED

SkankyMoe

Well-Known Member
IVE HAD A FEW PEEPS ASK ME IF I KNOW HOW LAGO-METER WORKS, WTF DOES IT TELL ME.
WELL IVE PINCHED THE BELOW INFO FROM BANIMOD FORUMS SO I CAN POINT PEOPLE TO THIS THREAD FOR INFO.


Enemy Territory provides a small graph with some network information which can be enabled by setting cg_lagometer to 1. Although this is not a feature specific to ET Pro, it has never been well-documented.

The lagometer consists of two graphs--the upper is the frame graph, and the lower is the snapshot graph. New data is added to the frame graph every time the client renders a frame (so this graph will move faster at higher framerates), and new data is added to the snapshot graph every time a snapshot packet is received from the server.

The snapshot graph is the easiest to understand--it is essentially a graph of the latency (ping) between you and the server. The graph's colors provide some additional information: green is normal, yellow indicates that the snapshot was delayed so that the server would not exceed the rate value (either rate on your client, or sv_maxRate on the server, whichever is lower), and red indicates that a snapshot was lost entirely (i.e. a snapshot sent by the server never made it to the client, probably due to network problems.)



In the above image, arrow 1 points to a normal snapshot with a ping of about 130ms, arrow 2 points to 700ms of packet loss, and arrow 3 points to 2 snapshots that were delayed to stay under the rate limit.

The frame graph is a little more complicated, and requires some background information about how Enemy Territory's network code works for a full understanding. In Enemy Territory, each client runs at a non-fixed frame rate (depending on configuration, system performance, etc.) while the server runs at a fixed rate of 20 frames per second. After running each frame, the server will send a snapshot to every client (so long as the client's snaps and rate settings allows it) describing everything that has changed since the previous snapshot. When the client receives this snapshot, it interpolates the values between the old snapshot and the snapshot that was just received--that is, it smooths out the movement so that things in the map don't appear to be jumping around when the client is drawing frames faster than the server is sending them. If the client doesn't receive a snapshot, it may have to guess where an object is going to be in order to keep things looking normal.

The client and the server each keep track of the current game time, and the differences between these times are expressed in the frame graph as well as object movement. For a simple example of this, imagine that the server has sent you two snapshots, snapshot a at time 12350, and snapshot b at time 12400?, and then imagine that the client's current time is 12375. The client will interpolate? the position sent in snapshot a and in snapshot b to determine that the object in question should be drawn in the middle of the two points sent (because 12375 (the time our client is drawing for) is exactly halfway between 12350 and 12400.)

In the situation presented in the previous paragraph, imagine the client's time is 12425 and that no additional snapshots have been received yet. In order to maintain fluid motion, the client will need to guess where objects will be (using the last known position, angle, and velocity.) The calculation for this is quite not as easy to explain, so an example has been omitted for brevity.

The frame graph in the lagometer represents how far the time used for currently drawn image is away from the most recently received snapshot, and whether the client interpolated or extrapolated to obtain the positions used. Normally, the client interpolates positions, which is represented in blue on the lagometer; the graph height will spike downwards when a new snapshot is received, then crawl upwards towards the baseline), although it will sometimes be yellow to indicate extrapolation (and the graph will crawl upwards away from the baseline as the client extrapolates farther and farther from the last known data.) Since the cl_timenudge cvar causes the world to be rendered a certain number of milliseconds behind or ahead of the client's internal time, negative values may cause extrapolation during normal gameplay. For example, in the first situation described above (where the client's time is 12375), a cl_timenudge value of -30 would end up pushing the time used for rendering up to 12405 (which is newer than the data we have), so a small amount of extrapolation (5ms) would be required here.



In the above image, arrow 1 points to an interpolated frame immediately after a new snapshot was received, and arrow 2 points to a frame where a fair bit of extrapolation was performed.


Footnotes:
? Note the increase of exactly 50 -- remember that the server is running at 20 frames per second, so:
1 frame ? 1000ms (1 second)
--------------------------------------------------------------------------------
20 frames = 50ms

? This is technically called linear interpolation (the simplest interpolation method), which is sometimes abbreviated to lerping.

CREDIT /- RAIN @ BANIMOD
 

gemanix

Well-Known Member
good explainer.

i get heaps of yellow, sometimes seems more yellow than blue, and there's always a red bar visible somewhere. :(

graph must update every 50ms, as the red bar being 700ms is 14 pixels wide. is this a setting somewhere?
 

SkankyMoe

Well-Known Member
gemanix said:
the red bar being 700ms is 14 pixels wide. is this a setting somewhere?
YES, YOU COULD DECOMPILE THE PK3 FILE, REHASH THE CODE, RECOMPILE THE PK3
BUT THEN, THE FILES WONT VALIDATE FOR A PURE SERVER, YOU COULD ONLY USE ON UNPURE SERVERS.
 

SkankyMoe

Well-Known Member
-OZ-Trigger Happy said:
I just couldn't read it properly because it wasn't in caps. Cheers
JUST FOR YOU TRIGS, CAUSE I WUB JU :lol:

ENEMY TERRITORY PROVIDES A SMALL GRAPH WITH SOME NETWORK INFORMATION WHICH CAN BE ENABLED BY SETTING CG_LAGOMETER TO 1. ALTHOUGH THIS IS NOT A FEATURE SPECIFIC TO ET PRO, IT HAS NEVER BEEN WELL-DOCUMENTED.

THE LAGOMETER CONSISTS OF TWO GRAPHS--THE UPPER IS THE FRAME GRAPH, AND THE LOWER IS THE SNAPSHOT GRAPH. NEW DATA IS ADDED TO THE FRAME GRAPH EVERY TIME THE CLIENT RENDERS A FRAME (SO THIS GRAPH WILL MOVE FASTER AT HIGHER FRAMERATES), AND NEW DATA IS ADDED TO THE SNAPSHOT GRAPH EVERY TIME A SNAPSHOT PACKET IS RECEIVED FROM THE SERVER.

THE SNAPSHOT GRAPH IS THE EASIEST TO UNDERSTAND--IT IS ESSENTIALLY A GRAPH OF THE LATENCY (PING) BETWEEN YOU AND THE SERVER. THE GRAPH'S COLORS PROVIDE SOME ADDITIONAL INFORMATION: GREEN IS NORMAL, YELLOW INDICATES THAT THE SNAPSHOT WAS DELAYED SO THAT THE SERVER WOULD NOT EXCEED THE RATE VALUE (EITHER RATE ON YOUR CLIENT, OR SV_MAXRATE ON THE SERVER, WHICHEVER IS LOWER), AND RED INDICATES THAT A SNAPSHOT WAS LOST ENTIRELY (I.E. A SNAPSHOT SENT BY THE SERVER NEVER MADE IT TO THE CLIENT, PROBABLY DUE TO NETWORK PROBLEMS.)



IN THE ABOVE IMAGE, ARROW 1 POINTS TO A NORMAL SNAPSHOT WITH A PING OF ABOUT 130MS, ARROW 2 POINTS TO 700MS OF PACKET LOSS, AND ARROW 3 POINTS TO 2 SNAPSHOTS THAT WERE DELAYED TO STAY UNDER THE RATE LIMIT.

THE FRAME GRAPH IS A LITTLE MORE COMPLICATED, AND REQUIRES SOME BACKGROUND INFORMATION ABOUT HOW ENEMY TERRITORY'S NETWORK CODE WORKS FOR A FULL UNDERSTANDING. IN ENEMY TERRITORY, EACH CLIENT RUNS AT A NON-FIXED FRAME RATE (DEPENDING ON CONFIGURATION, SYSTEM PERFORMANCE, ETC.) WHILE THE SERVER RUNS AT A FIXED RATE OF 20 FRAMES PER SECOND. AFTER RUNNING EACH FRAME, THE SERVER WILL SEND A SNAPSHOT TO EVERY CLIENT (SO LONG AS THE CLIENT'S SNAPS AND RATE SETTINGS ALLOWS IT) DESCRIBING EVERYTHING THAT HAS CHANGED SINCE THE PREVIOUS SNAPSHOT. WHEN THE CLIENT RECEIVES THIS SNAPSHOT, IT INTERPOLATES THE VALUES BETWEEN THE OLD SNAPSHOT AND THE SNAPSHOT THAT WAS JUST RECEIVED--THAT IS, IT SMOOTHS OUT THE MOVEMENT SO THAT THINGS IN THE MAP DON'T APPEAR TO BE JUMPING AROUND WHEN THE CLIENT IS DRAWING FRAMES FASTER THAN THE SERVER IS SENDING THEM. IF THE CLIENT DOESN'T RECEIVE A SNAPSHOT, IT MAY HAVE TO GUESS WHERE AN OBJECT IS GOING TO BE IN ORDER TO KEEP THINGS LOOKING NORMAL.

THE CLIENT AND THE SERVER EACH KEEP TRACK OF THE CURRENT GAME TIME, AND THE DIFFERENCES BETWEEN THESE TIMES ARE EXPRESSED IN THE FRAME GRAPH AS WELL AS OBJECT MOVEMENT. FOR A SIMPLE EXAMPLE OF THIS, IMAGINE THAT THE SERVER HAS SENT YOU TWO SNAPSHOTS, SNAPSHOT A AT TIME 12350, AND SNAPSHOT B AT TIME 12400?, AND THEN IMAGINE THAT THE CLIENT'S CURRENT TIME IS 12375. THE CLIENT WILL INTERPOLATE? THE POSITION SENT IN SNAPSHOT A AND IN SNAPSHOT B TO DETERMINE THAT THE OBJECT IN QUESTION SHOULD BE DRAWN IN THE MIDDLE OF THE TWO POINTS SENT (BECAUSE 12375 (THE TIME OUR CLIENT IS DRAWING FOR) IS EXACTLY HALFWAY BETWEEN 12350 AND 12400.)

IN THE SITUATION PRESENTED IN THE PREVIOUS PARAGRAPH, IMAGINE THE CLIENT'S TIME IS 12425 AND THAT NO ADDITIONAL SNAPSHOTS HAVE BEEN RECEIVED YET. IN ORDER TO MAINTAIN FLUID MOTION, THE CLIENT WILL NEED TO GUESS WHERE OBJECTS WILL BE (USING THE LAST KNOWN POSITION, ANGLE, AND VELOCITY.) THE CALCULATION FOR THIS IS QUITE NOT AS EASY TO EXPLAIN, SO AN EXAMPLE HAS BEEN OMITTED FOR BREVITY.

THE FRAME GRAPH IN THE LAGOMETER REPRESENTS HOW FAR THE TIME USED FOR CURRENTLY DRAWN IMAGE IS AWAY FROM THE MOST RECENTLY RECEIVED SNAPSHOT, AND WHETHER THE CLIENT INTERPOLATED OR EXTRAPOLATED TO OBTAIN THE POSITIONS USED. NORMALLY, THE CLIENT INTERPOLATES POSITIONS, WHICH IS REPRESENTED IN BLUE ON THE LAGOMETER; THE GRAPH HEIGHT WILL SPIKE DOWNWARDS WHEN A NEW SNAPSHOT IS RECEIVED, THEN CRAWL UPWARDS TOWARDS THE BASELINE), ALTHOUGH IT WILL SOMETIMES BE YELLOW TO INDICATE EXTRAPOLATION (AND THE GRAPH WILL CRAWL UPWARDS AWAY FROM THE BASELINE AS THE CLIENT EXTRAPOLATES FARTHER AND FARTHER FROM THE LAST KNOWN DATA.) SINCE THE CL_TIMENUDGE CVAR CAUSES THE WORLD TO BE RENDERED A CERTAIN NUMBER OF MILLISECONDS BEHIND OR AHEAD OF THE CLIENT'S INTERNAL TIME, NEGATIVE VALUES MAY CAUSE EXTRAPOLATION DURING NORMAL GAMEPLAY. FOR EXAMPLE, IN THE FIRST SITUATION DESCRIBED ABOVE (WHERE THE CLIENT'S TIME IS 12375), A CL_TIMENUDGE VALUE OF -30 WOULD END UP PUSHING THE TIME USED FOR RENDERING UP TO 12405 (WHICH IS NEWER THAN THE DATA WE HAVE), SO A SMALL AMOUNT OF EXTRAPOLATION (5MS) WOULD BE REQUIRED HERE.



IN THE ABOVE IMAGE, ARROW 1 POINTS TO AN INTERPOLATED FRAME IMMEDIATELY AFTER A NEW SNAPSHOT WAS RECEIVED, AND ARROW 2 POINTS TO A FRAME WHERE A FAIR BIT OF EXTRAPOLATION WAS PERFORMED.


FOOTNOTES:
? NOTE THE INCREASE OF EXACTLY 50 -- REMEMBER THAT THE SERVER IS RUNNING AT 20 FRAMES PER SECOND, SO:
1 FRAME ? 1000MS (1 SECOND)
--------------------------------------------------------------------------------
20 FRAMES = 50MS

? THIS IS TECHNICALLY CALLED LINEAR INTERPOLATION (THE SIMPLEST INTERPOLATION METHOD), WHICH IS SOMETIMES ABBREVIATED TO LERPING.
 

the whole cake

Well-Known Member

U r all wrong. Its actually a picture of the fire department building. And u can quite clearly see my washing line across the top and my yellow undies on the line.
 
Top