Improving Game Performance: Benchmarking, Microprofiler, Developer Stats, and Developer Console

Chapters

  1. Introduction
  2. Video
  3. The Game
  4. Tips for Performance Test
  5. Devices for Performing Test
  6. Optimization Tips
  7. Configuring Settings
  8. Developer Stats
  9. Developer Console
  10. Microprofiler

Introduction

image
Court Smith - TechSpectrum | Project Manager | Game Producer | Event Organizer | Accelerator

I’m writing this guide to help everyone better understand the Roblox tools and the methodology behind how to best use them to your advantage. It is a discipline and it can become costly if you want to expand your test on more devices. You have to be willing to commit to doing tests regularly and care about how your game is doing.

If you are serious about improving your game’s performance to work on a wider range of devices, please read this guide. You may also reach out to me on Discord if you have any questions.

Video

The Game

We’re going to be looking at Polybattle, a Gamefam owned First Person Shooter.

Tips for Performance Test

Expand for an explanation.

1. Make sure you are on the same map and server.

Different maps may be optimized differently and vary by what meshes are on it. Be sure to simply follow an alt account on multiple devices at once.

2. Being in a different location on the map affects stats.

Player action from one end to another will cause a variety of changes to occur. This matters more especially if you have Streaming Enabled on. You can find lower-performing places in one area of the map than others cause of content distribution.

3. Ensure there are no background apps

If you are testing on your personal phone vs. a test phone, be aware that your personal may be doing more work due to your apps running that can cause you to have false positives about your game’s performance.

4. Test with background apps

You can make sure all devices you are testing with at the same time have running apps cause realistically not everyone will close every app they have to play a game. Always expect people to not play with only Roblox running.

5. Save Profiler Reports (Dumps)

If you keep these you can investigate and the team to inspect what’s going on in your game.

6. Mobile has a Memory Profiler

In case no one knew, you can scroll down and see how to get your mobile profiler reports.

7. Studio is not accurate.

Studio is always loading the full game, and the studio tools itself have overhead in how much memory is being used. This is basically “noise” that can misrepresent actual performance.

8. Emulation is not accurate.

Roblox tries their best to emulate mobile RAM but they still do not accurately represent the performance of bare metal of a GPU and CPU of a real phone. Do not blindly trust the performance stats here alone.

9. Test your game quality on 10, not Automatic.

Roblox likes to put mobile on Automatic, this can mean one device is at graphic 5, and another at 7 and it will result in varying results on your performance comparison that is misleading.

Devices for Performance Test

Above is a list of all the devices I use to do a performance test and begin benchmarking the game. Not everyone has more than one device, however many people have a phone or at least a friend who has a device you do not.

Here is my recommended list of devices:

Samsung Galaxy S9

Specifications

RAM: 4 GB
GPU: Adreno 630
CPU: Octa-core (4x2.8 GHz Kryo 385 Gold & 4x1.7 GHz Kryo 385 Silver)
Released: 2018

iPhone 8

Specifications

RAM: 2 GB
GPU: Hexa-core (2x Monsoon + 4x Mistral)
CPU: Apple GPU (three-core graphics)
Released: 2017

iPad 9.7

Specifications

RAM: 2 GB
GPU: PowerVR Series7XT Plus (six-core graphics)
CPU: Quad-core 2.34 GHz (2x Hurricane + 2x Zephyr)
Released: 2018

Xbox One S

Specifications

RAM: 8 GB
GPU: 1.4 T-FLOPS, 12 compute units @ 914MHz
CPU: 1.75GHz AMD Jaguar eight-core
Released: 2016

Any Home Office Computer

Find something with at least 4 GB of RAM, 8 is a more modern home computer baseline.

So why are all of these devices important?

Roblox treats all platforms differently, as not all libraries are shared on the same platform.

For example, Roblox Mobile games actually will get reduced texture sizes than the regular Roblox PC client in order to dynamically increase performance.

The wider the range of your testing devices and knowing their specifications will help you understand the capabilities of how well your game performs across your player base.

Do Not Trust Emulation

I can’t say this enough, but Roblox emulation is not accurate for testing performance! It is a tool better used for making sure your game is compatible and your UI is laid out correctly. If you are on a high-end PC and emulating a low-end phone, it will not reflect the same Harward (GPU, CPU, etc) as the real device would.

Optimization Tips

Roblox Guide and my own Tips.

Expand for an explanation.

1. Reduce the number of parts casting shadows.

You can toggle off all the parts ShadowCast property except on a few key buildings that need a shadow. This reduces the number of shadows the client has to render.

2. Reduce the number of Meshes and/or reduce polycount

Roblox has to load these in which can affect your load time to a degree so it’s better if you can find a way to sometimes go without them. Roblox does not compress these, so a 1 MB mesh will be a 1 MB download into memory. Even reducing the polycount of the mesh you need will increase performance.

3. Compress your Audio and use OGG files.

Your audio can quickly stack up memory if you’re not careful with how much is playing and how big of a file it is. The most optimized file type Roblox supports is OGG as you can get the lowest memory cost out of it.

4. Compress your Textures, Reduce the Size, use JPEG

Roblox will try to compress this themselves down to 5.3 MB however you should not get lazy here. Too many of these stacks up quickly and can result in over 200 MB before you know it. Where possible take a 1024x1024 image for example and reduce it to 512x512 to get better results, as well and making it a JPEG which is a lossy file type. A PNG is lossless so it will take up more memory.

5. Use Streaming Enabled

I’m serious, if you learn how to code appropriately for the limitations of SE you can actually get your game to be at the highest possible performance for thousands of low-end device users.

6. Avoid using lighting effects.

Although Roblox will reduce these effects themselves, it’s better if players can be at 10 and experience the best quality you have to offer. Sometimes not all lighting features add to the experience and blur for example can come at a slight cost.

7. Do animations on the client.

There are times when people are coding heavy animations to be done on the server, however, it’s actually better for you to let the client render these themselves since the more work the server has the do, the longer it takes to do other tasks on the Task Scheduler.

8. Turn off collision of parts that are being touched but don't need collision.

Roblox is constantly doing physics checks on “awaken” parts, any part that isn’t moving or being interacted with in some way is “sleeping” and you might have some parts that simply just don’t need to be doing physics calculation checks.

9. Use Mesh RenderFidelity 'Performance'

Not all parts can use this, but I would have it on for anything that isn’t key to the user experience. Something like a faraway island can have these toggled to Performance.

10. Change Mesh CollisionFidelity

Say you had a crate with tons of faces on it, Roblox will try to calculate physics on all of those collision faces. However, if you change the fidelity to “Box” for example than Roblox has to do a lot less work for performance.

Configuring Settings

First, if we’re going to do a proper performance test, we have to make sure that all our devices are configured the same. If you don’t, you run the risk of having a very inaccurate test with varying results that will be misleading.

  1. Graphics Mode: Manual
  2. Graphics Quality: 10
  3. Performance Stats: On

Graphics Mode

If you set this to Automatic you might have a phone that is at 5, but your PC could be at 9 or 10. This would obviously affect the performance stats of the game.

Graphics Quality: 10

There are certain things that Roblox will disable depending on your graphics settings such as the lighting technology, shadows, and particle rate. You want to be doing what is called a “stress test” to measure your game’s true performance. Don’t be scared of the game lagging and crashing on you, that is the very thing you are inspecting for.

Developer Stats

Roblox provides a range of important stats here that reflect the health of your game in terms of performance. Pay attention to these as you play your game

Memory

image

Despite the target being 200 MB, the reality is you will actually not be able to meet this with your game. A better target would be to aim for 400-600 MB.

It reflects how much memory (RAM) is being used to run the game. Having background apps running can of course affect this developer stat so be aware of what else is running that could affect this.

Some examples of what this reflects are:

  1. Textures
  2. Parts
  3. Meshes
  4. Audio
  5. Physics
  6. Code

The more you have of each of these, the higher your stat will raise. Keep in mind, that your RAM will affect this stat as well.

The Galaxy S9 (4 GB) can get 300-400 MB playing Polybattle, but an iPhone 8 (2 GB) can be 700-800 MB, which isn’t bad at all but it shows how the amount of RAM you have can cause variance in your stats.

CPU

image

Another slightly higher you want target is 33 ms, however, I would recommend you target 15-20 ms.

The job of the CPU on any device is to process data and perform tasks, be aware that more threads and a higher processing rate (GHz) will alter stats from device to device.

Your game’s code, physics, and UI can affect the CPU. An example might be an animation, these are handled on the client which increases the stored memory to use run it.

The performance of Polybattle for mobile averages around 15-18 ms.

GPU

image

Again, 33 ms and we want to target 15-20 ms.

Roblox doesn’t do much on the GPU but you’ll find that shadows, terrain, meshes, lighting, and particles can affect this. You won’t often find it to be physics because the CPU is what calculates that.

So reducing the shadow cast and other effects can free up performance. Even using Streaming Enabled can reduce what is being used in memory for the GPU to do work.

Sent

image

This is what all the client is sending to the server, and although Roblox says they recommend 50 you should absolutely do your best to go for less than 5-10 ms. If you look at Polybattle, it does a great job of being really performant here despite being a full-on war game with shooting, with vehicles.

Try to not send huge packets of data via remote functions and events.

Recieved

image

Similar to sent, you want to stick around less than 5-10 ms at best, as this will affect the clients performance for replicating data. This is when the client is receiving data from the server to do work, such as letting you fire bullets.

Ping

image

This is completely your internet and depending on the speed of it will affect this greatly. If you have a high ping, it may be worth investigating. However you can generally diagnose your network performance with Recieved and Sent.

Developer Console


The developer console is great for more than just finding error logs, you can also see what parts of your place are using up memory on the client. You can see if you have too many textures that might be taking up 200 MB

Read through the Roblox article above and open the Memory Management Tips section to find out ways to increase performance!

Microprofiler

The microprofiler is extremely useful especially for programmers, you should be pausing on where you see the bar reach its peaks and looking to see which task going on are taking up time. You can zoom in and see the breakdown of tach task.

Please watch the video guide and read gavins cheat sheet to completely understand what it is you’re looking at in the profiler.

Make sure for on mobile you are on the same network.

image

You can save your mobile microprofiler if you are looking at it on the network!

Send this to your team mates!

Conclusion

I plan on having a virtual event for this later, and may include some live example cases of issues we can inspect and find.

Let me know if you want to see more on this guide!

155 Likes

This may be the first Developer Forum post that explains these things in a way that noobies can understand.

Thank you.

7 Likes

Now I know how to properly benchmark on Roblox! Yay!
Thanks for the guide, sir!

grabs every device in the house supporting roblox

4 Likes

Get yourself a nice charge station.

15 Likes

How does graphics 10 help? It just lags the game

The point is to stress test, if your game lags at 10 it means one of 2 things:

  1. Your game is probably not optimized, read my optimizations tips to try to increase performance and use the Microprofiler.

  2. Your device is too old to handle Roblox well; try to use a phone that is relatively 2017-2018 with 2-4 GB of RAM.

Can you share the games link and your phone specs?

If you have to, benchmark at Quality 8 if your phone is too old and turn off your background apps.

2 Likes

I had a iphone 6 but now a 10 thanks!

An iPhone 6 is very old and has only 1 GB of RAM. If you can make your game run perfectly fine on it at Quality 10 you are perfectly fine for the majority of roblox users but yes I can see why its struggling for you.

I have a iPhone 10 now but the iPhone 6 crashed when jailbreak launched

Love this post! I think I finally found something that would help me understand more in depth inner workings in Studio that is going to be invaluable!

1 Like

I have an iPhone 4s that supports Roblox

I can’t even do a stress test on it, it turns into a camp fire. :rofl:

1 Like

Howdy folks, I’m expanding on this bonus as a bonus that you can save money uploading songs too!

Music File Size
image
image

MP3 - 70 Robux
OGG - 35 Robux

Now to show you how JPG and smaller file size compares!
image
image

Please please optimize!

9 Likes

Great tips, thanks for sharing.

Has it been confirmed that Roblox uses the exact files that you upload? I figured it you uploaded an image that was too large they would scale it on their end before they feed it out to clients. Also, is it confirmed that they don’t store the jpg as a png on their end anyway? If so, then I could see how reducing the resolution would help memory but if they are storing as png on their end (or maybe they already compress and store jpg for that matter) then your upload compression won’t change the footprint in the end.

Wow they really charge less for Ogg of the same playback length? Nice find. I wonder how bad it would affect the end sound if you uploaded a 2x speed track then played it back at half speed to save more Robux on the upload.

Howdy!

Yes I did confirm with some of the product managers at Roblox while I was interning. The only thing they do is make lower res versions of your image. However I want you to bare in mind that relying on the Roblox to determine the best quality for the player is not advised. Mobile is the only device they treat differently for resolutions but by still doing lower res you improve all platforms baseline memory management.

I am not sure if they convert it to png but the way you can check it your roblox cache. I assume they wont be converted because they only said they create lower resolutions for mobile. They do not compress images besides simply change resolution.

I would avoid a 2x speed upload because the auto mod system has not been kind to me with some sound effects if it can’t interpret whats going on well.

1 Like