Ambient ped and traffic density can be reduced by a client resource that applies density multipliers every frame. This changes the world players see; it does not guarantee a server-performance or FPS improvement. Check whether your existing population resource already owns these settings before adding another.
The configuration and code examples here target FiveM for GTA V Legacy. Enhanced has different runtime and compatibility rules; check Cfx.re’s Legacy-to-Enhanced changes before applying them to an Enhanced server.
Create the resource
Create resources/[local]/npc_reducer/. Add fxmanifest.lua:
fx_version 'cerulean'
game 'gta5'
client_script 'client.lua'
Add client.lua beside the manifest. This example starts at half the default multiplier:
local density = 0.5
CreateThread(function()
while true do
Wait(0)
SetPedDensityMultiplierThisFrame(density)
SetScenarioPedDensityMultiplierThisFrame(density, density)
SetVehicleDensityMultiplierThisFrame(density)
SetRandomVehicleDensityMultiplierThisFrame(density)
SetParkedVehicleDensityMultiplierThisFrame(density)
end
end)
Start and adjust it
Add ensure npc_reducer to the server configuration. For a newly created resource, use the normal refresh/start process or a controlled server restart. Check the server and F8 logs for loading errors.
Edit the value, then restart the resource to load the changed client code. Editing a file alone does not change code already running on connected clients. Keep the frame wait: these native effects apply to the current frame.
Test the gameplay effect
Compare the same route before and after the change. Check city traffic, parked vehicles, scenarios and jobs that depend on ambient peds. Script-spawned mission entities may be controlled separately. If another population script overrides the values, configure one owner instead of adding more competing loops.
Measure client frame time and resource cost using the same scene. To roll back, stop the resource and remove its startup entry; verify the previous population behaviour after reconnecting.