PawClawStudios

How we make 3D games run smoothly on old phones

A lot of children play on hand-me-down phones. So we test every game on a slow one first, and here is what that taught us.

Our games are colourful 3D, which can be heavy work for a phone. We decided early that "it runs fine on my phone" is not good enough: if a game stutters on an older, cheaper device, the children using those devices get a worse game. So every one of our games is measured on a deliberately modest test phone, a Zebra TC21 with a Snapdragon 660 chip, an Adreno 512 graphics processor and 2.7 GB of memory. If a game holds 60 frames per second there, it holds almost anywhere.

The numbers we started with

When we first measured properly, the results were humbling. Pets Run ran at 15 to 19 frames per second in a run. Pop Blast Heroes managed 13 to 25 during a stage and froze for about 17 seconds when a stage started. Paw Brawl Arena fights ran at 32 to 40. On a fast computer all three looked perfect.

1. Choose the renderer by measuring

Our engine, Godot, offers more than one way to draw a 3D scene. The modern Vulkan path is usually the faster choice, but on this older graphics chip the same scene took about 28 milliseconds per frame with Vulkan and about 17 with the simpler OpenGL path. That one setting was worth more than any other change.

2. Compile the shaders behind the loading screen

The biggest problem was not frame rate at all. It was freezes. Every new combination of material and effect needs a small graphics program, and the phone builds each one the first time it is drawn, at roughly 0.7 seconds each. A new scene could freeze for 9 to 15 seconds, and a new effect in the middle of a run caused a hitch of half a second or more. Our fix is a warm-up: while the loading screen is showing, the game quietly draws one tiny copy of everything that can appear later, so all those programs are ready before you play. Since then there are no compile hitches during play.

3. Never build things in the middle of the action

Creating a new enemy, coin or effect while the game is running costs time on a slow phone. Everything that appears more than once is now built in advance and reused, from enemies to particle bursts. One enemy spawn went from about 20 milliseconds to about 1.

4. Fake the expensive effects

We did not want the cheap phone to get an ugly game. So instead of switching effects off, we look for a cheaper way to get the same look. Real-time shadows cost about 9 milliseconds a frame on the test phone, so characters get a soft blob shadow instead. Three spotlights in a menu cost almost 5 milliseconds, so they became painted pools of light. On screen you can barely tell.

5. Test on more than one phone

Fixing the slow phone is not the end. A setting that was harmless there, anti-aliasing, made one much faster phone with a newer graphics chip leak memory until the system closed the game after about a minute. We only found it because a player's phone showed it. Now we check memory on a high-end phone as well.

The result

All of our phone games now hold 58 to 60 frames per second on the test phone, with no freezes during play. The browser versions on this website use the same work: Paw Kart Rally and Whisker Heights both run at 60 frames per second in Chrome on our test laptop. If one of our games ever stutters on your device, please tell us which device. We read every message.

More from the blog