Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Of Large Levels and Small Devices

Sign in to follow this  


Posted by Ian Wagner, Programmer at Demergo,[/font][/color]
"I suffer from short-term memory loss. It runs in my family. At least I think it does..." Speaking of which, one of the fun things we get to deal with while developing the Fixbot game engine is management of the device's short-term memory. iDevices have a very small amount of short-term memory compared to desktop computers or consoles. While it is not uncommon for a PC/Mac game to require upwards of 1GB of RAM these days, iOS apps are hard pressed to get 20MB without running the device out of memory. This presents a slight problem for games like Fixbot, whose levels can exceed 10,000 x 10,000px. As you can imagine, an image this size would consume quite a bit of memory.[/font][/color]
In addition to the sheer memory usage of this image, there is another problem that needs addressing. Fixbot, like most other iOS games, used OpenGL to handle rendering. This imposes a texture size limitation of 1024x1024 or 2048x2048 (this limitation is device-specific). In order to handle levels up to 10 times this size, we specially designed our level editor to split the levels up into multiple images. The location of each "chunk" is then written to the level file so that the game engine knows where to draw each piece.[/font][/color]
As previously noted, we don't have enough memory to keep the entire level loaded in memory, even if it is chunked up into manageable textures, so the engine has to be smart about which textures it keeps around and which get unloaded. We're still deciding on the proper balance for each device, but the game engine basically checks where the player is periodically and then makes sure that all chunks within about a 3x3 screen block (with the player in the middle) stays loaded. Everything else is "forgotten" as quickly as those random facts after the history test :)[/font][/color]
Reposted from Fixbot Blog: http://demergostudios.com/fixbot[/font][/color]
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!