(Obsolete) Performance Goals and How to Actually Improve Performance in Your Games

I MADE THIS POST NOT BAD: [Improved] How to Actually Improve Performance in Your Games

PLEASE DO NOT FOLLOW THIS GUIDE. I HAVE KEPT IT HERE TO REMIND MYSELF THAT I MADE IT, IT HAS PLENTY OF BAD ADVICE

Before I start I would like to let it be known that this is my first forum post. If it’s in the wrong category please let me know!

I’m creating this post because I would’ve loved to know this information when I first started developing. None of the resources I found helped and I hope this helps someone!

This is all based on my experience and what I’ve observed

Performance Goals

Some Information
For the client, I’ve noticed popular Roblox games (Adopt me, Bloxburg, and a few others) keeping client memory usage around 600-700MB, and most posts I’ve found tell you to have < 400-450MB. I’ve concluded that it’s heavily dependant on your target audience (based on device).

These are my recommended thresholds for client memory usage (based on devices).

Mobile - 500MB
Most phones nowadays have at least 4GB of ram and often have at least 2GB free but you still want to account for lower-end devices.

Computers (Low-End) - 700MB
This seems to be the standard I’ve noticed in a lot of front-page games. Using my friends with lower-end machines (4GB of ram, intel i5-like CPUs, and no graphics cards) to see how their game runs: as long as they don’t use the max graphics setting they seem to run fine.

Computers (Mid-Range+) - 800MB
Not a huge jump? While you could raise this threshold to 900MB I would not recommend it. After all, you don’t just want people with decent computers playing your game, nor do you want to practice bad habits. I’ve noticed this is a nice cap.

Consoles - 800MB
Gaming consoles will typically perform better than your average computer so this is my guess. I have no experience with consoles so take this one with a grain of salt.

TL;DR: Keep server and client memory under 700MB

Notice: These are suggestions for FINISHED games. If your game is just core mechanics and is reaching these numbers you’ll need to do more than just follow a few steps online

How to Improve Performance

Tip #1
Some obvious but important things are: Not having a lot of unanchored parts, setting CanCollide to false on parts that won’t be interacted with, changing CollisionFidelity to Box in meshes and unions that won’t be interacted with. Also, be sure to not overuse the Cast Shadow property.

Tip #2
Put things in ServerStorage instead of ReplicatedStorage. If you’re going to have things that generate or get parented to the workspace, like accessories, weapons, tools, etc- put them into ServerStorage so you don’t waste memory replicating them to the client.

Tip #3
Lighting. A huge thing I see are games trying to use the ShadowMap or Future technologies when Voxel or Compatibility would work just fine. Roblox uses more resources to create shadows for those technologies. If your game doesn’t need them, try not to use them.

Tip #4
Avoid creating a bunch of unnecessary threads, try to disconnect functions to avoid memory leaks, and try to optimize your scripts. I’ve noticed using smaller variable names improves performance in large scripts with thousands of lines of code. Refrain from overusing infinite loops (having hundreds of loops running at once) and having too many scripts or instances in general (I typically have < 30 scripts, each script having a couple thousand lines of code).

Tip #5
Modify max players. If your game is fine with 10 people but becomes a problem with 15 or 20 then change the max player count to 10. If your game is fine with 40 players but can’t handle the 80 it’s allowed maybe you should reconsider your current limit. Stress-test your games with friends or testers to monitor performance issues and even find bugs along the way.

Tip #6
Use multiple places. If you find your game is lagging from the amount of content, try using the TeleportService, and have multiple places connecting your game. I’m aware, however, that this ruins the aesthetic for some games.

Tip #7
Don’t use textures (uploaded decals) if possible. It’s nice to have custom textures and tons of fancy art, but if you’re going for optimization use as little decals as possible. If you’re done using an asset you’ve directly uploaded to Roblox and are going to delete it, be sure to remove it in the Game Explorer.

Tip #8 (Added later)
Avoid creating a bunch of threads when you don’t need to and avoid infinite loops when possible.

How NOT to Improve Performance

There is no solid evidence that using unions instead of parts or meshes instead of parts, will help. Roblox loads things in the workspace based on their geometry. This part is so huge yet so small. You can typically ignore what you use to build as long as it’s not a largely unoptimized instance. In the end, you don’t want to sacrifice the look of your game for performance. Don’t listen to the people who recommend using unions or meshes to improve performance.

Changing textures to Smooth Plastic will impact your game in the smallest way possible. I do not recommend doing it to improve performance. The reasoning is Roblox still makes the client waste resources on loading the textures even if they aren’t there, however, it does help with rendering. If you’re adding a low-performance mode, do more than just change the part material with a pairs loop. I would change the lighting/post-processing effects (post-processing effects are recommended to be parented to the camera) I would also suggest changing particle emitters. Generally, optimize your game so it doesn’t need a low-performance mode. Although, if you want users on low-end devices to run higher graphics settings, changing BasePart materials to Smooth Plastic is helpful

Thank you for taking the time to read this lengthy post! If you have any suggestions or better tips please do let me know! Feedback is appreciated!

Edit: I forgot my server memory threshold recommendation. I recommend a maximum of 700MB but I’ve peaked at 800-900MB for some massive projects. I also didn’t go into detail about Voxels but I didn’t see much importance to it. Just know that Roblox’s terrain is generally optimized and is a good alternative for map-design.

Edit2: I’m hoping this post doesn’t get closed for being “unsubstantial”. I read through the community guidelines and tried to format my post accordingly but the vague term of “substantial” might have it removed. I hope this can still help a few people though!

Replies to Consider

This was how to improve performance in your Roblox games!
Thank you for all of the feedback!

52 Likes

Thanks, this helped a lot, will bookmark for future uses.

1 Like

A thing to note is that lower memory usage doesn’t necessarily equal better performance. Everything in your memory is just data until it is accessed.

Issues most frequently appear when Roblox tries to load a model, but something is hogging all of the memory. What happens then is Roblox has to unload some unused models, which will result FPS dips if they have to be loaded again. It’s frequently seen in open world games as stutters while rotating the camera.

There is also the rare “Ran out of memory” error, but you shouldn’t be able to reach that without some seriously bad scripting.

2 Likes

That’s a good point! I should’ve included that in my post, thank you for the response!

2 Likes

I think it’s worth elaborating on this, what exactly do you mean here (ignoring instances)? Sometimes using loops helps improve the code, and having “too many scripts” is kind of vague; is too many when performance takes a hit?

Loops shorten code (like saving your variables in a table instead), and on top of that, they help to avoid your note on variable name size impacting performance. I feel like based on your words, it would be better to refrain from underusing loops rather than overuse.

It’s kind of a rough scale to compare isn’t it?

How would I check how much MB my game is consuming?
And would there be a way to check how many threads a specific script in my game connected?

1 Like

Pressing F9 while in-game should open the developer console where you can check client and server memory

1 Like

I should’ve been more specific. I will update it!

It depends on the wait time between it, as it is almost always better to use functions if possible