Raised This Month: $12 Target: $400
 3% 

[CS:GO] Getting "SV" and "Var" values


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
psychonic

BAFFLED
Join Date: May 2008
Old 02-28-2017 , 15:33   [CS:GO] Getting "SV" and "Var" values
Reply With Quote #1

Since CS:GO's release, multiple people have asked how to get the "SV" and "Var" netgraph values server-side. I don't know of anyone posting anything for this yet (and I did do a quick search), so I finally looked into it.

The attached include, with gamedata, exposes the three values used for this.

It contains three functions:
PHP Code:
float GetFrameTimeStdDev();

float GetFrameStartTimeStdDev();

float GetFrameComputationTime(); 
For example, to reproduce the netgraph display line, you can do:
PHP Code:
#include <sourcemod>
#include <sv-var>

public void OnPluginStart()
{
    
RegServerCmd("show_sv_stats"show_sv_stats);
}

public 
Action show_sv_stats(int argc)
{
    
PrintToServer("sv:%5.1f +-%4.1f ms   var: %6.3f ms"GetFrameComputationTime()*1000.0,
        
GetFrameTimeStdDev() * 1000.0GetFrameStartTimeStdDev() * 1000.0 );

    return 
Plugin_Handled;

Here's some test output:
Code:
Server empty, hibernating
sv:123.0 +- 9.9 ms   var: 10.091 ms

Server empty, awake
sv:  0.2 +- 0.5 ms   var:  0.551 ms

Server with 12 bots
sv:  6.5 +- 3.1 ms   var:  4.416 ms
I haven't tested the Linux gamedata, but it should work. Let me know otherwise.
Attached Files
File Type: inc sv-var.inc (1.5 KB, 573 views)
File Type: txt sv-var.games.txt (1.0 KB, 633 views)

Last edited by psychonic; 03-01-2017 at 06:50.
psychonic is offline
B3none
AlliedModders Donor
Join Date: Oct 2016
Location: United Kingdom
Old 04-24-2017 , 08:08   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #2

Great share, thanks very much
__________________
B3none is offline
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 07-02-2017 , 14:44   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #3

Thanks for this
__________________
ImACow is offline
ImACow
AlliedModders Donor
Join Date: Feb 2015
Old 07-02-2017 , 16:26   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #4

Is adding any of these values possible?

Code:
  CPU   NetIn   NetOut    Uptime  Maps   FPS   Players  Svms    +-ms   ~tick
  10.0 325262.6 2923122.8    1521    32  102.43      27    6.93    1.65    0.02
The CPU and FPS would be awesome!
__________________
ImACow is offline
sarangkaith
New Member
Join Date: Jun 2017
Old 07-03-2017 , 01:10   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #5

Hi,

I tried writing code for some complex values as input but was not able to succeed with it. The code ran perfectly for two inputs but yielded abrupt values for the third one.

------
Regards,
Sarang kaith
Theappsmiths Reviews

Last edited by sarangkaith; 07-04-2017 at 02:43.
sarangkaith is offline
AlpenPL
New Member
Join Date: Feb 2012
Location: Poland
Old 05-24-2020 , 19:17   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #6

HTML Code:
[SM] Exception reported: Failed to look up host_framestarttime_stddeviation address
Hello,
Does anyone have current valid gamedata file?
AlpenPL is offline
boboffuture
Junior Member
Join Date: Jun 2017
Old 06-15-2020 , 10:27   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #7

Here are the updated sigs for Linux
Attached Files
File Type: txt sv-var.games.txt (1.5 KB, 345 views)
boboffuture is offline
AlpenPL
New Member
Join Date: Feb 2012
Location: Poland
Old 06-16-2020 , 18:32   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #8

Quote:
Originally Posted by boboffuture View Post
Here are the updated sigs for Linux
thanks a lot, you are amazing!
AlpenPL is offline
fragnichtnach
AlliedModders Donor
Join Date: Oct 2008
Old 09-22-2021 , 14:08   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #9

How is it possible to get the actual sv-var.games.txt values? Does anyone have the actual working values? Thanks for any help.

edit: awesome extension if working. great work.

Last edited by fragnichtnach; 09-22-2021 at 14:09.
fragnichtnach is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 10-16-2021 , 22:22   Re: [CS:GO] Getting "SV" and "Var" values
Reply With Quote #10

Addresses for ptrFrameTimeStdDev and ptrFrameTimeStartStdDev from the first post are in the wrong order

sv-var.inc


sv-var.games.txt


Code:
stats;show_sv_stats
  CPU   NetIn   NetOut    Uptime  Maps   FPS   Players  Svms    +-ms   ~tick
  10.0      0.0      0.0       6     0  127.57       0    0.13    0.36    0.19
sv:0.13 +-0.36 ms   var: 0.19 ms

Last edited by lazarev; 01-30-2022 at 21:30. Reason: formatting
lazarev is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:53.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode