Performance Issues with Hyper Casual Web Game
Since I have released a version of the Runner game that does not meet performance requirements and fails to provide a perfect player experience, I present the following:
STATEMENT
Why is this Hyper-Casual Game currently performing so poorly?
What is the problem?
Patrons who tested the latest version found that the game does not meet the required performance standards on Android devices. In certain cases, it struggles to reach even 2–3 FPS. Patrons noted that under such unfavorable conditions, the screen appears dark green and nothing is visible. I also reproduced this issue on the Oppo A15, a mass-market device.
Causes
This situation arose due to my lack of professionalism and arrogance. By testing exclusively on high-end Apple devices (M1 and 14 Pro Max), I failed to account for how outdated standard hardware is. The game’s code was insufficiently optimized for common devices. In a rushed effort, I implemented some diagnostic tools that allowed me to pinpoint the technical causes of poor performance more precisely.
Diagnostics revealed that the biggest performance issues lie in the rendering pipeline, specifically when rendering terrain platforms, especially in levels with many platforms. Additionally, there are problems with the main character’s animation and collision detection between the character and platforms.
Technical Analysis
Diagnostics showed that:
• More than 50% of processing time is spent on rendering logic, most of which is terrain platform rendering (white color in the diagram).
• Character animation significantly slows down the game (red color in the diagram).
• Black color represents input processing, but due to an error, it also includes time spent on collision detection between the character and each platform.
Actions Taken
To address this issue, I not only developed additional diagnostic tools but also optimized rendering by moving certain per-frame calculations to the level loading phase, if the results remained constant. For example, texture scaling for different platform sizes is now precomputed.
I conducted a more detailed analysis of a wider range of hardware. Below, I provide a table comparing test results before and after these micro-optimizations.
I also fixed numerous bugs, such as:
• The “falling through the ground” bug, which occurred when frame times were too long, causing gravity from the previous frame to displace the character too far before collisions were recalculated.
• A glitch where the character would fall inside a platform, leading to a “transcendental state”, resulting in a green screen with no visible objects.
• Adjusting the animation keyframe rate to 15 (originally 60 keys per second), though this only affected file size, not performance.
Additional Testing
To assess the full extent of the issue, I conducted further tests on additional hardware to determine whether the micro-optimizations improved performance.
* Some of the values are limited by a browser
Device | Before Optimizations (FPS) | After Optimizations (FPS) | Evaluation |
MacBook M1 (Native OpenGL 3) | 290 | 290 | No change |
MacBook M1 (Chrome) | 120* | 120* | No change |
Apple 14 Pro Max (Chrome) | 60* | 60* | No change |
Oppo A15 | 3 | 6 | Double the speed but still inadequate |
Dell Latitude (Edge) | 27 | 40 | Improved, but it was not too bad to start with |
Lenovo C330 Chromebook | N/A | 14 | Still insufficient |
Next Steps
To improve the situation more significantly I am planning to take the following actions in the priority order
Task | Affected Component | Details | Estimated time to complete |
Change Instanced Rendering | Terrain platforms | Will reduce the number of render calls | 2 weeks |
Optimize armature deformation calculation | Character animation | Currently, the animation system interpolates frames if a render occurs between keyframes. The animation file has 15 keys per second, making interpolation unnecessary. My system can blend two animations simultaneously, but since only one animation plays at a time, this feature is redundant. Optimizations may slightly reduce quality, but on such a small character, it will be unnoticeable. | 4 weeks |
Binary Space Partitioning or Quadtree partitioning | Collision detection between the character and every platform | BSP, used in early Doom and Quake, would allow handling unlimited platforms without performance loss. | 4 weeks |
I was thinking of changing the Mixamo rig to the variant having fewer bones, but I am not convinced that could make a big impact.
Files
Runner
single touch runner
Status | In development |
Author | Lapė Kalė (Žvaigždes) |
Genre | Platformer |
Tags | 3D, Casual, Parkour, Runner |
Comments
Log in with itch.io to leave a comment.
A follow-up is that I did change to Instance Renedering and optimized the Animations, and that improved the performance greatly. I never had to go to Binary space partitioning solution as the performance was not suffering anymore. But sadly I added new features, like boids-like enemies that are also animated, and the performance need to be optimized again. I have 4FPS on Oppo again and before it was around 10FPS, or even 20FPS with precached animation frames.