Anyway to reduce projectile FPS drops?

Hello, everyone

I’ve noticed recently that in my game, Redshift Arena, the game’s FPS drops tremendously when there’s a lot of people using the Plasma Rifle - which is Projectile based.

I’d rather not drop the weapon as it’s one of the more-skill based weapons currently, but it seems to cause massive performance hits so I might have to remove it.

The Authoritative projectile is created on the client who fired the shot so their projectile isn’t laggy with hit detection and stuff like that. It fires a remote event which then creates the projectile for everybody else - these projectiles are dummy projectiles and have no code behind them other than a function to destroy them on hit.

Should be noted that I’m using BodyMovers to handle their velocity.

Thanks in Advance!

What’s the projectile material, transparency?

If you are using a part with a transparency >0 and <1 with a fast moving object, you may encounter lag on the client, in form of degraded FPS or all out FPS drops… The same goes for, and seems to be amplified by using neon parts - especially if there is a lot of them.

You can pin this issue down by checking out the spikes (fps drops) in the Microprofiler.

2 Likes

Ironically enough, the plasma rifle has neon material, a 0.2 transparency, as well as particle effects for the projectiles. Didn’t know simple graphical effects caused such a big performance hit.

This would explain why the Render FPS drops constantly when there are a lot of projectiles.

The amount of time and resources it takes the client to render a semi transparent part is huge compared to a fully transparent (or opaque) part.

With a semi-transparent part, the client must figure out what’s behind the part and render it every single frame, compared to a opaque part (0 transparency), where it does not need to worry about what’s behind that object at all.

The opposite goes for a fully transparent part - the client doesn’t need to worry about that part at all, and so can skip right past it when rendering the frame.

Your best bet for performance will be to make those projectiles 0 transparency. You can likely keep them Neon, however depending on their size it might be worth just making them SmoothPlastic with a particle emitter or something more efficient.

3 Likes

This reduced the lag tremendously.

Now I have to transition the giblets in my game to use SpecialMeshes instead of MeshParts.

Did tests with SpecialMeshes and they perform a lot better than MeshParts with collision fidelity set to box.

1 Like