Creating the most optimized Roblox game- runs at 6000+ FPS!

Those of you who follow my Twitter may know that I’ve been on a personal quest to create the most optimized game on Roblox.

First, I got my game to run at 600 FPS. That was a great start, but it made me hungry for more.
After quite a bit more work, I got it to break into the quadruple digits at just over 1000 FPS.
Recently I had another breakthrough and got it running at over 2400 FPS!

Then, simply by making my game’s window not fullscreen in order to lower the render resolution, I got it to run at over 3500 FPS!!

I made the place public and added a global leaderboard so people can try it out- and some people have run it at over 6000 FPS!

You can try it out here:


I know you’re all wondering how on earth I accomplished this. Good question! Here’s my internal documentation of the process:

Removing 3D and Physics Work

This project is UI only. There is no physics, no 3D world, no characters to run around. That means it should run fast as hell. However, the Roblox engine has no concept of UI only games- so we have to do our best to minimize the impact of the pointless 3D work that is done in the background.

  • Hello darkness my old friend:
    We set our lighting to the simplest possible- voxel tech, no shadows, all black color values, and brightness 0. This reduces some lighting work.
    We add a Sky, with no celestial bodies or stars and all the textures set to a single pixel. This saves us from sending the big sky and moon textures to several drawcalls.
    Adding a BloomEffect with Size 0, Intensity 0, and Threshold inf actually lets the engine skip the entire Glow step on the GPU.

  • Floating Point:
    We set gravity to 0, making it so that there are absolutely no forces in play for the physics engine.

  • Empty inside:
    We do not spawn in characters for the players, and the world has no geometry. There is nothing but our minimal sky.

  • Narrow minded:
    We set our 3D camera FoV to 1, the lowest it supports. This way, we’d render only a tiny sliver of the aforementioned sky.

  • Blindfolded:
    We set our camera CFrame matrix to all zeros, causing the camera to render pure black as it is distorted down to nothingness.

  • No thank you:
    Roblox injects default scripts, such as camera controls, character controls, chat, and more. We override these by replacing them with empty directories or (in cases where we can’t override) by destroying them on startup.

Although some of these may seem insignificantly small, our frame times are merely a couple hundred microseconds at thousands of FPS and therefore they really do matter.

Benchmarking

How much of an improvement do we see from these 3D/Physics changes? Let’s find out.

Running on a Zephrus G14 Laptop (Ryzen 9 5900HS, RTX 3060 Laptop, 16GB 3200MHz RAM) using RenderDoc for capture

Baseplate: 1357.24 μs GPU time
On max graphics

baseplateMaxRenderDoc

Baseplate: 382.59 μs GPU time
On lowest graphics

baseplateRenderDoc

Optimized: 751.61 μs GPU time
On max graphics

optimizedMaxRenderDoc

Optimized: 87.04 μs GPU time
On lowest graphics

optimizedRenderDoc

Result:

Max graphics:
GPU Time: 44.62% decrease
Lowest graphics:
GPU Time: 77.24% decrease

These are reasonable and predictable results, and extremely pleasing.

You may try the benchmark place yourself, as I’ve turned it into a friendly competition:


Result

Well, how does this all run in my actual game? Like a champ, that’s how!

1200+ FPS even while UI is being animated, 1800 FPS peak at idle.

fps

128 Likes

you really dont need 4k fps. Considering the max you can see is 240 ghz if u have that type of monitor.

Not to mention the amount of gpu usage out of this. 60 fps really is more than enough.

still a good tutorial on how to optimize. Good job :+1:

12 Likes

Obviously you’d cap your FPS to your monitor’s refresh rate- the point here is that it takes only ~0.2 milliseconds to render the entire frame!

If you cap at 60FPS, then your GPU & CPU usage will be super duper low since they’re idling 98% of the time (only active for 0.2ms out of 16ms).

10 Likes

The goal of this tutorial is scrape extra performance out of parts you may not be familiar with. Perhaps allowing increased abilities within your game. It also teaches you where Roblox optimise in specific aspects, and what works and what does not when optimising, for example maybe your game does not need gravity, and therefore you can boost performance a bit by not using it.

6 Likes

@TheH0meLands you obviously aren’t really familiar with Boatbomber’s work. Our friend here is known to make amazing experimental work like this for the heck of it.


Really cool text place. Didn’t think that I’d squeeze out almost 3k FPS out of this puppy LOL on Roblox. Great job as always Boat!

7 Likes

Is this cheating?

9 Likes

All is fair in love and war



9 Likes

lol, I can’t even scale it that low, I’ve got a 3080ti and a ryzen 7 3800x with 64 of 3200 mhz ram and the max im getting is 3000 fps :frowning:

1 Like

You’re bound by your CPU here, so that big ol 3080ti can’t save you. : )

I am getting 132 fps max, don’t be greedy for more fps, remember me

1 Like

My ryzen is overclocked to 4.5GHz, ill see if i can pull some kind of other trickery…

Hey any clue? I am getting 132 fps max, why not more

same, i get up to about 330 fps

1 Like

damn, you broke the record lol

wonder who’s gonna get 5k fps first

Dear god what have you done :flushed:
What’s your specs?

2 GB RAM, i3 processor and uh 1.9 ghz cpu

pls dont ignore

Your performance is as expected given the low tier machine you’re running on.

5 Likes

I thought Roblox only allowed 60 FPS at the max. I use a Mac mini, and this might only be for Mac users.

It caps to 60 but you can remove the cap:

1 Like