Systematic Gaming

September 30, 2008

Game Profiling 101

Filed under: game programming, profiling — Tags: , — systematicgaming @ 8:21 am

On this blog I keep mentioning efficiency, resource usage and optimization as key requirement for any well designed game system.  When discussing memory I put a large emphasis on tracking and profiling memory usage.

This time we’ll look at the various ways we can profile our game. We’ll also look at how to instrument our game for custom profiling, focusing on CPU usage.


September 24, 2008

Data Compression Evaluation

Filed under: file management — Tags: , — systematicgaming @ 1:38 pm

When discussing load times I mentioned that compression is an important way of reducing load times.  I also said that memory usage can be reduced by compressing data into smaller fixed sized blocks – instead of compressing a file as a single block.  There is also a variety of compression algorithms available, with different performance characteristics and strengths.

So how do you choose the proper compressor?  There is no single best algorithm, many have different strengths and weaknesses and are useful in different situations.  We’ll investigate a few different compression algorithms and more importantly evaluate what to look for when deciding on how to compress your data.


September 18, 2008

Load Times: Layouts and More

Filed under: file management, game programming — Tags: , — systematicgaming @ 11:41 pm

We know that seek time is a major problem with optical media, so we’ll need to reduce it as much as possible to achieve our fast load times. There’s really only so much we can do to solve the problem

  • Seek less by reading less files
  • Seek less by organizing our files better

We’ve seen how to reduce the number of files read by using packfiles, which also helped by seek times a little bit.  Since seek times are related to the physical distance and direction a drive head has to move, we’ll look at how to reduce seek times by arranging files on disc to minimize their distance.

We’ll also wrap up this series on load times with some tips and tricks to get that last bit of optimization.


September 16, 2008

Load Times: Packfiles

Filed under: file management, game programming — Tags: , — systematicgaming @ 5:27 am

A packfile is simply a single file containing one or more other files. They’re very useful for load times, and can be used in a number of ways. We can put files that get loaded together into a single packfile and load them at once, such as putting the data for a single level into a single packfile and loading in a single read. We can also put our entire filesystem into one or more packfiles, which lets us handle compression cleanly as well as making distribution easier.

So what do we need to do to create a packfile? No much:

  • File name and path, usually relative to a specific root directory
  • File size and compressed size

In this article now we’ll look at how to implement a packfile system.


September 11, 2008

Load Times: Compression

Filed under: game programming, memory management — Tags: , — systematicgaming @ 11:49 am

We’ve gone over what happens when we read files, and came up with some ways to reduce stalls between our game and the OS and hardware. We designed a file manager that allows us to read files asynchronously and remove all the wait time. What next?

Well the simplest way to reduce load times is to load less data. If we simply compress our data we’ll reduce load times a lot. General compression algorithms can often get a 50% or more reduction in file size, which translates directly into reduced load time.


September 8, 2008

Load Times: Asynchronous Loading

Filed under: file management, game programming — Tags: , — systematicgaming @ 5:26 am

We looked at how files are read earlier, and saw how much time is wasted by waiting for file operations to finish. So the only real solution is to not wait for operations to complete. This is called asynchronous reading, where the file operation happens in parallel with our game, controlled by the OS.

Asynchronous file loading requires more structure and organization than normal file reading, so we’ll need to create a file manager to provide portable asynchronous loading. We will need to change how we handle file data inside out game to support this functionality. But it’s worth it because it gives us a huge win in load times, and in the end gives us a more robust game engine as a bonus.


September 1, 2008

Load Times: Reading Files

Filed under: file management, game programming — Tags: , — systematicgaming @ 1:23 am

Load times are a bane of console games, every game has load screens and nobody likes staring at them. Some games try to hide load times under cut-scenes or flashy effects. The elevator scenes in Mass Effect are a clever trick and are better than a “Loading” icon, but still get repetitive and players do feel like they’re standing still. Really the only solution is to make the load time as short as possible.

With console games content getting larger and larger and disc speeds not keeping pace, load times are aren’t getting any shorter. To get the shortest load times possible we need to handle file loading intelligently.

Create a free website or blog at