Laggy performance when testing on Mobile

chongyunxiang

  • *
  • Posts: 278
Hi,

I tried the Android (platform) Test Game and now able to test it on my mobile. But the game is very laggy.

It doesn't lag when I test it using my desktop and my game isn't heavy on graphics or code.
I also read Stenclpedia about Optimizing Performance and made sure my game is following the tips on optimizing performance.

What's wrong with it?

chongyunxiang

  • *
  • Posts: 278
Anyone? Is it because it's the ADB that's causing it to lag?

chongyunxiang

  • *
  • Posts: 278
I checked on the forums, but the solution links are all dead.

mdotedot

  • Posts: 1654
What mobile do you have?
How much memory does it have?
How much FREE memory does it have?
What driver do you use?
What version of Android are you using?

" my game isn't heavy on graphics or code "
Numbers please!
How many actors, how large are the actors, background information, sound ..
What is the combined file sizes of this folder: stencylworks/games/<YourGame>
What scaling options do  you have set? Remember that each graphic has 1.5x,2x,3x and 4x graphics !! Turn them off on mobile -> display Scale settings.
Box2D used? (Collisions)
What extensions do you use?
Do you use atlases? If you don't : USE THEM!

There is no 'solution' since it depends on the game. Export the game and check out its size or better post the .stencyl file for us to check out.




Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

chongyunxiang

  • *
  • Posts: 278
Hi,

I'm using a Redmi Note 4G
8GB of memory with currently 1+GB available.
2GB RAM and 1GB of available RAM.
Qualcomm Snapdragon 400MSM8929, Quad-core 1.6 GHz Processor
Android version is 4.4.4KTU84P Kit Kat

My game in total has 23 actors, 4 backgrounds, 3 Fonts, 2 Sounds (from Crash Course which I have in mp3 and ogg), 7 Scenes, 13 Actor behaviours, 2 Scene behaviours.
At most, there will be 4 actors, 1 background, 1 font in a scene.
I can't seem to locate my stencylworks/games/ folder, but my exported Stencyl file is 6.02mb.
I already turned off the 3x and 4x for the Mobile scale option.
Tried both the Simple Physics and Box2D (Default) option as well.
For extensions, when I downloaded Stencyl, there were 5 that came with it.

The largest graphic is my background which I export at 1920x1280, 41KB, then have it scale down 4x (480x320) when I import into Stencyl.

I used atlases, but maybe I'm using them wrongly. I clicked on the What are Atlases link to learn more about it. But there were options that my version of Stencyl don't have and I think it'll only be made available after I upgrade.

I clicked on the Atlases settings and saw that the memory usage at 4x is 6.6mb and under scenes, it is 16.7mb if I enable Atlas binding. After trying out Atlases, my main atlas is 6.6mb and the 2nd largest is 2.3mb. I still used the Load and Unload atlas block to test it out, even though it doesn't have the mobile icon beside it as shown on Stencyl.com.

I don't have any anti aliasing or pixel snapping enabled.

My Mobile settings are Portrait, Universal, 24fps, Scale to Fit (Fill), 1.5x and 2x.

But it's still as laggy.

I would like to post my stencyl file, but would Stencyl protect the intellectual property of their members? Just wanna know what happens when someone else uses the file without permission.

Thanks!

« Last Edit: July 27, 2015, 02:37:09 am by chongyunxiang »

chongyunxiang

  • *
  • Posts: 278
I still can't locate my Stencylworks folder to check the folder size. Anyway, I've attached my stencyl file here. Please help me check what's wrong with my code. I'm quite certain it's not the graphic size, but I could be wrong. And also pretty sure it's not the Atlases even though that will help, as I also exported games without atlases on Stencyl forge to my phone and it all runs perfectly well.

In this attached file, I removed all the atlases, as it starts to get a little messy, so I thought I'd revert back to the initial stage.

Thanks!

« Last Edit: July 27, 2015, 06:54:31 am by chongyunxiang »

letmethink

  • *
  • Posts: 2545
Never save game in an updated event. removing that fixed the lag for me.
~Letmethink

chongyunxiang

  • *
  • Posts: 278
I tried removing it. Improves the lag by a little bit, especially during gameplay. But the transition between scenes are still laggy on my mobile.

Still, thanks for helping!

letmethink

  • *
  • Posts: 2545
Only the fade transition is optomised for mobile.
~Letmethink

chongyunxiang

  • *
  • Posts: 278
Ah! That explains! I changed all my slide transition to the fade transitions and the lag is gone!

When will other transitions like spotlight and slide be optimised for mobile?

Thanks!

DTH

  • *
  • Posts: 148
Only the fade transition is optomised for mobile.

This is a very good information to have for future reference, thank you

When will other transitions like spotlight and slide be optimised for mobile?

If your in a creative mood its not that hard (from what I can see) to make a simple transition, use "current screen as image",  and create a black (or what ever color transition you need) back image and draw the screen image ontop of the color image offsetting the x or y value on each frame or in a timer loop for a slide, same for loading a scene but in the reverse order, not sure how it will perform but worth a shot, spotlight thought would take a little more work, in fact I will have a go at this myself, I got an old Galaxy Ace I use for testing as a low end device if it works on that it will work on anything lol






chongyunxiang

  • *
  • Posts: 278
@DTH, it's definitely worth giving this a shot to see how well it performs on mobile! I was just trying out the different transitions, but never knew it wasn't optimised.. And it kept me wondering what went wrong with my file! Let us know the results on your old Galaxy Ace!

DTH

  • *
  • Posts: 148
I had a go with a slide transition and it kind of worked but was a bit glitchy on windows so I scraped the idea as I doubt I can beat the performance of the default transitions without writing native code, but I got to play with the image functions for the first time so it was not a complete waist, when I start looking into extensions I'll revisit this idea

a good number of years ago I wrote a splash image transition library for lua based windows tool I was once hooked to, the files and site I once had are long dead but here is the forum post for anyone that wanted to check out my previous, in fact I think I'll rob back my avatar while I'm there lol