Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
41 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

  Contents

 Introduction
 Resource Files In
 Depth

 Design and Theory
 Implementation
 For the Future

 Printable version

 


For the Future

Once you have your resource file management library up and running, you'll most likely want to make an editor so that you can easily create and manage various resource files. There are a couple of approaches you can for doing this. Probably the easiest way of doing this is creating a console application that accepts parameters on the command-line. You may also want to make an editor with a GUI that is similar to Windows Explorer. You could also incorporate a resource file editor into your game editor so that you have one application that acts as your tool set when creating the various resources. You will also probably want to create your own custom lump handling routines.

Still, is there anything else we can do to improve our resource file implementation? Of course there is, as the possibilities are limitless; however, I'll go over a few of them here. One thing you can do to organize the lumps in your resource files is by building an internal directory structure. This directory structure would emulate the one found in DOS, for instance. You could create numerous directories within the resource file and organize the data lumps into these directories. This leads to more efficient maintenance of resource files.

Another thing that would be interesting to do would be to create a data & file I/O streaming system that would be used by your resource file management library. You would create a base streaming class, and derive other streaming classes off of that. That way, you could have a compression streaming class, an encryption streaming class, an imbedded data streaming class, and so on. Then, you could add some settings to your resource file format that would allow you to compress and encrypt data as it's output to the file.

If you want to allow your resource file management library to be used to across a wide range of platforms you will have some extra work cut out for you. Of most concern would be the endian byte order used by the host platforms. You will have to take this into account by shifting the bytes around so that they will be compatible with the machine; this process would take place during the loading and saving of a resource file.

Another concept, which is interesting, is that of data caching. Since accessing a hard drive is much faster than reading off of a CD or DVD drive, a temporary cache file could be created on the hard drive. Then, the most frequently accessed data would be placed in the cache file for quick access. This would greatly speed up the loading sequences in your game once the cache file is created and operational.

Of course, there are many other things you could do with a resource file management library – it all depends on what you want to use the management library for. Anyway, I hope you've enjoyed this article, good luck with your coding endeavors, and code-on!

Download the source here!