Unity Shared Tips on Mobile Game Optimization

Unity released a free full-length e-book and started a series of blog posts with essential tips on mobile game development from the company's engineers.

The first and probably the best tip is to use Unity Profiler early on and use it often to test the performance of your game. It gives you all the information about how your application works but it is of no use if you do not run it every once in a while since the first steps of the development process. Glitches, crashes, and other nasty bugs are easier to fix at the beginning than a day before shipping.

You can use Profiler's tools to locate the precise source of a lag on iOS and Android devices. Unity's engineers recommend exploring expensive operations like AI and physics first when looking for the areas to fix in your game.

Another tip is to manage your memory wisely. Unity manages it automatically, sending smaller pieces of data to the stack and allocating larger pieces of data and longer-term storage to the managed heap. The garbage collector goes through unused heap memory from time to time to deallocate it and as it does its job, the game might run slower. So if you don't want any deallocation-induced hiccups in the game, you need to be conscious of when you allocate and deallocate heap memory.

One more important thing Unity engineers recommend is making friends with PlayerLoop. It helps you get to the core of the game engine. It includes systems that handle initialization and per-frame updates, and at the end of the day, PlayerLoop is what makes the whole gaming experience come together. To create a script that works, you need to understand PlayerLoop's functions and know, for instance, the difference between Awake, Start, Update, and other functions. Avoid heavy scripts, unnecessary repetitions, and empty events — make everything nice, concise, and precise with the help of PlayerLoop instead to make sure you don't have insanely long loading times, weird events occurring during gameplay, and other unpleasant little imperfections.

Read the full blog post here. Don't forget to join our new Telegram channel, our Discord, follow us on Instagram and Twitter, where we are sharing breakdowns, the latest news, awesome artworks, and more.

Join discussion

Comments 0

    You might also like

    We need your consent

    We use cookies on this website to make your browsing experience better. By using the site you agree to our use of cookies.Learn more