Dev Notebook

The F84 Developers Notebook is the place to hear from our development team about current projects and the challenges they face. The Developers Notebook is a great place for aspiring developers to visit as they will meet many of the same challenges as our team while working in their new careers.

...............................................................................................................................................

TILE MAP OPTIMIZATION
Monday - 8/3/09
iPhone

I just got done with some serious low-level optimizations to the cocos2d tile map.  Since we want to have virtually unlimited tile map size in an upcoming title, I had to do a lot of work to keep from rendering the whole map all at once and reduce our memory footprint.  

The original tile map code uses the graphics hardware to draw the entire map (huge) even though you only see a small portion in the iPhone screen.  The first thing I did was write code that only draws the part you can see which dramatically increased performance.

 The next step was to reduce the memory footprint.  Since I was still storing all of the map data in memory our total usage was over 30 MB which is a lot for an iPhone app.  However, once I started dynamically generating the graphics data I needed the frame rate dropped from 60 to 40 FPS.  The trick was using low-level C memory management functions to move memory around instead of updating the values in loops, which brought the frame rate back up to 60 FPS.  

The result was a high frame rate and memory footprint of only 3 MB.  I was able to have my cake and eat it too!

Jacob
jacob@floor84studio.com

LGW web

console stats
Console Breakdowns... The market position of the Nintendo family of products is undeniable. F84 believes that developing for these products provides us with innovative opportunities to create great games for the masses. In this module We will continue to provide the latest market share information available.
© Copyright 2010 - F84 Games, All Rights Reserved. F84™Floor 84 Studio, LLC