SetFPSLimit: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Improved information, also making use of the countless discussion between staff and racing scene people (for instance) that have taken place over the years in discord, dev channels and bugtracker. So these are plain facts as investigated.)
Line 15: Line 15:


==Issues when increasing FPS==
==Issues when increasing FPS==
It is also recommended to set a conservative FPS limit (between 30-60 and 74 highest) because high FPS can break some GTA internal calculations. The higher the FPS the more of a problem these become:
Note: with "very high" FPS, any FPS limit over 74 is meant.
* Impossibility to move sideways while aiming certain weapons.
It is recommended to set a conservative FPS limit (between 40-60 and 74 highest) because high FPS can break some GTA internal calculations, causing various bugs. The higher the FPS the more of a problem these become:
* Speed of vehicles is effected, racers with a higher FPS will have an unfair advantage.
 
* Pressing the horn button to turn on and off sirens gets really hard the higher the FPS.
* The higher your FPS, the longer it takes for you to start moving sideways while aiming certain weapons. At very high FPS, it may become impossible to do so.
* Climbing over certain objects will result in instant death. Example at: 2520.108, -1681.407, 19.406, 266
As the most common issue, you should know that the breaking point for this bug is 70 FPS, so we recommend using a limit of 70 FPS if you intend to avoid this bug. Using 74 FPS is only recommended in non-combat focussed gamemodes (no gunfights) as the aforementioned breaking point of 70 FPS means that at 71 FPS, you will start getting a delay in moving sideways while aiming (having to hold the strafe key for longer). At 70 FPS, it still works perfectly.
* Animations can randomly get messed up.
 
* There were more issues like not being able to take off in Skimmer which MTA developers have fixed.
74 FPS is the breaking point that opens the door to various more severe GTA bugs related to FPS and physics.
* Satchels can be thrown ~10% less distance.
 
* Physics of vehicles is effected, both high and low FPSes may bring their own set of unfair advantages. Speaking about the consequences of high FPS in this context, up to 70 or 74 FPS is considered safe (as any differences in physics, if they do exist to begin with as they theoretically should, are so tiny that they are unmeasurable and thus wouldn't affect racing results in practise). Anything beyond 74 FPS may cause impactful discrepancies.
 
* Pressing the horn button to turn on and off sirens gets really hard at very high FPS.
* At very high FPS, climbing over certain objects will result in instant death. Example at: 2520.108, -1681.407, 19.406, 266
* At very high FPS, satchels can be thrown up to ~10% less distance.


==Example==  
==Example==  

Revision as of 06:49, 1 March 2021

This function sets the maximum FPS (Frames per second) that players on the server can run their game at.

[[{{{image}}}|link=|]] Note: When set client side, the actual limit used is the lowest of both the server and client set values

Syntax

bool setFPSLimit ( int fpsLimit )         

Required Arguments

  • fpsLimit: An integer value representing the maximum FPS. This value may be between 25 and 100 FPS. You can also pass 0 or false, in which case the FPS limit will be the one set in the client settings (by default, 100 FPS and the client fps limit should also be manually changed via "fps_limit=0" in console or MTA San Andreas 1.5\MTA\config\coreconfig.xml).

Returns

Returns true if successful, or false if it was not possible to set the limit or an invalid value was passed.

Issues when increasing FPS

Note: with "very high" FPS, any FPS limit over 74 is meant. It is recommended to set a conservative FPS limit (between 40-60 and 74 highest) because high FPS can break some GTA internal calculations, causing various bugs. The higher the FPS the more of a problem these become:

  • The higher your FPS, the longer it takes for you to start moving sideways while aiming certain weapons. At very high FPS, it may become impossible to do so.

As the most common issue, you should know that the breaking point for this bug is 70 FPS, so we recommend using a limit of 70 FPS if you intend to avoid this bug. Using 74 FPS is only recommended in non-combat focussed gamemodes (no gunfights) as the aforementioned breaking point of 70 FPS means that at 71 FPS, you will start getting a delay in moving sideways while aiming (having to hold the strafe key for longer). At 70 FPS, it still works perfectly.

74 FPS is the breaking point that opens the door to various more severe GTA bugs related to FPS and physics.

  • Physics of vehicles is effected, both high and low FPSes may bring their own set of unfair advantages. Speaking about the consequences of high FPS in this context, up to 70 or 74 FPS is considered safe (as any differences in physics, if they do exist to begin with as they theoretically should, are so tiny that they are unmeasurable and thus wouldn't affect racing results in practise). Anything beyond 74 FPS may cause impactful discrepancies.
  • Pressing the horn button to turn on and off sirens gets really hard at very high FPS.
  • At very high FPS, climbing over certain objects will result in instant death. Example at: 2520.108, -1681.407, 19.406, 266
  • At very high FPS, satchels can be thrown up to ~10% less distance.

Example

This command sets the fps limit in a command handler.

Click to collapse [-]
Server
function fpsFunction( player, command, limit ) -- First define the function
  if hasObjectPermissionTo ( player, "function.setFPSLimit" ) and limit then 
    -- If the player has permission to set FPS limit and limit is submitted...
    setFPSLimit ( limit ) -- Set the fps.
  end
end 

addCommandHandler ( "setfps", fpsFunction ) -- Attach the setfps command to fpsFunction function.

See Also