But checking the Profiler, I can see a lot of workloads has been released. But at this point, I can not say how much did this impact the heat of the phone, it is already cool. Using Unity built-in Sprite Packer, the Draw Calls reduce from 4x down to 1x at max. Unity can draw multiple sprites from a sheet in a single Draw call (as long as they do not much differ in Z, lights.). I think this is unnecessary, so I implemented a little check and change the resolution to at max 640px width. But the phone is still hot, not as I expected.ĭig deeper, I found out that my game run on FullHD resolution even if it was designed for 640X1136. Luckily, the game keeps its level of quality. And set the Quality to low, no AA, no HDR, no shadow. Tried to dig into all light/reflect settings and turn them off. But the animations look terrible.Įvery Material is set to Mobile/VertexLit or Mobile/Particles. Halved the framerate reduce a lot of workload on rendering. Should do it and do it right when the project started.Ĭhange Application.TargetFrame back and forth between 30 and 60 makes a significant change in heat. But I think optimizing effect is crucial.
Surprisingly, after a lot of actions, not much heat reduced. I hope it will be more on the minimizing side. But I still managed to keep the feel of the game quite similar to the original so I can conclude that: My eye candies are unnecessary OR My skill in minimizing things is so good. Try to test every Particles System, reduce sub Particles as much as possible, combine with animation to achieve the same effect/feel, kill all transparency in color & Color over time. So with a lot of pain in my heart, I remove most of my beloved Particles. But that means a lot of overdrawn on the screen. Some candies are added to the game when I hyped about the power of Unity. So I tried to remove as much as iI can in hope of reducing render workload. And in the LateUpdate(), based on NeedToCallSave, call Save() and reset that flag.Īnother problem, my game has too much eye candies. If an object needs to save something, it will call PlayerPrefs.Set*() as normal then SendMessage to GameController to flag a Bool NeedToCallSave. So I grouped all Save() into one call only in the LateUpdate() of my GameController, the LateUpdate will make sure that the Save() will be called after all other PlayerPrefs updates. The game needs to save a DateTime variable, with which I have to cast it to binary then string to save. That cost a lot as I checked on the Profiler. At the early stage, every time game saved anything, I called PlayerPrefs.Save(). Then I try to reduce the time of Save() being called. The data will be saved only when level up, buy or unlock. In order to reduce the number of Save() to call, firstly, I make sure that there is no constantly updated data need to save. My Idle Clicking game requires Save() constantly. The first time I noticed the heating was the time I did not group the PlayerPrefs.Save() Hope those will help someone and someone will help me on his problem. Below are what I've done and how they affect mobile heat problem. I tried their suggestion, some worked, some didn't. I did search for similar problems and found out that I'm not the only victim, developers have a hard time coping with mobile heating. But now, I meet the boss - Device Heating. Easily, I beat the Animator, Data Handling, OOP, and Game Control in Unity. My jump into Unity takes not so much effort.
Unity came to me naturally, I love it and it loves me, maybe. Then I decided to learn Unity as my new main tool. In the past, I made this game on Cocos2D, and it was good, no heat, peak fps. My in-dev game is mainly in 2D, a lot of UI, much of 3D particles, and a dozen of sparkles. And that problem concerns me, days and nights. More heat = more battery consumption = Your game is not optimized to be as good as that other game which is cool on hand. Even though the FPS is steady above 60fps and game scripts are optimized to an acceptable level that never requires more than 5ms to finish, the phones heat up quite fast.
#How to make a clash royale game in unity android#
My in-development game causes low-end Android devices heat ( I do not own a high-end one so I have no idea about the heat on that class ). I've been testing with Unity optimization for mobile lately.