Snake.io

Snake.io is a large, multi-million dollar project, that is on Android, iOS, Web, and more. Developed by Kooapps, my role as a game developer was to optimize and maintain the project with the dozens of other developers and artists it had.

Google Play App Store Web

Optimization

When I was first hired by Kooapps, one of the first things I noticed (using the Unity memory profiler) was that the game was allocating 30mb+ for multiplayer. This is problematic because for a 1 GB RAM device this is a ton and multiplayer was supposed to be a disabled feature.

Additionally, I also noticed that the collision system for the game was inefficient. How so? When snakes are moving in the game, they only need to consider their head and tail for collision as that is the only time the collision is updated. However, what was happening was that the snakes were frequently generating collisions around their entire body due to the tail deleting its own body.

I worked with my fellow coworkers to spec out a collision system that didn't need to generate collision throughout its entire body. To do this, we used prime numbers to uniquely identify snakes and added the snake's own prime number to itself from its head (and removed it from its tail). With this, we did not need to recalculate collision anymore as the tail wasn't deleting collision in the middle of the body. Instead, the tail was only subtracting the snake's unique prime number ID.

Besides this contribution, I also spent time reducing lag spikes caused by live events as it led to terrible player experiences on low-end devices. I also reduced the app size by using tools like Android Studio to analyze the snake APK. From this, I found out that assets were in the project twice (as an Addressable and normal asset) due to poor referencing. Additionally, some assets could have been made in-engine too for better quality.

Not Just Optimization

But my only role wasn't optimization. I also worked with the team to fix revenue-affecting bugs and implement time-saving tools for our live ops system. Snake.io is an old project lasting nearly 4 years, and so I made sure the code in the project was up to date, documented, and clean. In fact, one of my first actions with the project was to remove tens of thousands of lines of code.

Additionally, part of the reason it can ship multiplayer is through my effort to make sure it had parity with single-player. Every single time Kooapps launched multiplayer it led to bad metrics, and I figured out that this partially was due to poor performance and the game working very differently from singleplayer. This led to an effort by me to improve multiplayer performance and have it be in parity with singleplayer. That is not to say I alone made multiplayer successful, without the help of the many other developers, producers, and designers, multiplayer couldn't have happened either.

My coworkers at Kooapps were amazing to work with and are some of my great friends right now. If it were not for the help of (20) Levi Perez | LinkedIn I would not be here writing about my great experience as he taught me so much about game development, terminal, and git which made my work much easier. I am grateful for the experience as it helped me both grow as a developer and a person.