Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Help sort out slow down on android

Author
Message
sskethan
15
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Oshawa, ON. Canada
Posted: 16th Feb 2013 16:01
Hello,
Would it be possible for someone to look over my project if they have the time and give me some suggestions or tips maybe see where I am going wrong. When I play the game on the PC it all works great. But when played on the Android phone it runs very slow. I can send what I have to your email or whatever is best for you or would it be best to post it here. Any help would be much appreciated.
TrezSoft
AGK Tool Maker
11
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 16th Feb 2013 16:26
Have you made sure that the phone is not in battery save mode ?
sskethan
15
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Oshawa, ON. Canada
Posted: 16th Feb 2013 16:34
Just checked phone is not in battery save mode.
TrezSoft
AGK Tool Maker
11
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 16th Feb 2013 16:36
I can take a look for you later tonight if that helps.
sskethan
15
Years of Service
User Offline
Joined: 20th Sep 2008
Location: Oshawa, ON. Canada
Posted: 16th Feb 2013 16:38
Anytime would be great .. I just need a push in the right direction. Thank you very much.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 17th Feb 2013 15:27
A couple of suggestions for speed increases.

Try to keep sprites on screen to a reasonable amount (especially if they are all being checked for collision). If possible, set as many sprites as you are able, not to use transparency, as that will speed things up.

Reduce image sizes to an acceptable size for your android. Perhaps you are using a lot of large textures, the PC will have no trouble with them, but your android may struggle if they are quite large. Remember the screen isn't that big so you can get away with reducing the graphics down if this is the case.

I have heard that if you change the backdrop clear colour you must set the border to match or that will slow things down. However I have not noticed much difference here. Enableclearcolor can speed things up if you turn it off, but it can lead to odd (and sometimes cool) drawing effects, when there is nothing behind the sprite.

Using basic collision shapes such as a box or circle should speed things up a tad also if possible. I haven't noticed a massive difference here either though.

Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 21st Feb 2013 19:37 Edited at: 21st Feb 2013 19:40
^^ What DVader Said, plus;

(general tips - which you may already use)

look at things that don't need to be done every loop and limit to essentials such as timing and touch input - which can be annoying when it skips.

Get the system to look after things like sprite animation as it can do it much faster than your code can and so is less of a hit on performance.

Tailor your graphics to a lower Spec - lower res. devices generally have less power to downscale high res graphics, whereas high res devices generally have more power so upscaling will be less of a hit.

Lower graphic detail can be overcome by creating the graphics in much higher res. and getting an art package to scale it down with anti-aliasing, filtering and such - this creates the illusions that graphics are higher res than they are.

Limit how much you actually change regularly - only move stuff if it needs moving - look at using "dirty" flags to identify when things need to change rather than assuming they do unless checked otherwise.

Don't try to get maximum frame rates - high frame rates do not make a fast game, they do mean the game has less time to update between sync calls.

Plot the frame rate on a graph rather than just a value on screen - this will show performance over time and can identify where the slowdown is happening.



And finally - ALWAYS use timer based movement - then when slowdown does occur, the movement will compensate and minimise the impact on the user.

Attachments

Login to view attachments
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 21st Feb 2013 20:35
Quote: "Plot the frame rate on a graph rather than just a value on screen"

What an awesome idea! Not only does it look kinda cool, but it's functional too!! Gonna have to implement this into my own game engine!

I live for video games! (And beers, and football, and cars!)
See what I live for here: [url]http:\\www.TeamDefiant.co.uk[/url]
Talairina
18
Years of Service
User Offline
Joined: 9th Jan 2006
Location: United Kingdom
Posted: 21st Feb 2013 20:45
Wow Marl that's a fantastic little display there. Is there a chance you could share the plotting function or provide some tip's on how you went about creating it?
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 21st Feb 2013 21:16
All good suggestions above. The biggest difference I found on android was to only make sprites that don't need transparency none transparent (they are transparent by default) - setSpriteTransparency(spriteID,0)

That made the biggest difference for me


this.mess = abs(sin(times#))
Marl
12
Years of Service
User Offline
Joined: 19th Nov 2011
Location: Bradford, UK
Posted: 21st Feb 2013 23:47 Edited at: 22nd Feb 2013 00:12
Sure, here you go;

EDIT: Moved to Own Thread so as not to derail this one.

http://forum.thegamecreators.com/?m=forum_view&t=203787&b=41

Login to post a reply

Server time is: 2024-05-02 20:37:54
Your offset time is: 2024-05-02 20:37:54