Construct is a web-based game development tool, with all its games powered by browser technology. Some people still think browsers are slow for gaming. We're here to dispel that myth! Things were certainly different 10 years ago, but we've come a long, long way.
A sprite is an image that forms the basic building-block of a game. How many sprites do you think Construct can render on-screen and still hit 60 frames per second (FPS)? 500? 1000? Maybe more? We built a test that measures exactly that. So lets find out!
The test
We've called our test PiggyPerf after our piggy mascot. We'll link to the test at the end of this blog. It starts out creating ten thousand (!) sprites. Then it repeatedly measures performance, estimates how many sprites it can get at 60 FPS, and then adjusts the sprite count. Usually it fairly quickly arrives at a final number. The test exercises both JavaScript performance for issuing draw calls for thousands of sprites, as well as the GPU performance for rendering them. It looks a bit like this.
Yep, that's a lot of piggies.
An old Android device
Let's set the bar low, so we know what the minimum we can rely on is. We dug out an old Samsung Galaxy S8, originally released in early 2017. So this model is now 5 years old. How does it fare on the test?
Performance testing is hard. Left idle, the device power management continuously adjusts performance to save battery, meaning the test doesn't always settle on a final number. However it can manage around 8000 sprites on-screen at 60 FPS. Pretty impressive for its low-power state!
If the screen is repeatedly tapped the device stays in a high-power state, and manages 21500 sprites. Even better! That is the true capability of the device when battery saving is taken out of the equation.
Some games won't even have that many sprites in total - on and off screen. Many games will also only need a few hundred sprites at a time on screen. So this is far more than enough. Even this device is capable of handling intensive Construct games.
Some other mobile devices
We also have a Nokia 7.1, a low-cost device first released late 2018, so the model is now 3 years old. That manages 12600 sprites idle. Even better than the S8's idle score!
How does a modern device fare? The Asus ZenFone 8, a high-end device released just last year, manages 71000 sprites. That is a staggering number of piggies.
How about iPhone? We have an old iPhone 7 Plus, released late 2016, now also over 5 years old. This also has power management that makes the test vary, but it can clearly manage 10000 sprites at 60 FPS. Naturally newer devices will be much faster. This is the least you can expect!
Desktop
OK, so low-end mobile devices can handle thousands of on-screen sprites no problem. Let's see what the top end can do. We ran the test on a 2021 Macbook Pro with Apple's new M1 Pro. With a fullscreen window, it can handle 88000 sprites in Chrome, and 38000 sprites in Safari. In both cases if the window is resized smaller the score goes up even more, as there is less rendering work.
Let's pull out all the stops and try it on a desktop gaming PC with an Intel Core i7-6700K and NVidia GeForce GTX 1050 Ti graphics - released 2015 and 2016 respectively, so not even the latest gear. That can handle 113000 sprites in a maximized Chrome window (2560x1440 resolution). Over one hundred thousand sprites! How many piggies does anyone really need?
Conclusion
Even old and low-end devices can comfortably handle thousands of sprites on-screen and still hit a smooth 60 FPS. Of course, off-screen sprites are not rendered, so have a lower performance impact - this is all on-screen content. This is vastly more than many games will need, and enough even for high-intensity games. There's more to game performance than on-screen sprites, but this illustrates how capable Construct games are, thanks to four things:
- JavaScript is now exceptionally fast - rivalling or even beating some other native technologies.
- WebGL is now ubiquitous for high-performance rendering on your GPU, presenting pretty piggy pixels perfectly promptly.
- We've worked hard to optimise Construct so it's super efficient at handling even ridiculous amounts of content.
- Over the years hardware gets faster and better, meaning the definition of a low-end device increases over time too.
Construct's web-based engine works and performs consistently across all platforms. That means you can count on great performance in your Construct games no matter where you publish them.
To highlight how much things have changed, way back in 2012 - a whole decade ago now - we did our first HTML5 performance comparison, and the results were mixed to say the least. At that time many devices were unable to hit 30 FPS even with a simple game. But if you thought browsers were slow, times have changed. Now the web is a high-performance gaming platform capable of great things across all devices!
We believe that the web is the gaming platform of the future. Want to get involved? Get started with Construct today.
Try the PiggyPerf test yourself! How many sprites can the device you're on right now handle?