<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>cocos2d for iPhone &#187; Tag: fps - Recent Topics</title>
		<link>http://www.cocos2d-iphone.org/forum/tags/fps</link>
		<description>A fast, easy to use, free, and community supported 2D game engine</description>
		<language>en-US</language>
		<pubDate>Fri, 10 Feb 2012 03:39:06 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.cocos2d-iphone.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.cocos2d-iphone.org/forum/rss/tags/fps/topics" rel="self" type="application/rss+xml" />

		<item>
			<title>Bill Hollings on "Welcome to the cocos3d forum!"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/13181#post-73895</link>
			<pubDate>Wed, 02 Feb 2011 16:58:37 +0000</pubDate>
			<dc:creator>Bill Hollings</dc:creator>
			<guid isPermaLink="false">73895@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>This forum is for questions and support about <strong>cocos3d</strong>, a significant extension to cocos2d that adds a full 3D modelling space, including 3D mesh models, perspective projection cameras, materials, and lighting. With <strong>cocos3d</strong>, you can populate your world with 3D models exported from 3D editors such as Blender, 3ds Max, or Cheetah3D, combined with models you create dynamically in your Objective-C code.</p>
<p>Integration with cocos2d is seamless. Rendering of all 3D model objects occurs within a special cocos2d layer, which fits seamlessly into the cocos2d node hierarchy, allowing 2D nodes such as controls, labels, and health bars to be drawn under, over, or beside 3D model objects. With this design, 2D objects, 3D objects, and sound can interact with each other to create a rich, synchronized audio-visual experience.</p>
<p>Like cocos2d, <strong>cocos3d</strong> is written entirely in Objective-C, and many of your favourite cocos2d paradigms, such as CCActions, are available for 3D objects.</p>
<p>Before posting questions to this forum, first make sure that you have checked out the following sources of information and help:</p>
<ul>
<li><a href="http://brenwill.com/cocos3d">cocos3d homepage</a>.</li>
<li><a href="http://brenwill.com/2011/cocos3d-programming-guide/">cocos3d Programming Guide</a>.</li>
<li><a href="http://brenwill.com/docs/cocos3d/0.5-beta/api">cocos3d API</a>.</li>
<li>Demo applications in the <code>Demos</code> folder in your <strong>cocos3d</strong> distribution.</li>
<li><a href="http://brenwill.com/2011/cocos3d-development-roadmap">cocos3d Development Roadmap</a>.</li>
<li><a href="http://brenwill.com/2011/cocos3d-importing-converting-collada-to-pod/">cocos3d Importing: Converting COLLADA to POD</a></li>
</ul></description>
		</item>
		<item>
			<title>NOG on "Where is the position defined for the FPSLabel?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28386#post-139733</link>
			<pubDate>Mon, 16 Jan 2012 19:32:19 +0000</pubDate>
			<dc:creator>NOG</dc:creator>
			<guid isPermaLink="false">139733@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm interested in having labels and parallax backgrounds displayed outside of a scene, and currently checking out CCDirector to see how the frames per second are displayed.  Can anyone tell me where the label is positioned and added? Thanks
</p></description>
		</item>
		<item>
			<title>sctm81 on "FPS ISSUE due to hash size after adding and removing a large number of shapes."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/28253#post-138981</link>
			<pubDate>Wed, 11 Jan 2012 01:00:43 +0000</pubDate>
			<dc:creator>sctm81</dc:creator>
			<guid isPermaLink="false">138981@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Dear All:</p>
<p>I am in the process of developing a new space shooter and am noticing that the frame rate drops from initially 60 to 20 after adding and removing a larger number of shapes (&#62;1000). I certainly do not have a memory leak as I have used the profiler to check my memory usage. Using the Time Profiler I discovered that the processes that are using more and more time are the calls to 'cpvdot'. </p>
<p>By printing out </p>
<p>NSLog(@"SIZe %d", space-&#62;activeShapes-&#62;handleSet-&#62;size);  </p>
<p>i realized that the the number of the active shapes grows until 193 at which the fps slows down significantly. To remove shapes i'm doing the following</p>
<p>////these are my variables<br />
CCSprite *SystemSprite;<br />
cpSpace *World<br />
cpShape *DynamicShape<br />
cpBody *DynamicBody;</p>
<p>////here's the code for removing the shapes</p>
<p>        [ParentBatchNode removeChild:SystemSprite cleanup:true];<br />
        cpSpaceRemoveBody(World, DynamicBody);<br />
        cpSpaceRemoveShape(World, DynamicShape);<br />
        cpShapeFree(DynamicShape);</p>
<p>Could anybody let me know why the number of the objects is increasing even though i am removing them?</p>
<p>Thanks everyone</p>
<p>Tim
</p></description>
		</item>
		<item>
			<title>zuschauer on "How to delay drawScene (aim -&gt; 50 fps)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/27851#post-136774</link>
			<pubDate>Sat, 24 Dec 2011 10:47:01 +0000</pubDate>
			<dc:creator>zuschauer</dc:creator>
			<guid isPermaLink="false">136774@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Happy Xmas! colleagues,</p>
<p>I have searched the forum and found many topics about fps performance issues. In my case I want to force 50 fps but as far as I understand cocos2d and finally CADisplayLink only supports 30 or 60 fps (correct me if I am wrong).</p>
<p>So, I am searching a good way to delay the game loop call to reach stable 50 fps. At the moment my game is running at full 60 fps.</p>
<p>For some examples I would be really thankful.</p>
<p>Kind regards,<br />
Stefan
</p></description>
		</item>
		<item>
			<title>galenzo17 on "Performance on Ipad, load sprite´s (StoryBook)"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/25377#post-132051</link>
			<pubDate>Wed, 07 Dec 2011 12:45:08 +0000</pubDate>
			<dc:creator>galenzo17</dc:creator>
			<guid isPermaLink="false">132051@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi!</p>
<p>My code:</p>
<p>/////////////////////////////////  nandu.h    /////////////////////////////////////////</p>
<p>@interface nandu : CCLayer<br />
{<br />
	CCSprite *fondo;<br />
	//CCParticleRain *lluvialenguad;<br />
}</p>
<p>+(CCScene *) scene;</p>
<p>@end</p>
<p>///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////</p>
<p>/////////////////////////////////  nandu.m    /////////////////////////////////////////</p>
<p>#<a href='http://www.cocos2d-iphone.org/forum/tags/import'>import</a> "nandu.h"</p>
<p>@implementation nandu</p>
<p>+(CCScene *) scene<br />
{<br />
	// 'scene' is an autorelease object.<br />
	CCScene *scene = [CCScene node];</p>
<p>	// 'layer' is an autorelease object.<br />
	nandu *layer = [nandu node];</p>
<p>	// add layer as a child to scene<br />
	[scene addChild: layer];</p>
<p>	// return the scene<br />
	return scene;<br />
}</p>
<p>-(void)starButtonTapped{</p>
<p>	[[bookmanager sharedbookmanager] runSceneWithID:kcuruscene];</p>
<p>}</p>
<p>// on "init" you need to initialize your instance<br />
-(id) init<br />
{<br />
	// always call "super" init<br />
	// Apple recommends to re-assign "self" with the "super" return value<br />
	if( (self=[super init])) {</p>
<p>                isTouchEnabled_=YES;</p>
<p>		[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@"curunandu.plist"];</p>
<p>		fondo =[CCSprite spriteWithFile:@"fondonandu.png"];<br />
		fondo.position=ccp(384,514);</p>
<p>		[self addChild:fondo z:-2];</p>
<p>		CCSprite *nandiu=[CCSprite spriteWithSpriteFrameName:@"nandusinfondo.png"];<br />
		//lenguado.anchorPoint=ccp(0,0);<br />
		nandiu.position= ccp(391, 637);<br />
		nandiu.tag=100;<br />
		[self addChild:nandiu];</p>
<p>		CCMenuItem *adelante = [CCMenuItemImage<br />
								itemFromNormalImage:@"1.png" selectedImage:@"1.png"<br />
								target:self selector:@selector(starButtonTapped)];<br />
		adelante.position = ccp(640, 60);</p>
<p>		CCMenuItem *atras = [CCMenuItemImage<br />
							 itemFromNormalImage:@"3.png" selectedImage:@"3.png"<br />
							 target:self selector:@selector(starButtonTapped)];<br />
		atras.position = ccp(130, 60);</p>
<p>		CCMenuItem *indice = [CCMenuItemImage<br />
							  itemFromNormalImage:@"2.png" selectedImage:@"2.png"<br />
							  target:self selector:@selector(starButtonTapped)];<br />
		indice.position = ccp(388, 100);</p>
<p>		CCMenuItem *ficha = [CCMenuItemImage<br />
							 itemFromNormalImage:@"botonfichatransparente.png" selectedImage:@"botonfichatransparente.png"<br />
							 target:self selector:@selector(starButtonTapped)];<br />
		ficha.position = ccp(189, 254);</p>
<p>		CCMenuItem *texto = [CCMenuItemImage<br />
							 itemFromNormalImage:@"botontransparentetexto.png" selectedImage:@"botontransparentetexto.png"<br />
							 target:self selector:@selector(starButtonTapped)];<br />
		texto.position = ccp(583, 305);</p>
<p>		CCMenu *starMenu = [CCMenu menuWithItems:adelante,atras,indice,ficha,texto, nil];<br />
		starMenu.position = CGPointZero;<br />
		[self addChild:starMenu];<br />
	}<br />
	return self;<br />
}</p>
<p>////Is this OK? mmmmm, I think maybe not, but work///////</p>
<p>-(void) ccTouchesBegan :(NSSet *) touches withEvent :(UIEvent *)event<br />
{<br />
	UITouch *touch =[touches anyObject];<br />
	CGPoint location= [touch locationInView:[touch view]];<br />
	location=[[CCDirector sharedDirector]convertToGL:location];</p>
<p>	CCSprite *nandusinfondo=(CCSprite *)[self getChildByTag:100];</p>
<p>	id effect = [CCWaves actionWithWaves:10 amplitude:10 horizontal:YES vertical:YES grid:ccg(10, 10) duration:3];<br />
	[nandusinfondo runAction:effect];</p>
<p>}</p>
<p>- (void) dealloc<br />
{<br />
	[[CCSpriteFrameCache sharedSpriteFrameCache] removeUnusedSpriteFrames];</p>
<p>	// don't forget to call "super dealloc"<br />
	[super dealloc];<br />
}</p>
<p>@end</p>
<p>///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
///////////////////////////////********************/////////////////////////<br />
My  code works at 15 fps</p>
<p>And I have a BookManager and constant</p>
<p>My questions:</p>
<p>-How i can change my code for better performance?  Any Ideas? :)<br />
-I have 65 page to do; Is this the best way?<br />
-15 fps on device is ok? or crash all the time?<br />
-is this  the best way for sprites load?<br />
-All my art work is in .png; I have to change to .pvr?</p>
<p>i'm new on cocos2d and I almost finished my work and i need from the experience voice</p>
<p>and a study a lot before ask</p>
<p>sorry for my english i´m from Argentina like Riq!</p>
<p>best regards
</p></description>
		</item>
		<item>
			<title>aramk on "CCSpriteBatchNode with large transparent backgrounds"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/23964#post-129077</link>
			<pubDate>Sun, 27 Nov 2011 16:22:54 +0000</pubDate>
			<dc:creator>aramk</dc:creator>
			<guid isPermaLink="false">129077@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I've written a bunch of classes for creating a parallax effect background which contains the ground, hills and clouds. Each object is duplicated once and this allows me to create an infinite loop with the ground etc. Problem is, using CCSpriteBatchNode and 12 x PNG 32bit textures with approx. size 600 x 200px slows down my FPS to around 30. I have read that using CCSpriteBatchNode shows big improvements in performance, but I can't seem to replicate them.</p>
<p><a href="http://www.learn-cocos2d.com/2011/09/cocos2d-spritebatch-performance-test/" rel="nofollow">http://www.learn-cocos2d.com/2011/09/cocos2d-spritebatch-performance-test/</a></p>
<p>How can I speed things up?
</p></description>
		</item>
		<item>
			<title>d-range on "FPS counter does not show"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/9594#post-55238</link>
			<pubDate>Wed, 15 Sep 2010 09:28:52 +0000</pubDate>
			<dc:creator>d-range</dc:creator>
			<guid isPermaLink="false">55238@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi guys,</p>
<p>I just started with Cocos2D 2 days ago writing a simple game, and so far it has been an absolute breeze, I really enjoy the API and the way it works, great job! I do have a (relatively minor) issue right now, and I can't seem to find anything about it on the forum or elsewhere on the internet. The problem is that the FPS counter does not show, even though I enabled it. Not in the simulator, not on the device. Otherwise everything is working as expected (ie: the Director fires, the scene I'm displaying gets updated, etc).</p>
<p>I used the sample code on the Wiki to setup my scene like this:</p>
<pre><code>-(BOOL) application: (UIApplication *) application didFinishLaunchingWithOptions: (NSDictionary *) launchOptions
{
  // Forcibly hide the status bar, since I can&#39;t get the damn thing to disappear just
  // by setting the &#39;None&#39; property in the UI Builder
  [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];

  // The following code is all Cocos2D view/buffer setup
  [CCDirector setDirectorType:kCCDirectorTypeDisplayLink];

  _director = [CCDirector sharedDirector];

  [_director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
  [_director setAnimationInterval:10];
  [_director setDisplayFPS:YES];

  EAGLView *glView = [EAGLView viewWithFrame:[self.window bounds]
                                 pixelFormat:kEAGLColorFormatRGBA8
                                 depthFormat:GL_DEPTH_COMPONENT24_OES
                          preserveBackbuffer:NO];

  [_director setOpenGLView:glView];

  [CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGBA8888];

  /// \todo this is iPhone-4 specific, need to check on actual hardware
  //
  //   [director setContentScaleFactor:2];

  [self.window addSubview:glView];
  [self.window makeKeyAndVisible];

  // Create the &#39;maze&#39; scene and set a maze on it
  //
  /// \todo in the finished game, the first scene to display should of course
  ///    not be the maze itself, but a title screen or something similar
  _scene = [AnonMazeScene node];

  AnonMaze *maze = [[[AnonMaze alloc] initWithWidth:10 height:10] autorelease];

  [_scene setMaze:maze];

  // Start director
  [_director runWithScene: _scene];

  return YES;
}</code></pre>
<p>I'm using the last beta (0.99.5-beta2) with a 3GS that has 4.1 firmware, but I'm building with a 3.2 Base SDK for a 3.0 target. The target settings don't seem to have any effect on this issue by the way, so far I've never seen the FPS counter.
</p></description>
		</item>
		<item>
			<title>cocosGame on "fps from 60 to 30 !!!"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/21353#post-118723</link>
			<pubDate>Thu, 29 Sep 2011 03:04:40 +0000</pubDate>
			<dc:creator>cocosGame</dc:creator>
			<guid isPermaLink="false">118723@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all...<br />
I'm a new at cocos2D-iphone :) , and i am developing a nice game, But today im sticking in strange problem !!<br />
the <strong>fps </strong>in the game is 60 all the time, and when i was added a background 320*480 the <strong>fps drop to 30</strong> !!!!</p>
<p>I tried to make the background 2 parts each one about 320*240 and still the fps 30 , when im deleting the background the fps increase to 60 !!</p>
<p>i road these topics in the forum<br />
<a href="http://www.cocos2d-iphone.org/forum/topic/3507" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/3507</a><br />
<a href="http://www.cocos2d-iphone.org/forum/topic/912" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/912</a></p>
<p><strong>and still do not found any solution !!</strong></p>
<p>please if any one know any <strong>solution </strong>OR any <strong>turn-around solution</strong> tell me :)</p>
<p>Thanks for advice<br />
Best and full regards for YOU
</p></description>
		</item>
		<item>
			<title>mikemellor11 on "Schedulers and frame times"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20776#post-115509</link>
			<pubDate>Mon, 12 Sep 2011 11:01:32 +0000</pubDate>
			<dc:creator>mikemellor11</dc:creator>
			<guid isPermaLink="false">115509@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey, I'm currently in the process of optimising my app. At the moment my app hovers around the 52 - 48 fps mark. I update my scene using a scheduler, my question is how does the scheduler handle the drop in frame rate? My problem is when the app drops below 50 fps, all my movement calls e.g. sprite.setPosition = ccp(x + speed, y), these sprites seem to move almost twice as fast. If the fps is above 50 it seems to be fine, it seems like a if(fps &#60; 50) or something. I used to program directX a bit and one way of making sure movement speeds where constant was to get the frame time for the last frame and then do speed * frametime. I tried implementing this in coocos but it seems the schedulers are doing something like this themselves. Anyone clear this up for me?
</p></description>
		</item>
		<item>
			<title>AlvanChen on "Almost crazy about lower and lower fps..."</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20763#post-115460</link>
			<pubDate>Mon, 12 Sep 2011 03:24:55 +0000</pubDate>
			<dc:creator>AlvanChen</dc:creator>
			<guid isPermaLink="false">115460@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all,<br />
  I am developing a landscape scroll view game in which the sprite keeps moving on from left to right and the background moves back in opposite direction accordingly. But I found the fps becomes lower and lower as the distance becomes farer.</p>
<p>  The problem is related to pictures of the background which are implemented as CCSprites and added/released as the sprite(a plane) moves on. I check position of the plane and decide if old background CCSprites have moved out of screen and need to add new CCSprites in position ahead. According to my game logic, these pictures are implemented in 2 different mechanism:</p>
<p>  type a) Source code to manipulated this type of CCSprite is directly written in the code of the main CCLayer. I use [self addChild:mySprite] and [self removeChild:mySprite cleanup:true] to add/release objects. </p>
<p>  type b) CCSprite which is encapsulated in an NSObject subclass AbstractObject.<br />
      When it's time to initialize an AbstractObject, I'll call [AbstractObject init] function and put it in an std:map&#60;&#62;;<br />
      Then when it comes into the screen, I'll call [AbstractObject addIntoCCLayer: myMainCCLayer], in which [myMainCCLayer addChild:mySprite] is called and CCSprite is added.<br />
      Finally when it move out of screen, I'll call [AbstractObject release], in which [myMainCCLayer removeChild:mySprite cleanup:TRUE] is called to remove CCSprite.</p>
<p>      Type a works fine no matter how far the plane moves.</p>
<p>      <strong>Type b makes fps of the game lower and lower. It drops from 60 to about 50 when the plane moves to about 160000 pixels</strong>, then keeps on dropping as plane moves farer. The more type-b objects I add, the more quickly fps drops. The dramatical thing is If I just initialize CCSprites but just not call addChild/removeChild (just comment these 2 lines of code), the game works perfectly! I can't figure out what's the matter! -- Actually I didn't do any thing additional to added CCSprites, they just been shown as a very normal picture.</p>
<p>     I guess there may be something wrong in my code, but I have no idea how to do further inspection, can anybody give me some hint? I am a newbie, not sure which xcode instrument should be use.</p>
<p>    Thank you for your patience to read my post, hope my description is somewhat clear.
</p></description>
		</item>
		<item>
			<title>mikemellor11 on "Overlapping Images causes fps drop??"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20653#post-114774</link>
			<pubDate>Wed, 07 Sep 2011 11:24:29 +0000</pubDate>
			<dc:creator>mikemellor11</dc:creator>
			<guid isPermaLink="false">114774@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi, just wondering if anybody knows the reason behind this. I am currently adding 4 background images, together they make the background image, but i cut them up so that i could add them seperately. This allows me to scale them different amounts when zooming in and out, this gives a depth effect to the scene. Anyway the 4 images are all 480 - 320, and when i add them all to the scene the fps can drop from 60 to 35 fps, is this a known problem?
</p></description>
		</item>
		<item>
			<title>Thnx4TheXP on "Static Background Image???"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/20371#post-113274</link>
			<pubDate>Mon, 29 Aug 2011 17:26:07 +0000</pubDate>
			<dc:creator>Thnx4TheXP</dc:creator>
			<guid isPermaLink="false">113274@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I have a static background image in my app 1000x1000px. My frame rate is 60 fps without it and 30 fps with it. Is there any way to fix this? Any help would be much appreciated. Thanks.
</p></description>
		</item>
		<item>
			<title>Thnx4TheXP on "Check if sprite exists at angle???"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19932#post-111320</link>
			<pubDate>Fri, 19 Aug 2011 02:19:53 +0000</pubDate>
			<dc:creator>Thnx4TheXP</dc:creator>
			<guid isPermaLink="false">111320@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I need to check if a sprite exists at a certain angle. Does anybody know how to do this? I am making a shooting game and I need to find if there is a sprite in front of the human player. Anything would be helpful because I have no idea what to do. Thanks in advance.
</p></description>
		</item>
		<item>
			<title>eviljack on "FPS counter does not show!"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19859#post-111056</link>
			<pubDate>Wed, 17 Aug 2011 14:03:44 +0000</pubDate>
			<dc:creator>eviljack</dc:creator>
			<guid isPermaLink="false">111056@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Already saw this:<br />
<a href="http://www.cocos2d-iphone.org/forum/topic/9594" rel="nofollow">http://www.cocos2d-iphone.org/forum/topic/9594</a></p>
<p>But I've checked and the "fps_images.png" is already added to my resources folder. I've got this built as an iphone/ipad app (not really universal) but they share the same codebase, the frame rate / FPS shows up on the ipad but not on the iphone version.</p>
<p>Any ideas?
</p></description>
		</item>
		<item>
			<title>cmcaleese34 on "Retina FPS and iPhone 4 performance"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19639#post-109877</link>
			<pubDate>Wed, 10 Aug 2011 16:04:07 +0000</pubDate>
			<dc:creator>cmcaleese34</dc:creator>
			<guid isPermaLink="false">109877@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I would like to start by thanking the cocos2d community as a whole for all the knowledge they have made available in this forum. I am about a week away from submitting  my first game, and I wouldn't have made it nearly this far without all the great info on this site.</p>
<p><strong>Anyway, on to the question:<br />
</strong>My game uses box2d and follows a b2body moving fast through the world I created. In the world I have three background layers scrolling at different speeds for a parallax effect. The layers are .png images that I put in a sprite sheet with texture packer, as well as a CCLayerColor. Normally, when I run the application on my 3gs or in non-retina mode on the iPhone 4 everything runs smoothly at 60fps. However, as soon as I switch to retina my frame rate drops to 40fps. </p>
<p>I figured the drop was just because the hd graphics were taking up too much memory, but even when I turned the pixel format to RGBA4444 and tried using non-hd graphics scaled 200% I was getting 40fps. Also, in instruments, my cpu use is only at about 30% during the most tasking parts of the game. I have thumb turned off for armv6 and on for armv7. If I remove the CCLayerColor and one of the sprites my fps jumps up to 50, but I need both of those elements in my game and 50fps still isn't great. When I test the game on the iPad 2 (universal app) it never drops below 60fps and it uses most of the same -hd graphics that I am trying to use on the iPhone 4. Is the difference in performance really that great between the iPad 2 and iPhone 4? </p>
<p>Does anyone have any suggestions on how I could boost the frame rate in retina mode? Is there a build setting that I could be missing? I"m running in release mode, I did the stuff on the cocos2d best practices page... I am out of ideas at this point. Ideally I would just be able to switch retina mode off for this one scene because it would run smoothly if I could do that, but unfortunately as far as I know you have to commit to either having retina mode on or off. Using smaller images stretched 2x hasn't seemed to help much. </p>
<p>I'm so close to being finished but this fps problem is really vexing me. I never thought I would be having performance issues on the iPhone 4! </p>
<p>Thanks so much in advance for any suggestions!
</p></description>
		</item>
		<item>
			<title>Folkdev on "FPS dropping"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/19468#post-108952</link>
			<pubDate>Fri, 05 Aug 2011 11:06:08 +0000</pubDate>
			<dc:creator>Folkdev</dc:creator>
			<guid isPermaLink="false">108952@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>For two days I've been trying to find out what the cause of the lag in my game is. The thing is: The game run smoothly but after around 5-6min gameplay the FPS drops to about 50 (yes, it's noticeable). I've tried to lock the FPS to 30FPS but the same thing happens - starts to lag a little bit after around 5-6min. If I restart the game (replaceScene) it runs smoothly again.</p>
<p>*No memory leaks<br />
*Checked in Instruments, Allocations, the overall memory allocation is around 3MB<br />
*Time profiler information</p>
<p>1,6% [CCNode visist]<br />
1,4% [CCNode transform]<br />
0,8% [CCSpriteBatchNode draw]<br />
.</p>
<p>I'm using batchnode.<br />
Have tried changing the world-&#62;Step from variable (delta) to fixed 1/30.0 but the same thing happens. </p>
<p>Cocos2D version 1.0.1 with Box2D.</p>
<p>UPDATE:</p>
<p>I think I'm on to something! I create a CCLabelBMFont and run some actions pretty often (it's depending on the player but it can be pretty often). I have commented out that code and now it seems to run smoothly even after 5-6 minutes.</p>
<p>Now I'll try to reuse the same label and action every time and see if it works better than before.
</p></description>
		</item>
		<item>
			<title>ccm1130 on "About FPS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18885#post-105914</link>
			<pubDate>Wed, 20 Jul 2011 03:06:33 +0000</pubDate>
			<dc:creator>ccm1130</dc:creator>
			<guid isPermaLink="false">105914@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi Guys, I wan to ask why the FPS is always 20 or below 20 in my game?<br />
My game is an isometric game. As I just start develop it so it have 30x30 tilemap only nothing more~
</p></description>
		</item>
		<item>
			<title>Zee on "Slow Performance"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/18493#post-103713</link>
			<pubDate>Sat, 09 Jul 2011 00:30:41 +0000</pubDate>
			<dc:creator>Zee</dc:creator>
			<guid isPermaLink="false">103713@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I've been bulding a game and as i started finished creating a new level, the level was very slow. The framerate for the rest of the game was 60fps but in this level, it drops to 30fps whenever the touch function is called.<br />
The only addition i made was the addition of three sprites that i got from an additional 512x512 spritesheet.<br />
I commented out these sprites and the speed returns to 60 when the touch function is called also, so i understand that these are the problems.<br />
and i thought that the game would only slow down when adding the sprites but just them remaining in the scene takes away from the speed also?<br />
any suggestions on how to fix?
</p></description>
		</item>
		<item>
			<title>marioaae on "FPS slow down when touch on sprites with no touch events"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17592#post-98769</link>
			<pubDate>Mon, 13 Jun 2011 07:44:13 +0000</pubDate>
			<dc:creator>marioaae</dc:creator>
			<guid isPermaLink="false">98769@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello guys,</p>
<p>I'm creating my game with Cocos2d 1.0 rc3 and I'm testing on an iPhone 3G.</p>
<p>The issue is that I'm creating a board that actually it's a matrix of sprites, these sprites don't have to respond to touch events so I'm not implementing touch events but when I touch the screen (on the sprites board) the FPS slow down, and I don't know why if I'm not implementing touch events, but if I don't draw any sprite I can touch the screen with no problem. When I try this on other iPhones (3GS and 4) there's no problem but I suppose that it's because those devices have more resources.</p>
<p>Any idea? Thank you!
</p></description>
		</item>
		<item>
			<title>akasurreal on "Target pre-3GS Devices?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17358#post-97622</link>
			<pubDate>Tue, 07 Jun 2011 00:36:26 +0000</pubDate>
			<dc:creator>akasurreal</dc:creator>
			<guid isPermaLink="false">97622@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello all.  Basically we are trying to find out how many people are still using pre-3GS model devices these days to determine if its worth still targeting them and how much we might lose if we don't.  I am having no luck finding any information on google.  Anyone have any recent data?
</p></description>
		</item>
		<item>
			<title>colme on "Problems with FPS"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17470#post-98230</link>
			<pubDate>Thu, 09 Jun 2011 18:27:44 +0000</pubDate>
			<dc:creator>colme</dc:creator>
			<guid isPermaLink="false">98230@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello there, </p>
<p>I am having some problems with the performance of the simulator, when I try to insert an image my FPS ratio goes down to 30 when it should be 60.</p>
<p>The code is the following:</p>
<p><em>[self addChild:Carretera];</p>
<p>ImagenCarretera1 = [CCSprite spriteWithFile:@"carretera_poch.png"];</p>
<p>ImagenCarretera2 = [CCSprite spriteWithFile:@"carretera_poch.png"];</p>
<p>[Carretera addChild:ImagenCarretera1];</p>
<p>[Carretera addChild:ImagenCarretera2];</em></p>
<p>Until here it goes properly, but if I add these few lines,</p>
<p><em><br />
fondoDelante2 = [CCSprite spriteWithFile:@"fondo_1_poch.png"];<br />
[Carretera addChild:fondoDelante2];<br />
fondoDelante2.position = ccp(fondoDelante2.contentSize.width*3/2,240);</em>
</p></description>
		</item>
		<item>
			<title>nesh96 on "Extremely weird iPhone 3G performance problem"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/12140#post-68417</link>
			<pubDate>Mon, 27 Dec 2010 09:35:05 +0000</pubDate>
			<dc:creator>nesh96</dc:creator>
			<guid isPermaLink="false">68417@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi guys, i have been experiencing weird performance problems on my iPhone 3G. First of all my iPhone is running at iOS 4.2 and cocos2d is 0.99-5. The problem is that every single cocos2d 0.99-5 project i load onto my 3G caps at 40 FPS, even the default Hello World template. I can't figure out the problem. To check if my OS or the phone is the culprit, I loaded Stick Wars 2 Lite (cocos2d game) and it was running very smooth. Then i loaded my old game from cocos2d 0.99-4 and it ran at 60 FPS. How could I fix it? (BTW i have an iPhone 4 and it runs at 60 FPS no problem).
</p></description>
		</item>
		<item>
			<title>mayoxy on "Memory problem instruments"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17179#post-96714</link>
			<pubDate>Wed, 01 Jun 2011 15:52:53 +0000</pubDate>
			<dc:creator>mayoxy</dc:creator>
			<guid isPermaLink="false">96714@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi, </p>
<p>i'am programming game with a few scenes etc. </p>
<p>To remove sprites i'm using function removeObject.</p>
<p>The problem is when i try to play with iPhone simulator and instrumets after going to other scene everything is autoreleased /removed. That's OK. after a few minutes playing 'created and still living' in instruments are circa cca 10 kB. that's OK. </p>
<p>BUT........</p>
<p>when i try to play with iOS , real device and instruments, every second 'created and still living' in instruments are increasing. after playing a few minutes it's 5 MB !!!! memory. and still increasing. </p>
<p>What can be a problem ? :( </p>
<p>P.S.: after playing on the iPhone about 5 minutes the game fps decreasing :(
</p></description>
		</item>
		<item>
			<title>CrazyPanda on "Impossible to have smoothly moving Sprites at 30-40 FPS?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16764#post-94416</link>
			<pubDate>Thu, 19 May 2011 20:00:16 +0000</pubDate>
			<dc:creator>CrazyPanda</dc:creator>
			<guid isPermaLink="false">94416@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi all,</p>
<p>I have a simple question I couldn't find an answer for on the forums yet.</p>
<p>So I have a simple 2D-Scroller based on Cocos2D which runs smoothly at 60FPS on 4G devices. However, on iPhone 2/3G it just runs at 30-40 FPS. (I think that's no surprise so far, isn't it?). The speed i am talking about is about 150-250 particles per second, so about 3 particles/frame at 60 FPS, just linear, horizontal movement. Nothing special, something like:</p>
<p>x -= deltaTime*180;<br />
sprite.position = ccp(x, y);</p>
<p>Anyway, no problem so far, since I use update:(CCTime) deltaTime in order to keep game speed at the right level. So it runs with the correct speed with 30-40 FPS on 2/3G etc.</p>
<p>However, my Sprites do not move smoothly at 30-40 FPS, but kinda flickering. There is a certain amount of "stuttering"/"flickering" that makes the movement look odd. </p>
<p>My first basic question is: Is it impossible to display smoothly moving Sprites at 30-40 FPS? In general, I did think so, that's why I'm surprised by this result. A Sprite moving with a speed of 180 pixel/second should be displayable smoothly at 30-40 FPS, shouldn't it?</p>
<p>So my second question is: Is this effect known or can I avoid it? I tried using different intervals for the director 60/30 FPS or different intervals for the update-Scheduler (30, 60, 240...), but it never worked.</p>
<p>To me in a certain way it looks like buffers not working at framerates under 60 fps or the update function not being called often enough.</p>
<p>I also set up a new, clear CCProject that does nothing but show a Sprite moving with a speed of 180px/second (7px/frame at 30 FPS), but it also showed this effect at 30 FPS.</p>
<p>Has anyone an idea, what problem I am facing? Many thanks. :)
</p></description>
		</item>
		<item>
			<title>Aorata on "Many Sprites slows down FPS, how to optimize?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/17065#post-96187</link>
			<pubDate>Sun, 29 May 2011 07:19:59 +0000</pubDate>
			<dc:creator>Aorata</dc:creator>
			<guid isPermaLink="false">96187@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>I'm not adding that many Sprites, when my game has max Sprites on screen it can be like 40, maybe a bit more, but not much.<br />
Anyway, when I'm at that point of the game (enemies, bullets and collisions) at max, my FPS drops from 60 to 50 or 40, some times lower and I'm not sure why. Also, I'm not sure how that will translate to the device because I've only been using the simulator so far.<br />
How can I optimize my FPS when I have many Sprites on screen?</p>
<p>Here is how I add them</p>
<p>//It was scheduled from before<br />
[self schedule:@selector(AddEnemy:) interval:(2)];</p>
<pre><code>-(void)AddEnemy:(ccTime)dt
{
	//badGuy is globaly declared, it was local before, that&#39;s why it&#39;s //
	//CCSprite *badGuy;

	NSString *EnemyName = @&#34;Torpedo&#34;;

                //I get the image from a .plist
		badGuy = [CCSprite spriteWithSpriteFrameName:@&#34;torpedo.png&#34;];

		//position of the enemy
		badGuy = ccp(480,variable);

		[self addChild: badGuy z:0];

		[self Move: badGuy: EnemyName];

                //enemies is a mutable array of enemies
		[enemies addObject: badGuy];

}</code></pre>
<p>The method is much longer (lots of conditions) this is just so you see what I'm doing.</p>
<p>Its a scheduled method, every time it's called (Every two seconds) I create a CCSprite, give it texture and add it to screen with an action (move). The Sprites are removed if a collision happens or if they complete the Move Action. I remove them from screen and from the mutable array.</p>
<p>So there you go, that's all I can say. HOW do I make my FPS stay up when many sprites are on screen? Am I missing something? Doing something Wrong? I've been reading about SpriteSheets and AtlasSPrites, but I think those don't work on the latest cocos2d version?</p>
<p>ps: I've been visiting this forum for a long time now (just joined though), GREAT community btw. But somehow I can't find my answer. If it's already here then I'm sorry, and I would appreciate the link.
</p></description>
		</item>
		<item>
			<title>PAj on "FPS performance oddity between iTouch 2ndGen and iPhone 3G"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16715#post-94148</link>
			<pubDate>Wed, 18 May 2011 20:48:15 +0000</pubDate>
			<dc:creator>PAj</dc:creator>
			<guid isPermaLink="false">94148@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hello,</p>
<p>In the mid stages of beta testing a game and have come across an oddity.</p>
<p>We use particles extensively, cocos2d 0.99.5 and box2d.</p>
<p>We are seeing better performance on an iTouch 2ndGen (55fps) versus an iPhone 3G (25fps).</p>
<p>We have tried running the phones in airplane mode. Turning off all iAd code, etc but we still see worst performance on phones.</p>
<p>Anyone know why this might be the case?</p>
<p>Thanks,</p>
<p>PAj
</p></description>
		</item>
		<item>
			<title>Duckwit on "Retina Simulator - Lag?"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/15411#post-87417</link>
			<pubDate>Sat, 09 Apr 2011 17:48:12 +0000</pubDate>
			<dc:creator>Duckwit</dc:creator>
			<guid isPermaLink="false">87417@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hrrm. Just switched about 6 graphics to retina (only graphics in the prototype), and the framerate has dropped to about 30 at best.<br />
Also, when I run without HD (before I added them) on iPad it was also slow, I think this is because of my actual computers speed but I could be wrong. </p>
<p>Does this happen to anybody else?
</p></description>
		</item>
		<item>
			<title>par02 on "What should we be &quot;shooting&quot; for in terms of iPhone resource usage"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16474#post-92858</link>
			<pubDate>Thu, 12 May 2011 00:38:28 +0000</pubDate>
			<dc:creator>par02</dc:creator>
			<guid isPermaLink="false">92858@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>So, I am doing everything I can to keep my resource usage down.  But doing a google search just doesnt help w/ the following questions:</p>
<p>1) What is the recommended limit for memory usage (Real Memory on the profiler)?  Right now, I am trying to stay under 40MB as most games I see do this.  But what can I push?  I am attempting to court iPhone 3G and on.</p>
<ul>
<li>Angry Birds: ~36MB</li>
<li>Tiny Wings: ~17MB</li>
</ul>
<p>
2) What is the recommended limit for CPU usage?  I have noticed that CPU usage doesnt quite relate to FPS.  I have been (up until recently) only using around 10% CPU usage and FPS was pegged between 59-60.  Now im around 35% as I have added game logic and although "most" of the time my FPS is around 59-60, I do see drops to 45 during transitions (i.e. threading changes).</p>
<p>3) With threading in mind, is there a way to lower the priority of a thread that you kick off?  Almost all of my thread required code is NOT time sensitive.  Which means, when I kick off a thread, I can happily wait to do anything with the results until its done.  I would like to kick off a thread at a low priority and let the game run as fast as it can... when the thread is done THEN I do whatever I need w/ the results of the threads resulting work.</p>
<p>4) If you are using a scrolling background and tiling the textures for the background, would you recommend using straight pngs for EACH tile or would using a spritesheet for the tiles be a good idea?  The main reason I ask THIS question is that when I was using individual images for each tile, I had no tiling lines.  Now that I have my backgrounds in a spritesheet, I am seeing tiling and no matter what I do I cannot get rid of them.  I tried offsets, I've tried different formats of the spritesheet container (i.e. png vs pvr vs compressed pvr).  I am pretty much ready to give up and just use straight images for my tiles but that does use more memory :(</p>
<p>5) When using CCSpriteFrameCache "removeUnusedSpriteFrames" and CCTextureCache "removeUnusedTextures", I notice it removes everything that isnt currently used (even though not 1 frame later there might be a sprite in a frame you need).  So I'm going to assume it isnt very smart.  But one thing I HAVE noticed, is after awhile (i.e. running the game for a couple mins) my memory usage goes up to the level I would have if I had loaded and kept all images in memory but these removeUnusedX calls still remove a lot of images AND cause stuttering.  Is there some special way to use these that is not documented anywhere?</p>
<p>6) Is there a document that tells "Things to look for that Apple will use to refuse your game"?  So, if they see me using XMB of Real Memory that will be a red flag.  Or some other set of criteria to watch out for.</p>
<p>7) What is the recommended maximum size of a game?  I read somewhere that 2GB is the limit.. now I will never reach that w/ this current project but the answer would be nice to know.</p>
<p>Thats about it for now.  Thanks much for any responses!</p>
<p>PAR
</p></description>
		</item>
		<item>
			<title>Bananni on "Curious Tilemap"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16139#post-90987</link>
			<pubDate>Sun, 01 May 2011 12:53:50 +0000</pubDate>
			<dc:creator>Bananni</dc:creator>
			<guid isPermaLink="false">90987@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hi,<br />
some time ago we recognized that our fps drops down when we dont split our tilemaps.<br />
So we splitted them into 16x11 parts. (32x32 pixel each tiles)<br />
There are only 2x2 parts around the camera center active at the same time ( visible = YES ) that means we got 4 parts active.<br />
Each part got 4 layers, where the 1st and the 4th layer are rarly mapped.<br />
That means we got maximal 16*11*4*4 tiles at the same time visible.</p>
<p>Heres the code how we read and add the maps in our game:<br />
<pre><code>// Read the map with the ID: newMapID
tilemap = [[CCTMXTiledMap alloc] initWithTMXFile:[NSString stringWithFormat:@&#34;Map%d.tmx&#34;,newMapID]];
// Now add the map to our layer.
        [self addChild:tilemap];
// gathering some map informations:
	    mapWidth = (int)tilemap.mapSize.width;
	    int height = (int)tilemap.mapSize.height;
	    mapPixWidth = mapWidth * (int)tilemap.tileSize.width;
// deadY is our line where our player will die after crossing it.
		deadY = [[[tilemap properties] objectForKey:@&#34;DeadY&#34;] intValue]*32+16;
		// Find what collision mask we want for this map:
		if([[[tilemap properties] objectForKey:@&#34;CMask&#34;] isEqualToString:@&#34;desertcastle&#34;])
			cmask=0;
		else if([[[tilemap properties] objectForKey:@&#34;CMask&#34;] isEqualToString:@&#34;cave&#34;])
			cmask=1;
		else if([[[tilemap properties] objectForKey:@&#34;CMask&#34;] isEqualToString:@&#34;forest&#34;])
			cmask=2;
		// Prepare gathering all tile data for the collision layer (2nd layer)
		memset(gamedata.collisionMap,0,sizeof(unsigned int)*13000);
// our map is splitted in 16x11 parts, we calculate now how many parts our map includes:
  	    for(int i=0;i&#60;(int)ceil((float)tilemap.mapSize.width/16.0f);i++){
			for(int a=0;a&#60;(int)ceil((float)tilemap.mapSize.height/11.0f);a++){
				// THE BELOW LAYER:
				[self reorderChild:[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]] z:1];
                                // The collision layer
				[self reorderChild:[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]] z:2];
                                // The decoration layer
				[self reorderChild:[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]] z:3];
				// THE ABOVE LAYER: (7 becauze player is above all events and this layer is above the player)
				[self reorderChild:[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]] z:7];
// We dont want antialiased textures on the map, this should be faster at the same time
				[[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]].texture setAliasTexParameters];
				[[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]].texture setAliasTexParameters];
				[[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]].texture setAliasTexParameters];
				[[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]].texture setAliasTexParameters];
// becauze we splitted the map into 16x11 parts we have to move them for the right
// position.
				[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]].position = ccp(512*i,32*(tilemap.mapSize.height-a*11));
				[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]].position = ccp(512*i,32*(tilemap.mapSize.height-a*11));
				[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]].position = ccp(512*i,32*(tilemap.mapSize.height-a*11));
				[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]].position = ccp(512*i,32*(tilemap.mapSize.height-a*11));
// set the anchor point to top left cornor
				[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]].anchorPoint = ccp(0,1);
				[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]].anchorPoint = ccp(0,1);
				[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]].anchorPoint = ccp(0,1);
				[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]].anchorPoint = ccp(0,1);
// make all parts invisible becauze later we only change the visible atribute of the
// parts inside the view
				[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]].visible = NO;
				[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]].visible = NO;
				[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]].visible = NO;
				[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]].visible = NO;
// now gather all collision datas: (this should be unintersiting for the thread issue)
				unsigned int tid;
				for(int y1=0;y1&#60;(int)MIN(11,(int)tilemap.mapSize.height-a*11);y1++){
					for(int x1=0;x1&#60;(int)MIN(16,(int)tilemap.mapSize.width-i*16);x1++){
						tid = [[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]] tileGIDAt:ccp(x1,y1)];
						if(i*16+a*11*mapWidth+x1+y1*mapWidth &#62;= 13000)
							NSLog(@&#34;error for tile pos id: %i&#34;,i*16+a*11*mapWidth+x1+y1*mapWidth);
						else
							gamedata.collisionMap[i*16+a*11*mapWidth+x1+y1*mapWidth] &#124;= MAX(0,tid-1);
					}
				}
			}
	    }</code></pre>
<p>(E1P3-4 is Layer 1 Horizontal Part 3 and Vertical Part 4)<br />
Before our cave map ( look the image below ) we have 60fps but on this map we have only around 40fps.<br />
When we reach the mushrooms where are almost 0 tiles we still got 40fps.</p>
<p>My questions now are:<br />
- Do we read the map on the right way?<br />
- Do we add it on the right way?</p>
<p>If u need the way how i toogle the visible state, here it is:<br />
<pre><code>-(void) makeLayersVisible{
	if(
	   activeCenterLayer != (int)((camCenter.position.x)/512.0f) &#124;&#124;
	   roundCenterLayer != (int)round((camCenter.position.x)/512.0f) &#124;&#124;
	   activeCenterVLayer != (int)((tilemap.mapSize.height*32-camCenter.position.y)/352.0f) &#124;&#124;
	   roundCenterVLayer != (int)round((tilemap.mapSize.height*32-camCenter.position.y)/352.0f)){
		int i=activeCenterLayer+modX;
		int a=activeCenterVLayer;
		if((modX == -1 ? (i &#62;= 0) : (i &#60; maxX))){
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]].visible = NO;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]].visible = NO;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]].visible = NO;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]].visible = NO;
		}
		a=activeCenterVLayer+modY;
		if((modX == -1 ? (i &#62;= 0) : (i &#60; maxX)) &#38;&#38; (modY == -1 ? (a &#62;= 0) : (a &#60; maxY))){
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]].visible = NO;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]].visible = NO;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]].visible = NO;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]].visible = NO;
		}
		i=activeCenterLayer;
		if((modY == -1 ? (a &#62;= 0) : (a &#60; maxY))){
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]].visible = NO;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]].visible = NO;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]].visible = NO;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]].visible = NO;
		}
		a=activeCenterVLayer;
		[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]].visible = NO;
		[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]].visible = NO;
		[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]].visible = NO;
		[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]].visible = NO;

		activeCenterLayer = (int)((camCenter.position.x)/512.0f);
		activeCenterVLayer = (int)((tilemap.mapSize.height*32-camCenter.position.y)/352.0f);
		roundCenterLayer = (int)round((camCenter.position.x)/512.0f);
		roundCenterVLayer = (int)round((tilemap.mapSize.height*32-camCenter.position.y)/352.0f);

		modX=(activeCenterLayer == roundCenterLayer ? -1 : 1);
		modY=(activeCenterVLayer == roundCenterVLayer ? -1 : 1);
		i=activeCenterLayer+modX;
		a=activeCenterVLayer;
		if((modX == -1 ? (i &#62;= 0) : (i &#60; maxX))){
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]].visible &#124;= YES;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]].visible &#124;= YES;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]].visible &#124;= YES;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]].visible &#124;= YES;
		}
		a=activeCenterVLayer+modY;
		if((modX == -1 ? (i &#62;= 0) : (i &#60; maxX)) &#38;&#38; (modY == -1 ? (a &#62;= 0) : (a &#60; maxY))){
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]].visible &#124;= YES;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]].visible &#124;= YES;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]].visible &#124;= YES;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]].visible &#124;= YES;
		}
		i=activeCenterLayer;
		if((modY == -1 ? (a &#62;= 0) : (a &#60; maxY))){
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]].visible &#124;= YES;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]].visible &#124;= YES;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]].visible &#124;= YES;
			[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]].visible &#124;= YES;
		}
		a=activeCenterVLayer;
		[tilemap layerNamed:[NSString stringWithFormat:@&#34;E1P%i-%i&#34;,i,a]].visible &#124;= YES;
		[tilemap layerNamed:[NSString stringWithFormat:@&#34;E2P%i-%i&#34;,i,a]].visible &#124;= YES;
		[tilemap layerNamed:[NSString stringWithFormat:@&#34;E3P%i-%i&#34;,i,a]].visible &#124;= YES;
		[tilemap layerNamed:[NSString stringWithFormat:@&#34;E4P%i-%i&#34;,i,a]].visible &#124;= YES;
	}
}</code></pre>
<p>Any clues?<br />
thx.</p>
<p><a href="http://www.imagebanana.com/view/iphwytcm/ruckelmap.png" rel="nofollow">http://www.imagebanana.com/view/iphwytcm/ruckelmap.png</a>
</p></description>
		</item>
		<item>
			<title>rethinkflash on "positioning single particles"</title>
			<link>http://www.cocos2d-iphone.org/forum/topic/16076#post-90604</link>
			<pubDate>Thu, 28 Apr 2011 23:05:48 +0000</pubDate>
			<dc:creator>rethinkflash</dc:creator>
			<guid isPermaLink="false">90604@http://www.cocos2d-iphone.org/forum/</guid>
			<description><p>Hey guys, I've taken a good gander over the cocos2D framework, and its way easier to work with than anything else on iOS devices. But I have a question on the particle system.</p>
<p>I've been playing with the particle system to see if it could handle around 5000 particles with a texture 8x8 pixels. Works great! Really fast FPS.<br />
But I'm looking for a way to place each particle at a x/y location based of some data in a xml file. I tried doing this with straight up CCSprites, but that didn't work out too well, if you know what I mean (low fps). It seems like particles only emit from wherever the emitter is located. Would it be practical to have the emitter moved to the x/y location, emit one particle at a time, then loop over again until all points are used? Or would there be a better way to place them individually?
</p></description>
		</item>

	</channel>
</rss>

