Hey, my limit right now is 30 and I don't know why it won't go to 60 fps. I am thinking it has something to do with having 4 1024x1024 sprites that I use to create a parallax effect? What other factors are there?
30 fps Limit?
(12 posts) (7 voices)-
Posted 1 year ago #
-
Did you set the animation interval in the app delegate to 30fps for the Director?
Posted 1 year ago # -
No, I set it at 60 fps: [[CCDirector sharedDirector] setAnimationInterval: 1.0/60.0].
When i remove the background parallax layer I get 60 fps but when I add it in it never goes above 30.Posted 1 year ago # -
I tried removing 1 of the 4 background sprites(3 of them moving) and it consistently stays at 30. Then i removed 2 of the 4 parallax background sprites and it got better to about 40-50. Then I remove all the Parallax background sprites then I got 60. Any ideas how to fix this?
Posted 1 year ago # -
Pretty sure this has to do with your big background sprites. I've faced this problem as well, but don't think I ever got it fixed. I just worked around it. Adding two 480x320 sprites usually instantly drops the FPS from 60 to 30. I think some people suggested before changing the Director type from Link to the other one (NSTimer?, can't recall the names off hand), but I don't remember if it worked or not.
Other threads related to the same issue that haven't really led to any firm conclusions:
http://www.cocos2d-iphone.org/forum/topic/912
http://www.cocos2d-iphone.org/forum/topic/3507- kalx
Posted 1 year ago # -
I had a schedule going at 1/60 interval and removed that then I got a 10 FPS boost now at 35-40 fps using mainloop director type and 30-40 fps using NSTimer director type.
Are having multiple schedulers running at 1/60 intervals bad practice?
Posted 1 year ago # -
Hi to all,
In my application, I have to handle the interruption when application is running & phone call comes. I used the pause method when call comes & if I reject the call I used resume method.By using resume application works properly but sounds not played. I used soundEngineManager for play sound in game. I dont know what is the exact problem. I am posting the code below:
-(void) applicationWillResignActive:(UIApplication *)application
{
[[Director sharedDirector] pause];
//[[SoundEngineManager sharedManager] pause];
}//
// Resume everything
// If we were playing the show the "Resume dialog".
//-(void) applicationDidBecomeActive:(UIApplication *)application
{
printf(" \n AppDelegate : applicationDidBecomeActive") ;
if( !isPaused && isPlaying) {
// Dialog
UIAlertView *pauseAlert = [[UIAlertView alloc]
initWithTitle:@"Game Paused"
message:nil
delegate:self
cancelButtonTitle:nil
otherButtonTitles:@"Resume",nil] ;
[pauseAlert show];
[pauseAlert release];
}
else
[[Director sharedDirector] resume] ;//[self preLoadSounds];
//[self playBackGroundMusic:PlayPreviousTrack] ;
//[[SoundEngineManager sharedManager] resume];
}
if any one have an idea let me know as soon as possible.Thanks in advance.
Posted 1 year ago # -
I have ran into this issue as well and this is how I solved it.
1. Make sure you don't have a sprite under the parallax backgrounds. I had one to fix the flicker issue between tiled backgrounds and it killed my fps. From 60 to 30.
2. 1024 is the max size and going down even a small amount in size seems to really help (the more the better). I reworked my backgrounds so the have a gradient on the top that blends into a solid color that is the same as the layer bg color. This is a good approach to getting the images even smaller.
3. Make sure there is no alpha on the background images. Again this killed my fps.I have 4 very complex backgrounds that are 960 x 480 and I am getting close to 60fps.
Posted 1 year ago # -
If not sprite how should i display the background?
Posted 1 year ago # -
Just make one with a jpg or something as your background or a pvrtc. Images go into textures regardless if they are png, gif, or jpg. The texture from a jpg should not have any transparency created for it.
Posted 1 year ago # -
I managed to get a more consistent 40 fps using mainloop director type by resizing the image. I need the transparency though to show all the images. If I set it to jpg it fills the empty space of each image white which will block images behind it.
Posted 1 year ago # -
At the risk of stating the obvious, if you're compiling in Debug mode try commenting out any CCLog() calls (to isolate the cause of the performance issue) as these can really slow things down.
See http://www.cocos2d-iphone.org/forum/topic/1542#post-9625
Posted 1 year ago #
Reply
You must log in to post.