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 / Does AGK give up iPhone4? There are only 45 rate in iPhone4.

Author
Message
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 5th Dec 2013 03:53 Edited at: 5th Dec 2013 03:58
I run the 108.19 template and load two images in 960*640 size, then the sync rate fell down to 45. and I tried 3 images, then the rate was 30. Does this mean AppGameKit give up iPhone 4?

I made the test for iPod 5 and iPhone 5. they are good ,and the rate didn't fall down.

There are many new functions in the 108.19 version. I am hesitated now, not sure to use the new one or version 107.6.

The Miracrea Games
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Dec 2013 12:04
Showing the test code might help.

It's not impossible there are some things that slow up on the iPhone 4. Or that the 5 versions just handle better.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 5th Dec 2013 12:29 Edited at: 5th Dec 2013 12:30
int iImageID = agk::LoadImage("Menu_Background.png");

for (int i=0; i<30; i++) {
int iS = agk::CreateSprite(iImageID);
agk::SetSpriteY(iS, 0+i*10);
}

The Miracrea Games
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Dec 2013 13:30
This might be a dumb question, are you executing that code in app::Begin() or app::Loop()?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 5th Dec 2013 14:34
app::Begin() of course.

The Miracrea Games
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Dec 2013 14:53
That's what I figured. But I have learned never to assume anything when considering how someone else codes.

Okay, no idea then.

Just for giggles, what happens if you try this (I am only wondering if the local variables defined within the for loop are an issue):


Your original post talked about loading multiple images and your snippet only does one. The above can easily be adjusted to accommodate more images (store the ids in an array for later cleanup, I never assume that stuff will be cleared up properly).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 5th Dec 2013 14:58
@Ancient Lady: That is not important for the rate. the rate is still very low.

The Miracrea Games
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Dec 2013 15:10
I was wondering if there might have been something in the way the compiled code executed on the iPhone 4.

I know different devices do things at different rates, given the same code. This caused me minor fits for a while because my WIP is time based.

Maybe your iPhone 4 doesn't like the actual format of the images being loaded. I'm just guessing.

Is there a difference in the iOS versions between the devices you are testing on? It's not impossible that it is the implementation in the iOS that is causing an issue.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
east
11
Years of Service
User Offline
Joined: 4th Apr 2013
Location:
Posted: 6th Dec 2013 02:21 Edited at: 6th Dec 2013 02:23
Perhaps it's a fill rate issue? You create 2 or 3 960x640 sprites so I assume those sprites are overlapped. Some older devices actually has some trouble with fill rate when the actual pixel being drawn exceed around 1.5 display's pixels. I have this trouble when i have too many overlapping layers on my game.

If you have a background that fill the screen, you can try to disable clear color with agk::EnableClearColor(0) and turning the sprite transparency off with agk::SetSpriteTransparency

You might want to read the development tips: http://www.appgamekit.com/documentation/tips.html#opaquesprites
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 6th Dec 2013 09:08 Edited at: 6th Dec 2013 11:08
@east, You are right, I tried your advice. Then the rate is about 60. I almost gave up the newest AppGameKit SDK. agk::SetSpriteTransparency(iS, 0); This function is very important, with it I can create 30 large sprite and keep 60 sync rate. Thank you very much!

The Miracrea Games
east
11
Years of Service
User Offline
Joined: 4th Apr 2013
Location:
Posted: 7th Dec 2013 03:36
Glad to be of help Perhaps you already read this on the development tips but if you have many overlapping opaque sprites, you should be able to improve performance further using SetSortDepth.
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 7th Dec 2013 11:41
I made a test on iPhone4 with 107.6 template. it can load 5 transparent fullscreen images, but 108.19 template can only load one in iPhone4, this can't meet my requirement, because sometimes I will use 2 fullscreen transparent images. So I have to give up the newest 108.19 template and use 107.6 template.

The Miracrea Games
east
11
Years of Service
User Offline
Joined: 4th Apr 2013
Location:
Posted: 8th Dec 2013 06:36 Edited at: 8th Dec 2013 06:39
So I look it up on google for a bit and I found out when the first time iPhone 4 came out, many game developer had performance issues related to the retina display and display fill rate.

The thing about iPhone 4 with retina display is it must draw pixels 4 more times than non-retina display iPhone 3GS.

If I were you, I'll try using SetResolutionMode command (not sure if it will work though): http://www.appgamekit.com/documentation/Reference/Core/SetResolutionMode.htm

Quote: "
Some platforms have high resolution screens such as the iPad, this function determines how those platforms display their content. You have the choice of mode=1 which will use a full resolution frame buffer that will look better, or mode=0 that will use a smaller resolution frame buffer (usually half sized) which is then scaled to fit the screen, and will run faster. This does not affect low resolution devices that will always use a low resolution frame buffer.
"


Regarding to performance differences when using AppGameKit 1076 and AppGameKit 10819, perhaps AppGameKit 1076 use a smaller resolution frame buffer by default while AppGameKit 10819 use the full resolution frame buffer on iPhone 4? I don't have an iPhone 4 so I can't try this. Perhaps other more experienced forum members can confirm this?
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 8th Dec 2013 09:02
@East , I made a test as your said, there was no much difference. The FPS is still very low.

The Miracrea Games
east
11
Years of Service
User Offline
Joined: 4th Apr 2013
Location:
Posted: 8th Dec 2013 09:56
Do you mind doing some other test? what number does the GetPixelsDrawn(), GetDeviceWidth() and GetDeviceHeight() returned on both template? And did you call the SetResolutionMode(0) command at the begining of app::Begin function? before SetVirtualresolution, etc?
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 8th Dec 2013 10:45
I tried putting SetResolutionMode before SetVirtualresolution, it doesn't work.

The Miracrea Games
east
11
Years of Service
User Offline
Joined: 4th Apr 2013
Location:
Posted: 8th Dec 2013 14:09
And what values does the commands GetPixelsDrawn(), GetDeviceWidth() and GetDeviceHeight() returned on both templates? If what i suspect is true the value for GetPixelsDrawn() on 1076 should be much smaller.
halley
13
Years of Service
User Offline
Joined: 27th Apr 2011
Location: China
Posted: 8th Dec 2013 15:38
I think 107.6 version is enough for my games, so I will give up the higher versions until the two following things happened.

1. iPhone 4 is not main part in the market.
2. AppGameKit team fix the problem. I think it is not likely to happen, since there are many 3D commands in higher versions.

The Miracrea Games

Login to post a reply

Server time is: 2024-11-24 23:25:56
Your offset time is: 2024-11-24 23:25:56