Search Unity

how do i diagnose a game crash

Discussion in 'Android' started by witcher101, Mar 26, 2017.

  1. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    my game is crashing randomly while testing on samsung glalxy s3.
    I have no idea why its hapenning. How do i found out the cause??
     
  2. Ogien

    Ogien

    Joined:
    Nov 21, 2012
    Posts:
    165
    I had the same exact issue.

    For me I had 1 large texture that decompressed on that device from 2MB to 8MB which caused the crash. It worked fine on my other test devices but not on the S3. I found it by profiling directly on the S3.

    Since then I did some more testing and my theory is that Unity is has some kind of performance issue on the S3 and a few other devices from that era. For example my game works better on the S2 then it does on the S3. (The S3 should be better as it has a better GPU and more memory)

    My advice is profile memory directly on the device using the built in Unity profiler. Look for large textures and other memory hogs.

    Second I would programmatically lower the quality of your game if you are running on a device with less then 2GB of Ram using:

    QualitySettings.SetQualityLevel(2, false);

    Hopefully that helps

    P.S.

    I am currently fighting the same battle with the iPad Mini Gen 1 which has 512MB of ram. It works perfectly fine on the iPad 2 which is older and has the same amount of Ram but runs out of memory on the Mini.
     
  3. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    Hi thanks for reply
    I tried profiling but game crashes as soon as it starts.
    I have a char with several clothes attached to it and fbx file is around 70mb in size.
    On editor profiler it says its using about 500mb of memory.
    Game has around 76.2k trianlges.
    Most of time it crashes at start some time it goes till 10 secs and crashes.
     
  4. Ogien

    Ogien

    Joined:
    Nov 21, 2012
    Posts:
    165
    I am guessing 70mb fbx file is the issue.

    Make a copy of your project and delete the fbx file, see what happens :)
     
  5. witcher101

    witcher101

    Joined:
    Sep 9, 2015
    Posts:
    516
    It does work without fbx file but i do need to get it working with it
    Is there any limit to amount of traingles that can be in scene in a mobile??
     
  6. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    I'd say use the modelling program the model was made in to reduce poly count, like blender has the "decimate" tool if I remember correctly, which does that automagically.
     
  7. Ogien

    Ogien

    Joined:
    Nov 21, 2012
    Posts:
    165
    There is definitely a limit. I try to keep my models under 3K in mobile but then it depends how many 3K models you add to your scene as well :)