AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   FPS Limiter v0.5 (https://forums.alliedmods.net/showthread.php?t=334150)

Natsheh 09-01-2021 16:40

FPS Limiter v0.5
 
2 Attachment(s)
  • Description :

    This plugin basically calculates the frames per second the player is receiving and adds a limitation to the player FPS forbidding the player from using a higher FPS than the value of the "fps_checker_maxfps" CVar.
  • Requirement for AMXX Version 1.8.2 or lower:
    Cvar Utilities module
  • Change logs
    Code:

    v0.3: * Released on AM.
            * Fixed a bug while the player is frozen causing FPS Over-limits
            * Added CVars !
            * Added Punishments !


    v0.4: * Organized the if statement checks in the cmdstart forward.


    v0.5: * Added a new CVar process the ability to activate or deactivate the plugin.

  • CVars :
    • fps_checker_state Default value: 1
    • fps_checker_maxfps Default value: 105
    • fps_checker_maxwarnings Default value: 3
    • fps_checker_punishment Default value: 0
      • 0 - Kick the player
      • 1 - Slay the player
      • 2 or higher - Ban the player depending the value of the CVar
  • Credits:
    Thanks to Dev-CS for the original plugin.

Note : if you're using the English language as your server language, there's no need for the translation file to be installed.




Servers are using this plugin!

JocAnis 09-03-2021 10:15

Re: FPS Limiter v0.3
 
is this very well tested with players who have higher ping?

Natsheh 09-03-2021 11:17

Re: FPS Limiter v0.3
 
Quote:

Originally Posted by JocAnis (Post 2756862)
is this very well tested with players who have higher ping?


Not really but doesn't players with higher ping mean lower fps?

JocAnis 09-03-2021 13:36

Re: FPS Limiter v0.3
 
Players with 100+ ping had issues (false kick) with plugin from dev-cs, i have no idea what you changed from their code/math but it will be better to test, if possible

HamletEagle 09-03-2021 13:52

Re: FPS Limiter v0.3
 
Quote:

Originally Posted by Natsheh (Post 2756865)
Not really but doesn't players with higher ping mean lower fps?

What does ping(network latency) have to do with fps(how many frames per second your gpu can output)?

Natsheh 09-03-2021 13:58

Re: FPS Limiter v0.3
 
Quote:

Originally Posted by HamletEagle (Post 2756874)
What does ping(network latency) have to do with fps(how many frames per second your gpu can output)?

yeah you're correct, it doesnt effect the fps but it does effects the forwards that are called depending on the player fps...


so short side story it won't effect it that much.


Quote:

Originally Posted by JocAnis (Post 2756872)
Players with 100+ ping had issues (false kick) with plugin from dev-cs, i have no idea what you changed from their code/math but it will be better to test, if possible


I don't think the ping has to do with the kicks, they've probably ran some bad plugins...

also the math behind this is not complicated, its so simple and no i didn't change anything in the calculations i only added some fixes and optimizations.

JocAnis 09-03-2021 16:13

Re: FPS Limiter v0.4
 
actually, you are totally right, i confused that ping issue with one module, sorry about that!

good job, i hope this will catch these bastards!

Natsheh 09-04-2021 09:27

Re: FPS Limiter v0.4
 
Quote:

Originally Posted by JocAnis (Post 2756885)
actually, you are totally right, i confused that ping issue with one module, sorry about that!

good job, i hope this will catch these bastards!

Thanks :) it sure will...

yuusuke 09-08-2021 02:59

Re: FPS Limiter v0.4
 
I think fps_max 100+ is ok, but when fps_override 1 and cl_cmdrate is over 105, server will receive lots of packets from clients. High cl_cmdrate cause high traffic due to fps_override is enable.
e.g.
fps_max 300, cl_cmdrate 300, fps_override 1 = client sending 300 p/s
fps_max 300, cl_cmdrate 300, fps_override 0 = client sending 101 p/s
fps_max 300, cl_cmdrate 101, fps_override 1 = client sending 101 p/s
fps_max 100, cl_cmdrate 300, fps_override 1 = client sending 101 p/s

Natsheh 09-08-2021 05:17

Re: FPS Limiter v0.4
 
Quote:

Originally Posted by yuusuke (Post 2757238)
I think fps_max 100+ is ok, but when fps_override 1 and cl_cmdrate is over 105, server will receive lots of packets from clients. High cl_cmdrate cause high traffic due to fps_override is enable.
e.g.
fps_max 300, cl_cmdrate 300, fps_override 1 = client sending 300 p/s
fps_max 300, cl_cmdrate 300, fps_override 0 = client sending 101 p/s
fps_max 300, cl_cmdrate 101, fps_override 1 = client sending 101 p/s
fps_max 100, cl_cmdrate 300, fps_override 1 = client sending 101 p/s

sv_maxcmdrate 101
sv_mincmdrate 101

Limit the cmd rate then.

Not sure how is this related to limit the fps.

yuusuke 09-08-2021 07:00

Re: FPS Limiter v0.4
 
Quote:

Originally Posted by Natsheh (Post 2757245)
sv_maxcmdrate 101
sv_mincmdrate 101

Limit the cmd rate then.

Not sure how is this related to limit the fps.

HLDS doesn't have sv_cmdrate function, so server can't limit cl_cmdrate from clients.

The easiest way to prevent a client who is using fps_max 100.5+ is to check fps_override 1.

Client can't have fps=100.5+ on its display without fps_override 1.

Napoleon_be 09-08-2021 09:05

Re: FPS Limiter v0.4
 
Quote:

Originally Posted by yuusuke (Post 2757252)
HLDS doesn't have sv_cmdrate function, so server can't limit cl_cmdrate from clients.

The easiest way to prevent a client who is using fps_max 100.5+ is to check fps_override 1.

Client can't have fps=100.5+ on its display without fps_override 1.

Why would u wanna kick people with fps_override "1" but no higher FPS than 100.5?

You shouldn't be kicking people for that sole reason.

yuusuke 09-08-2021 10:17

Re: FPS Limiter v0.4
 
Quote:

Originally Posted by Napoleon_be (Post 2757260)
Why would u wanna kick people with fps_override "1" but no higher FPS than 100.5?

You shouldn't be kicking people for that sole reason.

fps_max 300, cl_cmdrate 300, fps_override 1 = client sending 300 p/s (client's real FPS is 300.5, real packet rate is 300)
fps_max 300, cl_cmdrate 300, fps_override 0 = client sending 101 p/s (client's real FPS is 100.5, real packet rate is 101)
fps_max 300, cl_cmdrate 101, fps_override 1 = client sending 101 p/s (client's real FPS is 300.5, real packet rate is 101)
fps_max 100, cl_cmdrate 300, fps_override 1 = client sending 101 p/s (client's real FPS is 100.5, real packet rate is 101)

I don't wanna kick a client who has higher FPS on his display,
but when he has fps_max 300, fps_override 1, and cl_cmdrate 300 in the same time,
server will receive lots of flooding packets from him.

If I don't want clients to use high FPS, I will check fps_override.
If I don't want server to receive flooding packets, I need to check fps_max , fps_override, and cl_cmdrate.

DJEarthQuake 09-08-2021 10:53

Re: FPS Limiter v0.4
 
Quote:

Originally Posted by yuusuke (Post 2757252)
HLDS doesn't have sv_cmdrate function, so server can't limit cl_cmdrate from clients.

The easiest way to prevent a client who is using fps_max 100.5+ is to check fps_override 1.

Client can't have fps=100.5+ on its display without fps_override 1.

If one needs to kick on intent; here's the precursor approach. The spoiler has both styles.

https://forums.alliedmods.net/showpo...64&postcount=3

The no nonsense tell player where they stand on connect, kick now at the door. Otherwise later uncouthly on performance after they are already settled in. Both styles can be tested individually or simultaneously and clearly precursor is more efficient.

ddag1 10-03-2021 23:38

Re: FPS Limiter v0.4
 
Nice plugin! Can you please add a CVAR to enable/disable it?

Natsheh 10-04-2021 05:43

Re: FPS Limiter v0.4
 
Sure ill add the ability to unhook the functions when the plugin is paused.

thEsp 10-04-2021 06:10

Re: FPS Limiter v0.4
 
This plugin is dull and I'm surprised it wasn't unapproved. For once it's inaccurate, second it's been already made countless times, third the FPS issue most likely has to do with non-steam versions of the game.

DJEarthQuake 10-04-2021 06:43

Re: FPS Limiter v0.4
 
FPS has nothing to do with Steam or not.

Natsheh 10-04-2021 06:51

Re: FPS Limiter v0.4
 
Quote:

Originally Posted by thEsp (Post 2759577)
This plugin is dull and I'm surprised it wasn't unapproved. For once it's inaccurate, second it's been already made countless times, third the FPS issue most likely has to do with non-steam versions of the game.

1. Inaccurate how? The plugin checks the player fps each second with 99% correct rate.
2. If it has been made countless times post a link approving your doubts.
3. Nonsteam ? Read again the previous posts before posting some useless claims, i already said higher fps increases the forwards that are called depending on the user fps, which will increase the cpu run time.

thEsp 10-04-2021 09:12

Re: FPS Limiter v0.4
 
You must be so delusional to think your plugin is unique of some sort. Back in the day players had problems with high FPS rates where the player movement would deteriorate and the game would become choppy. Considering the fact non-steam servers usually run old versions of the game, that's one fair reason why somebody would want to limit their players' FPS. Anyway there's a reason why sys_ticrate exists.

Natsheh 10-04-2021 16:59

Re: FPS Limiter v0.4
 
Well let me tell you that the fps limiter is not meant to be set on a competitive servers but more like on modded servers where shooting is not the only thing, and i am not delusional i know the script is well coded and the plugin is unique.

thEsp 10-05-2021 04:55

Re: FPS Limiter v0.4
 
Quote:

and i am not delusional i know the script is well coded and the plugin is unique
Most definitely...

Natsheh 10-05-2021 06:36

Re: FPS Limiter v0.4
 
Quote:

Originally Posted by thEsp (Post 2759690)
Most definitely...

Till now you're useless arguing, instead post links for other fps limiter plugins, or you can just stop arguing about nonsense and remain silent, if you've found a similar plugin to this one i shall remove it.

And here're some examples of bad/useless plugins

Code:

https://forums.alliedmods.net/showthread.php?t=316778
https://forums.alliedmods.net/showthread.php?t=321913
https://forums.alliedmods.net/showthread.php?t=322090
https://forums.alliedmods.net/showthread.php?t=314431

And there're alot more you can find them here.

thEsp 10-05-2021 09:41

Re: FPS Limiter v0.4
 
:salty:

kooomax 12-20-2021 19:36

Re: FPS Limiter v0.5
 
https://i.ibb.co/82nSj0w/image.png
Help ?

//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// fps_limiter.sma
// D:\Program\Fraps\mods\addons furien\addons\amxmodx\scripting\fps_limiter.s ma(119 -- 121) : error 017: undefined symbol "CvarType_Integer"
// D:\Program\Fraps\mods\addons furien\addons\amxmodx\scripting\fps_limiter.s ma(124 -- 126) : error 017: undefined symbol "CvarType_Integer"
// D:\Program\Fraps\mods\addons furien\addons\amxmodx\scripting\fps_limiter.s ma(162) : warning 213: tag mismatch
// D:\Program\Fraps\mods\addons furien\addons\amxmodx\scripting\fps_limiter.s ma(162) : warning 213: tag mismatch
// D:\Program\Fraps\mods\addons furien\addons\amxmodx\scripting\fps_limiter.s ma(167) : warning 213: tag mismatch
// D:\Program\Fraps\mods\addons furien\addons\amxmodx\scripting\fps_limiter.s ma(176) : warning 213: tag mismatch
// D:\Program\Fraps\mods\addons furien\addons\amxmodx\scripting\fps_limiter.s ma(194) : warning 213: tag mismatch
//
// 2 Errors.
// Could not locate output file D:\Program\Fraps\mods\addons furien\addons\amxmodx\scripting\compiled\fps_ limiter.amx (compile failed).
//
// Compilation Time: 0.16 sec
// ----------------------------------------

Press enter to exit ...

OciXCrom 12-21-2021 06:47

Re: FPS Limiter v0.5
 
Read the requirements.

kooomax 12-21-2021 14:25

Re: FPS Limiter v0.5
 
I did and put libraries

OciXCrom 12-21-2021 14:49

Re: FPS Limiter v0.5
 
Add

Code:
#define CvarType_Integer CvarType_Int

under

Code:
#include < cvar_util >

kooomax 12-21-2021 21:02

Re: FPS Limiter v0.5
 
This plugin is unstable

Quote:

Auto-restarting the server on crash

Console initialized.
Using breakpad crash handler
Setting breakpad minidump AppID = 10
Forcing breakpad minidump interfaces to load
dlopen failed trying to load:
/home/client57/.steam/sdk32/steamclient.so
with error:
/home/client57/.steam/sdk32/steamclient.so: cannot open shared object file: No such file or directory
Looking up breakpad interfaces from steamclient
Calling BreakpadMiniDumpSystemInit
Protocol version 48
Exe version 1.1.2.7/Stdio (cstrike)
Exe build: 03:13:55 Oct 25 2021 (2753)
STEAM Auth Server
Alias name is invalid
Alias name is invalid
Alias name is invalid
Server IP address 137.74.231.87:27015

Metamod-r version 1.3.0.128 Copyright (c) 2016-2018 ReHLDS Team (rebuild of original Metamod by Will Day and Jussi Kivilinna)
Metamod-r comes with ABSOLUTELY NO WARRANTY; for details type `meta gpl'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `meta gpl' for details.

Metamod-r v1.3.0.128, API (5:13)
Metamod-r build: 17:47:48 Aug 24 2018
Metamod-r from: https://github.com/theAsmodai/metamod-r/commit/0cf2f70

AMX Mod X version 1.8.2 Copyright (c) 2004-2006 AMX Mod X Development Team
AMX Mod X comes with ABSOLUTELY NO WARRANTY; for details type `amxx gpl'.
This is free software and you are welcome to redistribute it under
certain conditions; type 'amxx gpl' for details.

stray key in process_key: item_getiteminfo 61
./hlds_run: line 255: 8552 Segmentation fault$HL_CMD
[/QUOTE]

bigdaddy424 12-21-2021 22:21

Re: FPS Limiter v0.5
 
Great plugin,
Could you add a native to get current fps for an index?

Code:
native get_user_fps(id) public slash_fps(id){     new iMenu = menu_create("FPS Counter", "menu_handler")     for(new i = 1; i <= sizeof(MAX_PLAYERS); i++){         if (is_user_connected(id))             menu_additem(iMenu, fmt("(%d) %n", get_user_fps(i), i));     }     menu_display(id, iMenu)     return PLUGIN_HANDLED } public menu_handler(id, iMenu, iItem)     menu_destroy(iMenu)

kooomax 12-27-2021 09:19

Re: FPS Limiter v0.5
 
I have tried it on more than version amxmodx and the same result

karaulov 12-29-2021 11:54

Re: FPS Limiter v0.5
 
For what need this limit? If Player has monitor 144hz/244hz, need stop playing cs 1.6??

Natsheh 12-29-2021 13:44

Re: FPS Limiter v0.5
 
Quote:

Originally Posted by karaulov (Post 2767209)
For what need this limit? If Player has monitor 144hz/244hz, need stop playing cs 1.6??

Nope but he needs to lower his fps because some players won't have a good PCs so it would be a big disadvantage for them and as you know not everyone is a rich bastard.

karaulov 12-29-2021 17:59

Re: FPS Limiter v0.5
 
Other players get messages with rate 'cl_updaterate', no problem if another Player has more fps...

Natsheh 01-02-2022 16:29

Re: FPS Limiter v0.5
 
Quote:

Originally Posted by karaulov (Post 2767233)
Other players get messages with rate 'cl_updaterate', no problem if another Player has more fps...

If youve read the previous posts you will understand also why .

simanovich 05-21-2022 15:39

Re: FPS Limiter v0.5
 
Quote:

Originally Posted by karaulov (Post 2767209)
For what need this limit? If Player has monitor 144hz/244hz, need stop playing cs 1.6??

goldsrc bhop glitches with fps higher than 100.


All times are GMT -4. The time now is 06:17.

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