AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [CS:GO] Getting "SV" and "Var" values (https://forums.alliedmods.net/showthread.php?t=294509)

psychonic 02-28-2017 15:33

[CS:GO] Getting "SV" and "Var" values
 
2 Attachment(s)
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.

B3none 04-24-2017 08:08

Re: [CS:GO] Getting "SV" and "Var" values
 
Great share, thanks very much :)

ImACow 07-02-2017 14:44

Re: [CS:GO] Getting "SV" and "Var" values
 
Thanks for this

ImACow 07-02-2017 16:26

Re: [CS:GO] Getting "SV" and "Var" values
 
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!

sarangkaith 07-03-2017 01:10

Re: [CS:GO] Getting "SV" and "Var" values
 
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

AlpenPL 05-24-2020 19:17

Re: [CS:GO] Getting "SV" and "Var" values
 
HTML Code:

[SM] Exception reported: Failed to look up host_framestarttime_stddeviation address
Hello,
Does anyone have current valid gamedata file?

boboffuture 06-15-2020 10:27

Re: [CS:GO] Getting "SV" and "Var" values
 
1 Attachment(s)
Here are the updated sigs for Linux

AlpenPL 06-16-2020 18:32

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

Originally Posted by boboffuture (Post 2705830)
Here are the updated sigs for Linux

thanks a lot, you are amazing!

fragnichtnach 09-22-2021 14:08

Re: [CS:GO] Getting "SV" and "Var" values
 
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.

lazarev 10-16-2021 22:22

Re: [CS:GO] Getting "SV" and "Var" values
 
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



All times are GMT -4. The time now is 10:42.

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