Game run faster on android

zarzirzarzir Member, PRO Posts: 30

Hi, my game runs a lot faster on android then on ios, anyone had this issue before?

Comments

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 2,420

    What do you mean by run faster. Does it run smoother or does the game's timing seem off?

  • zarzirzarzir Member, PRO Posts: 30

    timing is way off, I have a 30s timer that just count faster then the real time, I'm not using timers, I use constrains, but even where I use self time in a rule it runs faster then it should.

    On Ios it's all normal.


    I will try a test buld with a timer to see, will report back

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 2,420

    Can you also let us know what device you're using?

  • zarzirzarzir Member, PRO Posts: 30

    @adent42 sure, I'm using pixel 4.

    I did a test build now,

    one actor with timer (every 1s change attribute to attribute +1 and display attribute)

    and one actor with a constrain (constrain attribute to attribute + 12 and display attribute /720)


    both run faster then they should...

    Around 1.5 faster, for every 30 real world seconds they get to 45 on the display.

    So I guess something in the engine?

  • bob loblawbob loblaw Member Posts: 792

    as much as i enjoyed relearning concepts of programming logic using gs, one of its limitations i found was what seems to be an inconsistent frame rate/processing speed across several different devices.

    also, someone a while ago brought up the inconsistent clock speed using interpolate compared to timer. not sure if that’s still a thing now though.

  • zarzirzarzir Member, PRO Posts: 30

    Well 50% faster is really noticeable and not a tiny difference so it will affect all games.

    I'm not sure if that's what you meant but it's defiantly affect interpolate the same way, I'm not using animation but my guess that it will be the same problem.

  • zarzirzarzir Member, PRO Posts: 30

    @adent42 Hi, did you mange to check the issue?

    I'm using pixel 4 XL android version 12

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 2,420

    Not yet, gonna take a look this weekend after a few other task.

  • zarzirzarzir Member, PRO Posts: 30

    Ok thank you, please update as soon as you can, this is the only problem that keep me from publish.


    Thanks

  • nir3112nir3112 Member, PRO Posts: 286

    I checked it and I see the problem its fester then the timer behavior - I hope adent42 will fix it..

    but I have to ask you, why you are using constrain instead of timer? I know timer is more "heavy" but I don't think by that much..

  • zarzirzarzir Member, PRO Posts: 30
    edited January 10

    @nir3112 can you explain what did you checked? as for me timer is faster as well, 50% faster then the time in the real world.

    as for your question, constrain runs 60 times per second (once every one code cycles), timer runs 30 times per second (once every two code cycles).

  • nir3112nir3112 Member, PRO Posts: 286
    edited January 10


    I created an actor with timer behavior -- every 1 sec -- change attribute timer to timer+1

    and another attribute called TimerCon and I added to the same actor constrain attribute TimerCon to TimerCon+12

    then i displayed these two attributes like this -- game.timer.."/"..game.TimerCon/720


    the results I got is that the constrain timer runs faster then the regular timer behavior..something like 1.2 sec to 1 sec on the regular timer.


    About my question, so you say that if I have 10 timers it will effect the performance of my app more then if I use 10 timers with constrain?

    and if I use constrains instead of timers I will need attribute to change so I'll need a lot of timer and then the game will need to load more attributes no?

  • zarzirzarzir Member, PRO Posts: 30

    So for me both timers and constrains are 1.5X faster on pixel 4, what device did you test with?


    I'm not sure I understand your question, me choosing constrain over timers regarding your original question is mainly because constrain runs 60 times per second and timers when set to "every 0s" runs 30 times per second.


    I'm not sure what is better to use for best performance.

  • nir3112nir3112 Member, PRO Posts: 286

    mm ok.

    I checked it on galaxy s9+

  • zarzirzarzir Member, PRO Posts: 30

    I see, I hope @adent42 will give us an update on this issue, as on pixel 4 it's not something that can be ignored.

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 2,420
    edited January 11

    Finally had a chance to look at this some and I can't see an obvious reason in the code for this, so it will take a bit of work to figure out. I'll keep the thread updated.

  • zarzirzarzir Member, PRO Posts: 30

    Ok Thanks @adent42 , I'm not sure if it will help but sounds and music seems to run at a normal speed (music for sure).

  • zarzirzarzir Member, PRO Posts: 30

    Hi @adent42 So after someone showed me the smooth display option, I set it to 60hz and it runs normal.

    But isn't that something the device should do automatically going 60hz for the game, unless the game state otherwise?

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 2,420

    Thanks for that pointer. That will help narrow down where I look!

  • adent42adent42 Key Master, Head Chef, Executive Chef, Member, PRO Posts: 2,420

    I haven't looked into it yet (on something else), but thinking about it here's what should happen:

    • Interpolate will be evaluate 4 times as much (we evaluate each frame basically.
    • Speed should not change, but movement might seem smoother depending on how well you perceive framerate.

    Since things are moving faster, which should not happen, we'll need to look into it. Our engine is using a time delta to calculate each step, so there might be a small difference between high refresh phones and a 60hz phones (due to the extra loop work being done), but there shouldn't be a 4x difference, so there's definitely something we need to look at.

  • zarzirzarzir Member, PRO Posts: 30

    For me the difference was 1.5x when testing with the pixel 4 xl setting to 90hz, I did a test today putting device time and self time on display.

    What device got 4x difference? or I didn't understand you correctly ?


    Wonder if its also affects iPhone 13 or any other 120hz devices?

Sign In or Register to comment.