Raised This Month: $32 Target: $400
 8% 

Variable timing sys_ticrate


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Technical/Development       
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-27-2020 , 19:38   Variable timing sys_ticrate
Reply With Quote #1


This systematically puts the server to sleep or incrementally steps the tic per player. Servers advertising 10K tic waste CPU on 0 players.

Notes.
Do not put sys_ticrate in command line start up otherwise HLDS is stuck at that rate!!

Many servers cannot produce over 1000 tic.

Linux servers with pingboost can get numbers that high from my understanding on reads online about the topic. Citing link dead so I removed it. Did Windows get it?
-pingboost <1/2/3> - Selects between optimized HLDS network code stack. Set this on 2 usually reduces latency toward 1ms without loss of activity input packets.


Feel free to modify how you like or give advice.

sys_timing 0|1 disables|enables plugin. Recommended: keep a base sys_tic in mapchangecfgfile.
sys_sleep Tic hibernation rate. The tic when there are 0 players.
sys_quota Tic rate quota. The tic added per connected player.


Model name : Intel(R) Core(TM) i3 CPU 540 @ 3.07GHz. @10,000 beyond core limit.

Quote:
CPU In Out Uptime Users FPS Players
59.75 0.00 0.00 0 0 7425.17 0
Working example.
Quote:
sys_ticrate
"sys_ticrate" is "1248"

CPU In Out Uptime Users FPS Players
37.50 10.00 17.98 1679 911 1172.97 4

CPU In Out Uptime Users FPS Players
43.50 13.04 30.74 1680 911 1213.74 4
Sleep.
Quote:
CPU In Out Uptime Users FPS Players
1.00 0.00 0.00 1 0 35.17 0
SMA is on Github. Compile locally.
__________________

Last edited by DJEarthQuake; 08-09-2022 at 14:50. Reason: Removed dead URL from Steam powered about Pingboost and Linux only
DJEarthQuake is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 01-27-2020 , 20:39   Re: Variable timing sys_ticrate
Reply With Quote #2

.sma?...
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-27-2020 , 22:08   Re: Variable timing sys_ticrate
Reply With Quote #3

I can't believe I did that. Thanks buddy. Typo. It wasn't compiled. Sheesh.
__________________
DJEarthQuake is offline
^SmileY
Veteran Member
Join Date: Jan 2010
Location: Brazil [<o>]
Old 01-28-2020 , 14:19   Re: Variable timing sys_ticrate
Reply With Quote #4

Why get_playersnum_ex(GetPlayersFlags:GetPlayers_ ExcludeBots) is supposed to return any value than 0 at precache?

PHP Code:
public plugin_precache()
{
    
#if AMXX_VERSION_NUM < 183;
    
g_iHeadcount get_maxplayers()
    
#else
    
g_iHeadcount get_playersnum_ex(GetPlayersFlags:GetPlayers_ExcludeBots)
    
#endif

also sys_ticrate is a cvar, can you use pointer
__________________
Projects:

- See my Git Hub: https://github.com/SmileYzn
PHP Code:
set_pcvar_num(pCvar, !get_pcvar_num(pCvar)); 
^SmileY is offline
Send a message via MSN to ^SmileY Send a message via Skype™ to ^SmileY
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-28-2020 , 14:52   Re: Variable timing sys_ticrate
Reply With Quote #5

Hi ^SmileY! That explains a lot. Appears I was misusing precache as a stock. The pcvar will be easy. Good finds my friend. New upload coming soon.
__________________
DJEarthQuake is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 01-28-2020 , 16:30   Re: Variable timing sys_ticrate
Reply With Quote #6

I definitely didn't understand it:

PHP Code:
#if AMXX_VERSION_NUM <183;
g_iHeadcount get_maxplayers ()
#else
g_iHeadcount get_playersnum_ex (GetPlayersFlagsGetPlayers_ExcludeBots)
#endif 
get_maxplayers () is the result of the total slots on the server (if it is 32 slots, get_maxplayers = 32, however, get_playersnum_ex () returns the number of players on the server, this does not make any sense.

And why are you checking if the player is connected if you are not using any action on it, just the server?
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/

Last edited by iceeedr; 01-28-2020 at 16:37.
iceeedr is offline
Send a message via Skype™ to iceeedr
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-28-2020 , 16:59   Re: Variable timing sys_ticrate
Reply With Quote #7

Thanks iceedr! I got that fixed right away. That couldn't wait. I had to look again to see the redundancy on the filter! Thank you.
__________________

Last edited by DJEarthQuake; 01-28-2020 at 19:19. Reason: Remade code again.
DJEarthQuake is offline
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 01-29-2020 , 05:04   Re: Variable timing sys_ticrate
Reply With Quote #8

Hello. So if my sys_ticrate in server.cfg was 1000, now it should be 60? And are these good rates for public server?

// Server Rates
sv_minrate 0
sv_maxrate 100000
sv_minupdaterate 60
sv_maxupdaterate 101
sys_ticrate 60 (with sys_timing)
rate 25000

Thank you.
LithuanianJack is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-29-2020 , 10:50   Re: Variable timing sys_ticrate
Reply With Quote #9

Rates. Valve has a server.cfg snippet to assist in finding that sweet spot.

Use whatever you usually do in server.cfg. That prevents server being struck in hibernation when plugin is disabled. The base rate remains until your first player joins. Then it is either multiple of the quota or hibernation rate.
__________________
DJEarthQuake is offline
RaZ_HU
Senior Member
Join Date: May 2015
Location: Hungary
Old 01-29-2020 , 13:36   Re: Variable timing sys_ticrate
Reply With Quote #10

As far as I know changing sys_ticrate on a live server does literally nothing than changing the cvar's value, but maximum FPS is still the value that the server was started with if the command line contains -sys_ticrate.

But if you have access to the starting line that actually launches the hlds process, you can change the -sys_ticrate to +sys_ticrate (yes, change the hyphen to a plus symbol), after that you can change the sys_ticrate value that will really change the server FPS maximum limit.

To test this, for example:
Start server with -sys_ticrate 300, then type stats in the console
You will get the following:
Quote:
stats
CPU In Out Uptime Users FPS Players
58.51 0.00 0.00 3 0 300.70 0
Type in console sys_ticrate 150, but you will still get 300 as current server FPS if you type stats again.

Now stop your server and start it with +sys_ticrate XYY and the command's value will directly affect the server FPS as you set it.

In the case you don't have access to your server's startup line, then you can't change the real FPS, but the cvar's value only.

Why do you use AMXX_VERSION_STR as your plugin's version?
This isn't an official plugin that comes with the package, you should do normal versioning.

Last edited by RaZ_HU; 01-29-2020 at 13:39.
RaZ_HU 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 19:03.


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