Phone Battery and Temperature

Spincu
edited June 2014 in Any Topic & Chat
Hello,

I've made a game in Unity using Photon Pun and the game is working great. One major flaw though. It goes through the battery life like butter, 20-25 minute from 90% to 10 %. And the phone also heats very badly. I reached 47 * C. What is wrong with it ? I don't believe my coding is that bad though in order to have made some huge stupidity to make it eat so much resources ( and if I did, what could it be exactly ? ). I have like maybe 50 photons in the game at anytime, and only two are used serialized constant for the movement and animations ( one per player , the game is 1v1 ), but the rest are only triggered at certain events.

Can somebody help me with some informations on this ?

Thank you.

Comments

  • The best you can do is check the logs and turn on Unity performance profiler. Check what happens, what takes most CPU and GPU time, where you allocate and move memory around and then try to optimize things.

    We are not aware of any issue in Photon that causes this much work for the Phone to drain the batteries.
    Our customers have games on all platforms supported by Unity and this is the first report of something like that. Chances are, you find the reason somewhere in the game logic.

    Best of luck for the hunt!
  • In the Profiler is Photon only represented by PhotonHandler.Update() ? or are there other things related to Photon to be checked ?
  • No, we didn't add many profiler sections, because we weren't sure if it's useful to many. A lot seem to be using Unity Free.
    Do you see that the PhotonHandler is causing most of the work? If so, please go ahead and add Profiler sections where needed.
    Keep in mind that the PhotonHandler.Update should include calling your OnPhotonViewSerialize calls to write the outgoing data and to apply the incoming updates.
  • Hi guys,
    Sorry to bump a rather old thread but it's interesting that I've started to see battery issues with PUN. Making a really simple card game, and the android phone I'm testing on rapidly heats up once the game starts. There's very little in the Unity project other than a few RPC calls so I'm a little confused as to why it would drain so much juice. When I ran some checks it looks like the phone's radio process is being hammered.