rehlds icon indicating copy to clipboard operation
rehlds copied to clipboard

client fps limiter

Open that-is-not-great opened this issue 1 year ago • 7 comments

hello masters of rehlds, is it possible to add a client fps limiter to rehlds? here is a very primitive example:

void SV_RunCmd(usercmd_t *ucmd, int random_seed)
{
	usercmd_t cmd = *ucmd;
...
if ((1.0 / ((double)ucmd->msec * 0.001) > 100.0)) {
// bail out if more than 100 fps
return;
}

similar to the spam block in void SV_FullUpdate_f(void)

  1. is that a reasonable way of detecting fps? worked for my tests
  2. where is the best place to put this block? SV_RunCmd is called by PF_RunPlayerMove_I
  3. from my tests all actions are blocked if > 100 fps, would it be possible to process only a up to limit of 100 fps and drop the overload?

that-is-not-great avatar May 03 '23 12:05 that-is-not-great

Of course, it will be a great addition.

RauliTop avatar May 10 '23 17:05 RauliTop

Best addition will be to prevent users having too powerful hardware and who can handle +200 FPS all the time, to ... join servers! But, "that-is-not-great" huh! So, me, I play with "fps_max" to "200", because I want a more fluid game, but you will not allow me to huh?! You sadist!

Just code a plugin (with hook of "pfnUpdateClientData", or/and, with CVars "fps_override" & "fps_max" queries) for such vicious thing!

StevenKal avatar May 26 '23 22:05 StevenKal

Just code a plugin (with hook of "pfnUpdateClientData", or/and, with CVars "fps_override" & "fps_max" queries) for such vicious thing!

the values of the cvars can be spoofed, are not reliable, I want to control only from the server side. We also limit rate and updaterate, cmdrate, is that sadistic too? Its only logical to limit client fps as well. It is relevant on servers with multi jumps, parachute, etc. that allow high fps players to move faster, cause their code runs more often

that-is-not-great avatar Jul 31 '23 11:07 that-is-not-great

idiots block protectors, cl_filterstuffcmd and fps! leave cs!!

fork1488 avatar Oct 15 '23 08:10 fork1488

idiots block protectors, cl_filterstuffcmd and fps! leave cs!!

wtf are you rambling idiot?

that-is-not-great avatar Oct 17 '23 16:10 that-is-not-great

Just code a plugin (with hook of "pfnUpdateClientData", or/and, with CVars "fps_override" & "fps_max" queries) for such vicious thing!

the values of the cvars can be spoofed, are not reliable, I want to control only from the server side. We also limit rate and updaterate, cmdrate, is that sadistic too? Its only logical to limit client fps as well. It is relevant on servers with multi jumps, parachute, etc. that allow high fps players to move faster, cause their code runs more often

get_uc(uc_handle, UC_Msec); gives an accurate framerate, see https://forums.alliedmods.net/showthread.php?t=123302

KO-9 avatar Nov 24 '23 17:11 KO-9

from my tests all actions are blocked if > 100 fps, would it be possible to process only a up to limit of 100 fps and drop the overload?

Technically? Yes.

Actually? No, client prediction will break.

Instead you could just zero out movement and notify the user.

For this reason (no clean fix on the server side), this is absolutely not something ReHLDS should be doing. Just write a module for it.

namazso avatar Nov 25 '23 00:11 namazso