(Deep Sea Game) Memory Problem with Mobile Implementation / by Legolas Wang

You have to think about memory if you ever want to make a mobile game. Well, at the very beginning, I did not realize that the game will hit the memory allowance that quick. Yet the memory problem appears right at the beginning stage of the Deep Sea.

The original plan was to make Deep Sea a mobile game, with each room be built on an individual scene, linking by the gate which loads the connected room. However, due to the fact that we use highest quality 3D assets, this limitation was hit quicker than expected. The first few built on the iPhone X was successful, when using two particle system and around 10 items. However, by the time of running, the runtime size already reaches around 1.2GB, which surprising, is even large than the asset itself.

Running on actual device makes me realize that the profiler usage on unity could not reflect the real usage on mobile device at all. The real usage is almost twice as big as it shows on the profiler. Thus, the game is very limited with the amount of assets due to the memory limitation.

Then I did a search and trying to figure what really happened. Since I got a memoryNotEnough warning from Xcode when I run later builds, I start digging into what happened. It turns out, that iOS is actually quite smart, it’ll warn you twice with this warning before it kills the game. At the third time of warning, the game will be killed immediately.

That’s the very reason why I see a consequent three warnings and the game is gone. Based on my search, the max memory allowance for iOS device is around 1 gigs. With modern 7, 8, or X capped at 1392MB. That is not a lot, and its reasonable since the mobile needs to take energy into the formula. The thing I leant is, that if you want to design for mobile, you have to be realistic about the app size, as well as memory usage.

The good developer need to balance the amount of loading screens and the visual details. You may consider the advancement of the mobile devices, but for now, the future is not all there yet. And the common consumers/users need to be considered and take care of, thus, think again about memory usage and do a lot of prototyping before you start, you’d better know the limit earlier before it’s too late many time wasted.