Search Unity

Why is my simple game too demanding?

Discussion in '2D' started by BeestGames, Oct 15, 2019.

  1. BeestGames

    BeestGames

    Joined:
    Oct 6, 2019
    Posts:
    14
    Hi all,

    I made a very simple game recently. It's a 2d space shooter. Only has one level, one type of enemy, one movement (right and left), seven scripts of roughly A4 size, and that's it. Yet it is too demanding for a Galaxy note5 which is capable of running Modern Combat 5 and Asphalt 8. The game runs just fine on my Huawei Mate 20X, but I still find it strange that it is too demanding for a Galaxy note5. Also, all the images and animations (the game only has 3) in the game are simple light PNGs.

    Any ideas?
     
  2. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    I don't get it. Where did you try to publish your game to?
     
    BeestGames likes this.
  3. BeestGames

    BeestGames

    Joined:
    Oct 6, 2019
    Posts:
    14
    I just tried it on my own phones.
     
  4. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    What does your Unity settings look like? Perhaps you need to adjust your Level Requirement in Project Settings? If you have it set to a higher level than your device can handle, then I could see this being referred to as "too demanding". I don't know for certain though.
     
    BeestGames likes this.
  5. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,465
    Check out the profiler and see what the causes could be. It could be that you are instantiating and destroying objects instead of using a object pool or that you are raycasting too much, etc. The profiler should point you in the right direction of what is so demanding.

     
    Deniz-B, BeestGames and MisterSkitz like this.
  6. BeestGames

    BeestGames

    Joined:
    Oct 6, 2019
    Posts:
    14
    Will check that ASAP.

    I am instantiating and destroying objects. But the game is laggy before I start shooting (which will lead to instantiate and destroy). Nevertheless, I'll check that as soon as I finish work.
     
  7. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    Are you using a lot of Noise particle effects? This is known to cause performance issues.
     
    vakabaka and BeestGames like this.
  8. BeestGames

    BeestGames

    Joined:
    Oct 6, 2019
    Posts:
    14
    Not a lot really. But I am rapidly instantiating and destroying bullets (maybe 200 to 250 per minute).
     
  9. BeestGames

    BeestGames

    Joined:
    Oct 6, 2019
    Posts:
    14
    Could you please tell me what in project setting you think is important? (maybe I can take screenshots for you to see).
     
  10. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Typically it will be your choice of shaders or post effects that kill phones.
     
    BeestGames likes this.
  11. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    Well the first thing to know is this:
    upload_2019-10-16_21-30-50.png

    Then you may wanna consider this:
    upload_2019-10-16_21-32-23.png



    However, here is what I was referring to when I told you to check your levels earlier:

    upload_2019-10-16_21-35-36.png
     
    BeestGames likes this.
  12. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    Do your bullets have particles attached that use the Noise? If so, you can severely affect your performance if too much noise is implemented. A little noise for a few bullets is okay, from what I understand, but 200 every minute would produce a disturbance. I wish that I knew more about it.
     
    BeestGames likes this.
  13. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,778
    OP, please show us detailed profiler, at moments when game suppose to lag.
    Expand tree, where CPU is most intensive. Show physics, memory and GPU graphs.

    Best probably if record it as video, rather screenshots.
     
    Last edited: Oct 18, 2019
    cdr9042 and BeestGames like this.
  14. BeestGames

    BeestGames

    Joined:
    Oct 6, 2019
    Posts:
    14
    I have no shaders. Not any that I'm aware of.

    No they don't have any noise particles.

    I have attached a screenshot (I wasn't able to find the minimum API level).

    Since I don't have access to my phone now, I recorded the profiler for the PC version (link below). Can that show anything? if not, I'll upload the phone profiler tonight.

    https://gofile.io/?c=bCoA4Z
     

    Attached Files:

  15. BeestGames

    BeestGames

    Joined:
    Oct 6, 2019
    Posts:
    14
    I just realised what the problem is and I apologise for not being more careful with this and taking your time. The background of my game is stars flickering. The background was added by my friend, and I was under the impression that it is a gif file. However, I just realised that it is not in fact a gif file and every star in the background is a particle with it's own shader. I replaced the background and it is working as it should now.

    Thank you again for your time and your help.
     
    vakabaka and Cornysam like this.
  16. MisterSkitz

    MisterSkitz

    Joined:
    Sep 2, 2015
    Posts:
    833
    Which makes me wonder if it actually was a noise particle effect issue?
     
    BeestGames likes this.
  17. BeestGames

    BeestGames

    Joined:
    Oct 6, 2019
    Posts:
    14
    Yes, I think it was.
     
    MisterSkitz likes this.
  18. Deniz-B

    Deniz-B

    Joined:
    Feb 24, 2018
    Posts:
    8
    Did you try out:
    Edit -> Project Settings -> Quality
    And just try out "Fastest".
    I wonder if it helps :)
     
    BeestGames likes this.
  19. BeestGames

    BeestGames

    Joined:
    Oct 6, 2019
    Posts:
    14
    Thank you. I will remember this for future projects.
     
    Deniz-B likes this.