In programming games very important aspect to decouple your media assets from your game code. Ideally you want to keep hard coded values in your code to an absolute minimum. Developing a mechanism to indirectly refer to assets (e.g. config files that point your hard coded values to the actual asset names) allows for changes in assets to occur without recompiling code[0]. This is a good thing, it allows for a shorter cycle between tweaks, and if sufficient control is placed in the config files then you can fob tasks off on the design staff[1]. Decoupling can also allow you to abstractly specify behavior so that you can use the unique features of each platform without wrapping everything in an #ifdef PLATFORM clause[2].
[0] Generating header files from assets is not decoupling, it is evil. it works really well right up until things start changing rapidly toward the end of a production cycle when you start to associate full builds with tearing your hair out.
[1] Nothing makes a designer prioritize features faster than a phrase like "Well, you just open mysound.cfg with your text editor and change the values to whatever you like." I'm willing to put in all kinds of work to support designers, but I don't want to have to spend 16 hours tweaking between 12 flavors of I-Don't-Really-Care when I've got code to write. Interestingly, the term for this behavior is "delegation" which I suppose makes me in charge of the designers in this very limited respect... hmm...
[2] Or at least that's what I'm telling myself this as I'm looking to redesign a few components in preparation for a port.
Posted by matt at July 29, 2003 01:51 AM