Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Poor performance on Mobile Web

Discussion in 'Project Tiny' started by Tomiha_be, May 27, 2019.

  1. Tomiha_be

    Tomiha_be

    Joined:
    Jan 14, 2016
    Posts:
    8
    We are creating a little hyper-casual game with Project Tiny and the performance on mobile is pretty poor at the moment. I was wondering if there are some guidelines on increasing performance for the current version of Tiny.

    We use physics and the core purpose of the game is collecting items by throwing something in the air. See it as moving chambers (seperate entitygroups) that all have items (+-15) in them that you can collect. The next chamber scrolls in the moment you reach the top of the previous one. It's pretty laggy at some times, to a point the UI buttons don't respond very well.

    Would it help to cache the items somewhere outside the screen and place them at the correct positions inside the chamber at runtime?
    Are there other important pointers we have to take into account or look into?
     
  2. Rupture13

    Rupture13

    Joined:
    Apr 12, 2016
    Posts:
    131
    If you don't already, definitely make sure that the rooms that aren't currently on screen are destroyed or disabled.

    Depending on how you register hitDetection of the thing you throw and the collectibles, you might be able to optimise the code for that. To say something useful about that I'd first need to know how you're doing that right now.

    Aside from that, I found it useful to set the rendering mode of the project (in the project settings) to "Canvas" instead of "Auto" or "WebGL" (WebGL gives even worse performance on iOS devices).


    However, I can't say that my project (temporary link, might get deleted in the future; also, only look at the second screen, just click past the first mostly black screen as it currently isn't really working) is running 100% smooth as a baby butt on mobile devices, but it seems to run decent enough and sounds like it runs better than what you're describing.
     
    Jalol likes this.
  3. Pakor

    Pakor

    Joined:
    Feb 2, 2017
    Posts:
    32
    Also, in case you use a lot of console.log's to see how your program is doing, I've noticed that this can cause extreme lag pretty fast too. If this is the case, try closing the console and see if it runs smoother then.
     
  4. Maras

    Maras

    Joined:
    Dec 11, 2012
    Posts:
    131
    @Rupture13 This does not look too resource extensive. I thought a project like this will run smoothly even with hundreds of physical objects.

    On my phone, it has quite low framerate. Somewhere between 10-15 fps on Brave and just a bit better on Firefox.
     
  5. Rupture13

    Rupture13

    Joined:
    Apr 12, 2016
    Posts:
    131
    Mobile really doesn't seem to be optimised at the moment. I guess we should wait until the C# version of Tiny releases and hope the performance increases with that.