I plan to have three ways of running the game: either via Eclipse (for general development), via Webstart (for playing and testing by others) and via an actual installed app (for the final thing).
The Quake Method
Back in the Quake era I used to do lots of modding for both Quake 1 and 2, and the prioritied resource system works really well, so I thought I'd pinch it. [grin] Basically Quake would have 'pak' files, which were custom archives of files complete with a directory structure (like a zip file, and in fact Q3 stopped using a custom format and uses proper zip files). Files get loaded using a relative pathname just like a normal file.
The neat bit comes in the prioritisation - pak0.pak would ship with the game content. pak1.pak would be the first patch, and any resource loaded would first be looked for in pak1, and if not found then loaded from pak0 - effectivly you could replace any resource with a newer one. Better, paks could exist 'unpacked' and just sit as raw files (but in the same directory structure). If a base dir was specified on the command line it would also be used as a source for resources (and take priority over all pak files). You could therefore have a whole bunch of mods installed in seperate directories, and just enable the one you wanted on the command line.
My Implementation
All very nice, but also a large chunk of programming. Fortunatly I've got a whole bunch of tools available in Java to do most of the work for me.
First off, pak files - instead of a custom file format I'm using jar files. Almost exactly the same really; multiple files bundled into one, relative directory structure, good compression and the ability to be signed (needed for webstart distribution). And I don't have to write anything to create, access or view them - all the tools and libraries already do that for me.
Running from Eclipse is trivial - here everything sits 'unpacked' and I simply run the game as if the whole thing was an unpacked mod.
Running as webstart is also easy - up to a point. If I just include the needed jars everything works fine, unfortunatly theres no way to add new content and theres no place for the user to put it. Instead I bundle my data jars within yet another jar, and unpack them at boot. The data jars are then added to my classpath *after* any specified mod dir, and we have our correctly prioritied loading scheme. Running as a standalone app would work the same, except I can unpack the jars at install time.
Sorted. What would have been well over a months work in C++ (at least) is reduced to a single weekends worth by using lots of built-in Java features.
This isn't entirely true. There's a very nifty free library called PhysFS which does exactly all of this. It uses standard zip-files, and you can prioritize the loading order. It's also extremely easy to use.