Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Making it modable

Sign in to follow this  


One of the things I've always kept in mind is making the shooter mod-able, primarily allowing people to add new levels but also to add new enemies and attack patterns. The first part was my revised resource loading and build process mentioned earlier. Recently I've been working on making the actual deployment suitable so people can modify and add files.

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.
Sign in to follow this  


Recommended Comments

Original post by OrangyTang
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.

Share this comment

Link to comment
Quite possibly, but that doesn't give me all the neat features that webstart does (single click launch, auto update, lazy downloading). And I could probably try and find another library to do that, but then it might not play well with the resource manager.

Ok, I'm being picky here but my general point is using existing libraries == good. And the large range of libraries (which play nice with each other) available 'out of the box' in Java is often overlooked.

Share this comment

Link to comment
Guest Anonymous Poster



Would you be so kind as to contact me on cr@acu.dk

We are an educational support institution and would like to develop a mod on Q3 Arena to simulate battle in WW I trenchwarfare for school children as part of a History theme.

From your thread it would seem that you might give us some pointers as to how to go about the modding process.

Kind regards

Christiaan Roos

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!