Mod development

This page is under construction. It’s just a start. Feel free to add any related info.

This page provides instructions for mods that are forked from the ET: Legacy mod and that use the ET: Legacy client.

Mac OS X

Back story

In Wolfenstein: Enemy Territory, instead of the qagame, cgame, and ui libraries being interpreted by the idTech3 VM, they are directly loaded by the OS into the game’s executable memory. In the official W:ET releases on OS X, these libraries were compiled as ".bundle" packages; that is, they were a folder (such as qagame.bundle) which contained a Mac-specific hierarchy of files, including the library’s binary.

The bundle format was used because the bundle could be loaded and unloaded dynamically, and the address space used by the library was reclaimed when the bundle was unloaded. In older releases of OS X before OS X 10.5 (which didn’t even exist at the time W:ET was released), the traditional single-file dynamic library could not be unloaded which meant if a player switched from one mod to another without quitting the game, the old mod would have still been loaded in memory.

Because the idTech3 code in W:ET relied on the qagame, cgame, and ui libraries being single files, and the requirements on OS X at the time necessitated using a bundle package, the developers zipped the package and renamed them (eg, qagame_mac) so they were single files. This is what the extra build-time scripts do in the official W:ET SDK from splash damage: They build the bundle packages, zip them, and rename them so that they’re still single files.

Now that OS X Tiger is extinct, however, using a bundle package is no longer necessary, as single-file dynamic libraries behave exactly the same.

Changes in ET: Legacy

To make the build process simpler, ET: Legacy supports both single-file dynamic libraries and the older zipped-bundle-packages. This makes it a little easier for mod developers to support OS X, because they no longer need to have a post-build script which will create and zip the bundle package, and instead only have to deal with single file just like on every other platform. The library itself can be compiled as either a Mach-O dynamic library or Mach-O bundle (without the package). Either will work.

See also