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 / app running very slow on ipad 1 and iphone 4

Author
Message
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 3rd Feb 2013 06:42 Edited at: 3rd Feb 2013 07:13
I have noticed something strange, my app runs at about 30 fps on my iphone 4 and my ipad 1. Normally I would say my app is just slow...but my iphone 3gs which is much slower than an iphone 4 and the 3gs runs the game at 60 fps

so far my tests for my app on my ios devices is
iphone 3gs = 60 fps ios 6.0.1
iphone 4 = 30-40 fps ios ver 6.0.1
ipad 1 = 30-40 fps ios ver 5.1
ipad 2 = 60 fps
iphone 5 = 60 fps

Any ideas? the only similarity i found was the a4 processor in both the iphone 4 and ipad 1. If any one has any tips to make it run faster or anything at all, I would be very appreciative. I am using agk v1088. I noticed the big fps slice in the ipad when updating from 1076 to 108.

I will keep searching if something is messed up in xcode or the device......
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 3rd Feb 2013 17:04
Is this using the apple player or a compiled app? The player is slow, because it has to stream the game from the PC. If not and it is compiled, then it sounds like a nasty new issue.

TrezSoft
AGK Tool Maker
12
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 3rd Feb 2013 18:25
From past experience with HTML 5 Games on mobile devices. In most cases the 3gs will run games faster that the 4 (the 4 is underpowered for the amount of image data) the 4s fixed that issue in the main. The iPhone 5 should be a little faster than the 4s.
iPad 2 + in most cases will run games at approx the same speed (which is normally a little faster than the 4s / 5)
iPad 1 will run about the same speed as the iPhone3 which I have found to always be 20 ish fps lower than the iPad 2.
On some games I have had to reduce the number of particles / effects and image data on the iphone 4 and ipad 1 to get acceptable performance.
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 3rd Feb 2013 21:42
This is with a compiled stand alone app. I noticed the drastic drop in performance when updating agk. As my game ran at 1076 at 60 fps.
I have removed particles and reduced images in the past to try and squeeze more performance but I really need all the images in the game. (they make up the level) I will guess I will just have to make do without them. Thanks for the responses
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 4th Feb 2013 00:41
Quote: "I will guess I will just have to make do without them."

I wouldn't give up just yet. 108 is still in beta. Also, if you're not using 3D, I think you can customize the sync() command to improve performance. I haven't moved onto 108 so I can't tell you what the magic sequence is (or if Paul has tweaked it in the latest beta) but someone might stop by and post it.

Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 4th Feb 2013 01:13
Hey hodgey thanks for the response,
I am currently already customizing the sync command. By using update 2d render2dback, render2dfront swap.
Without customizing sync , load times in 108 can be kind of long. I'm currently experimenting with various timer based loops and removing effects to see if it changes anything.
xCept
21
Years of Service
User Offline
Joined: 15th Dec 2002
Location:
Posted: 4th Feb 2013 02:40
Do you notice any speed increase if, at the top of your app, you enter: SetSyncRate(0, 1) -- Also try SetSyncRate(0, 0)

Just curious.
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 4th Feb 2013 07:29 Edited at: 4th Feb 2013 07:32
Hey xcept,
If I remember correctly I did change around the syncrate and it made no difference :/

So I found the main problem at least in my app. Since my app is designed for the retina display on iphone the images are large. My main menu has no transparency on any of the background images.
So I turned off transparency for all my background images and the frames went from 20-30 to a nice 60 fps !

Unfortunately this approach cant be taken in the actual game because I need transparency on trees, items etc.
So my plan is to use the command getdevicename and detect an iphone 4 and an ipad 1.
Then reduce the amount of sprites, and effects and it has brought the game back to a playable frame rate on these two devices.

Since most users i figure will have the more newer devices it really shouldnt affect the app too much!

Also the iphone 4 has less cpu power than the ipad 1 and the iphone 3gs...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 4th Feb 2013 10:49
Another approach is to have a smaller set of images which loads for certain devices. In Squashies World we had two sets of images and it didn't massively affect the download size. I was doing a fps check which switched modes (from unoptimised to optimised) if the fps was too low for a significant period of time.

Getting games to work nicely on retina display and lower end devices is always going to be a juggling operation I'm afraid. There is no simple "one size fits all" solution.


this.mess = abs(sin(times#))
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 4th Feb 2013 18:43
I'm surprised that there is such a difference between 1076 and 1088, even though 1088 is a beta. I had heard it was faster than 1076 at loading images in particular. I was hoping load speeds would improve with 1088 not get worse..

You could use different images as baxslash suggests, loading the lower quality ones on slower devices. You could also code the game to run at 30fps, which is frankly good enough for a lot of apps (although 60fps is better obviously). You would just have to make sure you move everything twice as fast to keep up speed. Using 30fps may seem a bad move, but it can still look pretty smooth and allows you to add more stuff in, as by reducing the frame rate your program is actually doing a lot less work.

AgentSam
12
Years of Service
User Offline
Joined: 14th Mar 2012
Location: Virtual Space
Posted: 5th Feb 2013 00:09
Cor,

You might also want to check out this post and try the suggested performance tip:
Remembered basic principles and gained 20fps!

Cheers,
AgentSam
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 5th Feb 2013 00:46 Edited at: 5th Feb 2013 03:26
Thanks guys for the responses its all very appreciated.

@agentsam

Thanks ill give that a try and see the results

UPDATE:
I tried disabling the backbuffer by the command enablecleardepth(0). This does get the frames back to 60 on my iphone 4, except some of my backgrounds were replaced with black areas, and the inneractive ad I am using is just a black rectangle.

The fix I used for now was to detect the iphone 4 and ipad 1 with getdevicename. then disable effects and some extra eye candy, which brought the game back up to being playable.

It will be a nice day when our phones are running 8 core processors with a nice nvidia graphics card
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 10th Feb 2013 02:13
Still, if you are using 108 and not using 3d, be sure to filter out the 3d stuff in the sync loop, as this will surely help you out.

Not sure if the latest version auto detects this (it was supposed to I think) and not do 3d work if not needed, but always a good idea to code for it I think.

Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 10th Feb 2013 04:59
Hello,
Thanks for responding, I actually have already been filtering out the 3d stuff as i dont use it. How I solved this particular problem was I detected the iphone 4 and set the framerate to 30 and on all the other devices I set it to 60.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 10th Feb 2013 10:29
Quote: "By using update 2d render2dback, render2dfront swap."

This should be !

update(0)
render2dfront()
swap()

render2dback is used to render sprites behinde 3d.

Try to delete the shapes on sprites that dont nead them and disable clear color.

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Cor
AGK Developer
13
Years of Service
User Offline
Joined: 19th Dec 2010
Location: Its a trap!
Posted: 10th Feb 2013 16:01
Hey cliff,
I was syncing using the way you described but when I ran the benchmark commands the amount of sprites being drawn was going up by 1000 every second I got to like 70,000 sprites .... I didn't know if it was some kind of leak but when I added the render 2 d back it went back to 20

Login to post a reply

Server time is: 2024-11-24 07:28:30
Your offset time is: 2024-11-24 07:28:30