Search Unity

My game runs incredibly bad on Lumia 820, but perfectly on Samsung S2.

Discussion in 'Windows' started by Tibelius, Apr 2, 2014.

  1. Tibelius

    Tibelius

    Joined:
    Aug 21, 2013
    Posts:
    3
    So I have this game that i originally made for my android device, but then realized I could easily port and debug it with the office wp8 device. When I built the wp8 version and deployed it to the device I experienced immense lag. On android the game runs smoothly always over 30fps if needed, but on this wp8 phone the fps drops down to 10.

    And while writing this I am aware of the fact that I'm not too experienced with Unity. Still I would imagine the game having at least close to the same performance on both platforms. Unless I'm missing some ultimate optimization tricks and tips, I am utterly unable to deploy the game on wp8.

    I'm even willing to send the project file for others to see and test. I don't have Unity Pro, because I can't afford buying the Pro pack at this point, so Profiler is unavailable for me. And I have a feeling that the Profiler would help a bit in this quest of optimization. Then again the problem may lay in the actual device. But as it runs on the android I'd expect something similar on wp8.

    Ask me questions, ask to send the project, ask anything.
    I'm quite desperate at the moment.

    Thank you
    Timo
     
  2. BFS-Kyle

    BFS-Kyle

    Joined:
    Jun 12, 2013
    Posts:
    883
    Are you building in debug mode in Visual Studio? Try building it in Master and see if the performance is any better.

    Also try an empty project and just show the FPS to see what you get from that.

    -Kyle
     
  3. Tibelius

    Tibelius

    Joined:
    Aug 21, 2013
    Posts:
    3
    I had it on master mode. But now I think I actually found out the problem.

    It seems that wp8 is horrible at clipping logic and drawing. I don't know how to explain this the right way but if for example with android devices I have a gameobject outside the view of the main camera it doesn't really take up resources more than the script requires. Therefore I haven't even thought about the possibility that I'd need to destroy all objects outside the camera and create them again when they appear. Note that the objects in question are stationary background sprite animations.

    After I wrote a script that did that I found increased performance on the wp8 device, though android performance stayed pretty much the same. I guess all of this might be common knowledge and practices, but as a newbie I tend to have a hard time with platform differences of any sort :D I'll update later if I really solved the problem or am I just imagining it.

    An empty project gives decent frame rate btw.
     
  4. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Unity does frustum culling by default, meaning objects not in the camera view don't get rendered.
    Destroy and Instantiate is expensive, you would never want to do that in place of Unity's frustum culling. This sounds more like a Unity issue than anything else, you might want to submit a bug report with a small repo.
     
  5. ajketan

    ajketan

    Joined:
    Nov 27, 2013
    Posts:
    20
    @Meltdown @Tibelius ....

    Similar issue .... where I am getting good FPS on iphone 4s and also galaxy tab 2 but Nokia Lumia 820 gives me something around 22 FPS.
    I followed what @Kyle suggested and tried to deploy a release master build .... The difference was good .... my FPS reached upto 38-40.
    Lumia 820 is a great device. We are targeting a low end device like Lumia 520 and I am not able to reach even 20FPS in the release build.

    Concern is regarding the difference between the performances of ios android and windows development build.

    Please Help.
     
  6. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Try changing all audio from in memory to stream from disc.

    There are some memory optimisations for Windows Phone coming out in 4.5.
     
  7. SIJO_Studios

    SIJO_Studios

    Joined:
    Apr 1, 2014
    Posts:
    4
    I am busy porting my game to WP, it works perfectly on Android and iOS, and absolutly chugs on the WP. I to have found that it has to do with offscreen characters that have animation and move around. As soon as I disable them the FPS went back to normal. The only problem iam having now is that the way I coded my characters once they have been set to an active state of false and back to true, they no longer evaluate correctly due to how I was setting up my level using co-routines to make sure objects appeared at the correct location.

    If unity could fix this bug it would make my game playable on WP with no crazy work around :)
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    Could we get a bug report? I haven't seen this issue before.
     
  9. SIJO_Studios

    SIJO_Studios

    Joined:
    Apr 1, 2014
    Posts:
    4
    Will do, how does one submit a bug report, as I have never had to.
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
    Thanks. To report a bug, press Help -> Report a Bug in Unity Editor.
     
  11. SIJO_Studios

    SIJO_Studios

    Joined:
    Apr 1, 2014
    Posts:
    4
    Great, Ill report the bug. I will just try streamline the project as its about 800megs. So I can give you a basic scene that reproduces the error
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,678
  13. n8

    n8

    Joined:
    Mar 4, 2010
    Posts:
    147
    I wanted to chime in on this thread as well. I have just successfully built my game on wp8 for the first time which is cool. However my game is consistently running at barely 10fps while iOS build runs at around 50-60fps. I am using a Nokia Lumina 1020. I hope there is a fix soon, or at least some insight as to why there is the bad performance
     
  14. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    If you're running it in Debug Mode, don't that kills performance. Use Master to get a good idea of performance.
     
  15. n8

    n8

    Joined:
    Mar 4, 2010
    Posts:
    147
    Ok testing now, will post back with results. However I wanted to ask this here so that other devs will be able to know as well. If you just click "build and run" (without "dev mode" enabled) from the unity build window and it compiles and runs straight to your device without going through VS, is it running in debug mode?
     
  16. n8

    n8

    Joined:
    Mar 4, 2010
    Posts:
    147
    Circling back here to follow up with what I learned. Seems that if you just hit "Build and Run" from within Unity, then yes you get a debug build. Once I got the project to open in VS (had an "incompatible project" error) and switched to master, I was able to get a few extra frames per second. At the moment it is up from around 10fps to around 15fps. This absolutely moving in the right direction, just not far enough. I am hoping that this is just a bug in Unity and that it will be resolved quickly. If anybody else has any ideas, I am all ears!
     
  17. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Something is killing performance on your game then. We released Star Wars Assault Team on WP8 with Unity 4.3.4 with good performance and ported several other top-selling titles with good performance.

    Have you done any profiling? You may be hitting the upper memory limit of your device and this might be causing performance issues.
     
  18. n8

    n8

    Joined:
    Mar 4, 2010
    Posts:
    147
    You are absolutely correct. I went back to my scene and duped it, then stripped almost everything out down to just the player object and a few supporting scripts. In this example, on iOS I get a very consistent 60fps (I have set the frame limit to 60), on the exact same build for wp8 I am now getting 40-50fps. So this points to something in one of my scripts killing perf, but it also shows that indeed the lumia 1020 is either not as powerful as iPhone 5 or there is a bug in the Unity compilation to wp8. Either way I now have path to start trying to narrow down the problem on my side.

    I only have the free version of Unity so profiler is off limits. I have been using Benchy to sort of fill in the gap, but it just doesn't have the in depth view that the native profiler has. That being said, it has shown me a few problem points that I have fixed. Also the Lumia 1020 has 2gb of ram so I would be hard pressed to believe that I am anywhere even close to the 1gb mark.

    Thanks for the help though, I will report back here when I have more to share.