Lag or long load times can cause a poor user-experience and prevent users from returning to your experience. Roblox is constantly working to improve performance on its end, but there are ways you can improve performance as well.
Roblox offers various built-in tools for analyzing experience performance. The first is the Performance Task widget, which is is toggled via Ctrl+F7, or Command+F7. This is a basic way to monitor memory, CPU, GPU, and network stats. If you see "spikes" in memory or other graphs, you can investigate them using the following tools:
- Developer Console: When running a live version of a experience, this shows diagnostic message from in-experience scripts, categorized memory usage, network stats, and more. See Developer Console for details.
- MicroProfiler: An advanced tool for analyzing and debugging client-side performance. See MicroProfiler for details.
Place Setup and Design
The following setup and design tips can make significant improvements in overall experience performance.
Content Streaming allows the Roblox engine to dynamically load and unload assets in regions of the world. For a detailed explanation, best practices, and implementation notes, see Content Streaming.
Very large worlds may benefit from teleportation. For instance, if a fantasy world has several towns, a castle, multiple large dungeons, and a haunted forest, you should make each a separate place and teleport players between them at specific points, like a dungeon’s entrance/exit.
Roblox’s terrain system offers peak efficiency per unit and automatic level-of-detail. When using terrain, consider these tips:
- Blend different materials for visual variation — they cost the same in terms of performance (except for water).
- Enable Content Streaming.
One light with high brightness is cheaper than many intersecting lights with lower brightness, and it’s more optimal to use non-moving, non-shadow-casting lights. Also, the ShadowMap lighting technology causes all objects to cast shadows by default, so consider Voxel lighting if your experience doesn’t require distinct shadows.
Models placed inside certain storage containers are replicated to the player’s local client — even if they don’t exist in the 3D world — meaning they occupy memory even if the player can’t see them. It may help to keep infrequently-used models in ServerStorage until they need to be placed in the experience.
Level-of-detail for a mesh or solid-modeled part defines how detailed it appears in proximity to the camera. If a place has a large number of detailed meshes or solid-modeled parts, you can improve performance by setting each instance’s RenderFidelity property to Automatic.
|Distance From Camera||Render Fidelity|
|Less than 250 studs||Highest|
|500 or more studs||Lowest|
Anchor all non-moving objects, as anchored objects are more efficient in terms of rendering/physics. Do not simply rely on a large object’s mass to keep it in place.
If an object will be in close proximity to moving objects or players, but it never needs to collide with them — for instance a “ghost” wall — set CanCollide to false. Do not, however, take time to set this property on distant objects that will never collide with anything, as it will not improve performance.
Use partial object Transparency sparingly, as semi-transparent objects inhibit a lot of internal rendering optimizations. If you require transparency on several BaseParts, attempt to merge them using solid modelling (a transparent union is more optimal than a group of 10 smaller transparent parts).
Materials / Texturing
For BaseParts, use built-in Materials in favor of Texture objects, as materials are more efficient in regards to replication and rendering. For MeshParts, however, a texture applied via its TextureID is equally efficient to setting its material. That said, textures occupy more memory than materials, so you should monitor the GraphicsTexture value in the Memory tab of the Developer Console.
Both solid-modeled and MeshPart objects have a CollisionFidelity property which controls the “detail” of the object’s collision bounds. The following options are ordered from most performant to least performant.
|Box||Use this option if the object looks like a block or collisions with it can be approximated by a box that spans its bounds.|
|Hull||Use this option for simplified collision bounds on convex objects like balls and traffic cones.|
|Default||Use this option for the most accurate collision bounds which match the object's physical appearance.|
If you’ve enabled the ShadowMap lighting technology, all objects will cast shadows by default. If a specific object doesn’t need to cast distinct shadows, disable its CastShadow property.