Particle FPS drop?

So the title is pretty self-explanatory, but visual effects on my game tend to drop the frames per second by about 20-50 depending on the effect. For example, the move shown below drops the FPS from 180 to 130. Is there a workaround for this for optimization’s sake? I already know of client-server replication and rendering particles on the client side, but someone told me that particles will render on the client anyways.

4 Likes

I’m assuming the majority of your effects use particle emitters, if that’s the case make sure your being efficient with your particles, a rule of thumb is to never emit over 10-25 particles per emitter, anything above like 100-500 is dangerous and can cause major frame drops. Use textures that can achieve the same effect of alot of small particles, while being a few large particles.

3 Likes

You wouldn’t have to do anything, as the player can just lower their Roblox quality, but if you wanted a custom script to decrease the rate of particles if a player lags, then you can try something like this:

local RS = game:GetService("RunService")

RS.RenderStepped:Connect(function(delta)
    print(1/delta)
    --Use this data to decrease a particle's rate
end)
1 Like

False, running :Emit bypasses graphics level

Edit: (unless your an idiot and use
.enabled)

2 Likes

well some of the visual effects emit an effect on the player with :emit(1) but also some objects such as a fireball are constantly enabled and are just moved from replicated storage into workspace

1 Like

If that’s so, then try decreasing the amount of times you call :Emit() using my FPS technique.

local RS = game:GetService("RunService")

local particle = workspace.ParticleEmitter

RS.RenderStepped:Connect(function(delta)
    particle:Emit()
end)

Or, if you want to go ahead and try this out, you can make a custom UI, giving the player the ability to change the graphics in the game, High, Normal or Low. That’s when you can change the :Emit() speed. It doesn’t have to be automatic.

1 Like

try casting them on client instead of server

1 Like

You call emit once… Your “technique” is a never ending loop running Emit every render???

1 Like

Can you send a video of the effect?

1 Like

this doesn’t really change much

i dont have a video uploading program compatible for devforum

1 Like

just use less particles lol

I thought you were trying to decrease the particle amount if the game detects lag on your client side. If you want to do it once, you can try something like this?

local RS = game:GetService("RunService")

function createParticles()
    
    task.wait(5)
    local spawn = RS.RenderStepped:Connect(function(delta) print(1/delta) end)
    task.wait(1)
    spawn:Disconnect()
    
end

createParticles()

You can disconnect the event once it has finished.


Also if you’re calling :Emit() only once and it lags, then you have to decrease the particle rate. There’s nothing else you can do besides let the player lower their Roblox render quality.