It's free to join Gamasutra!|Have a question? Want to know who runs this site? Here you go.|Targeting the game development market with your product or service? Get info on advertising here.||For altering your contact information or changing email subscription preferences.
Registered members can log in here.Back to the home page.    
Latest game industry news.|Articles about game development.|||||Searchable databases of game development companies, products, and web sites.|Purchase stuff from Gamasutra, Game Developer magazine, the GDC, and more.
Search articles, jobs, buyers guide, and more.

By Francesco Iorio and Andrew Boskett
Gamasutra
[Author's Bio]
March 6, 2002

Design

Exporting and Decompressing JPEG

Palletizing

Printer Friendly Version
   
Letters to the Editor:
Write a letter
View all letters


Features

Broken Sword: Palletized JPEG for Game Boy Advance

Broken Sword is a graphical adventure game re-implemented from scratch to work on the Game Boy Advance. Selecting the right compression techniques for various data is important for all games and never more so when you want to squash as much as possible onto an 8MB cartridge without resorting to content butchery. The largest chunk of our storage budget was given to animation data, but the game also contains roughly 150 unique background images, nearly 80 music cues complete with orchestral sample set, a suite of SFX samples and five languages worth of dialogue.

Uncompressed, the backgrounds in Broken Sword would occupy close to 7MB. This article discusses the technique we used for storing lots of high detail unique backgrounds for use with character (tiled) BG modes. There's no glamor here I'm afraid; this article presents a useful, flexible solution to the meat and potatoes problem of managing a large number of background graphics.

Design

Deciding on a graphics mode to best fit the game was first port of call after identifying all visual requirements. We decided to use a screen mode which supports 256 colors because
it suited the in-game graphics best.

JPEG compression suits detailed images particularly well, so it was a natural first choice for storing our backgrounds. Not only is it very powerful, crunching images down to impressive ratios, but it's very flexible too. JPEG compression can accept a quality parameter, making it very simple to play the quality of the resulting image against its compressed size. We exploited this in our build process by applying an initial global quality level to all backgrounds, set as low as we could get away with, then spending the remainder of the budget individually improving any backgrounds that decompressed with too many ugly artifacts (those with large areas of solid color in particular). Figures 1 to 3 give an example of JPEGs flexible quality control. It's also worth noting that both the artifacts and the decrease in saturation subtleties that JPEG introduces are much less noticeable on the Game Boy Advance LCD.



Figure 1: Uncompressed original (46.0 KB)

Figure 2: JPEG compressed at 50/100 quality (15.3 KB)

Figure 3: JPEG compressed at 20/100 quality (9.3 KB)

For ten representative backgrounds, on average, JPEG compression, set at a quality of 50/100 compresses images down to 30.2 percent of their original size. With a quality setting of 35/100 this becomes 24.8 percent and at 20/100 its down to 18.1 percent.

______________________________________________________
Exporting and Decompressing JPEG


join | contact us | advertise | write | my profile
news | features | contract work | jobs | resumes | education | product guide | store



Copyright © 2002 CMP Media LLC. All rights reserved.
privacy policy | terms of service