Member-only story

How I Slashed Memory Usage by Over 80% in a 2D Unity Game — Lessons in Optimisation

Discover practical tips to optimise 2D games in Unity, reduce build sizes, and improve performance with simple yet effective strategies.

Bruno Cicanci
Level Up Coding

--

Photo by Kevin Ku on Unsplash

Many years ago, I worked on a large project using Unity, and I learned so much about optimisation for 2D games during the development process that it’s worth sharing here.

I’ll list some of the key lessons I learned to improve Unity performance in 2D games. To give you an idea: the main menu of the game was using more than 350MB of memory on an iOS device, and the build size was slightly over 100MB. After implementing the optimisations listed below, memory usage dropped to 50MB on the main menu, and the build size shrank to just over 30MB.

As a reference, in this project, I used Unity 4.5.5 (remember, many years ago) and NGUI as a plugin to create the entire game interface and menu. Although I used this plugin, many of the tips below can also be applied to Unity’s built-in 2D system, and even to more modern Unity versions since these concepts are still valid today.

Reducing Image Sizes

The first thing to note is that no matter how much you compress an image, Unity…

--

--

Responses (1)

Write a response