Open Einheit-101 opened 3 years ago
for i=2, 15 do setWorldSoundEnabled(6, i, false, true) end
^ This reduces my fps drop from -20 to -5 fps
The obvious catch here is that if we disable collision detection the rain would fall through the ground so you don't any drop effects.
(Just had to point this out here)
The problem is that i dont see any drop effects on regular ground anyway, just on Peds and vehicles. However it still calculates these collisions. Maybe we could toggle to disable this, if it saves performance.
As i see, the rain effect is not reversed yet, so this should be done to point the exact source of this problem.
for i=2, 15 do setWorldSoundEnabled(6, i, false, true) end
^ This reduces my fps drop from -20 to -5 fps
So this is basically a report about https://github.com/multitheftauto/mtasa-blue/issues/1067 then.
Even with #1067 sorted out we still lose 5 fps, which could be fixed aswell.
I'll make a build with and without OnClientWorldSound
.. I'm really curious whenever that would solve it.
Description setRainLevel() impacts performance which scales linear with existing collision shapes in the surrounding area. More complex collisions - less fps Higher rain level - less fps
setRainLevel(0) = 98 fps setRainLevel(0.5) = 90 fps setRainLevel(1) = 85 fps setRainLevel(2) = 80 fps
crun for i, obj in pairs(getElementsByType("object")) do setElementCollisionsEnabled(obj, false) end Disabling all collisions in the area = 98 fps again
To reproduce
Possible solution Make it possible for rain to ignore collisions and add it as argument in setRainLevel() or add a new function setRainCollisions(bool). It should be doable.
Multi Theft Auto v1.5.8-release-20881.2