This is the thread in which the modding community shall establish the guidelines for mod loading and organization, to be implemented in (one of) the next versions of DoomRL. It is a follow-up to the related IRC discussion, placed here by KK's request for further refinement and future reference.
Following are my general ideas on how it should work. The community is to add/modify/remove on them.
When the game is launched, a "Modifications" entry would appear in the main menu. When selected, the game would scan the "mods" directory for *.zip, *.pk3 or *.wad files. Those of the files which contain a mod would be displayed in the menu. This can be achieved by having a meta.txt file in the root of the archives, containing:
- The mod title;
- The mod author's name, as well as additional credits;
- A one-paragraph description;
- The name of the main mod file (usually "main.lua", but could be anything);
- The mod's version;
- The DoomRL version for which the mod is intended;
- A software license under which the mod is released;
- The mod type ("EP" or "TC", see below).
The mod menu will look much like the challenge select screen, with mod titles on the left and the description, the credits, the mod version and the DoomRL version of the selected mod on the right.
Once a mod is selected, the game will check if its version is the same as the mod's intended version. If not, a warning will be displayed, among the lines of "This mod is intended for a different version of DoomRL. It might work, but could crash or have bugs that will make it unplayable. Do you wish to run it anyway? (y/n)"
If the mod is an "episode" type (i.e., running on top of DoomRL without the need of a custom doomrl.wad), then it would simply load and run as normal, presenting the difficulty selection and trait selection screens.
If the mod is a "total conversion" (i.e., requires its own custom doomrl.wad to run), then selecting it would reload the game and get to the title screen.
A mod can also be run by supplying the "-mod filename.wad" switch on the command line. In such case the game will act as if the mod was selected from the modifications menu. Note that since all the mods are placed in a single directory, there is no need to supply a pathname on the command line.
Mod makers would (obviously) be required to package their mods appropriately.
As most mods are expected to have more than one file, there would need to be a core.include(str path, bool packaged_mod) directive or similar to replace lua's dofile() directive. The core.include would look for files relatively to the mod package, not the DoomRL directory, allowing mod makers to not worry about predicting where their mods will be placed.
If the mod contains sound.lua, music.lua and/or musicmp3.lua, those files will be parsed as well, replacing the default files.
Optional: A mod server in the form of a simple web page listing the mods by their meta attributes with download links and instructions to put the files into their "mods" directory without unpacking.
If When this makes it into the game, my
Mod Loader Script will be obsolete (which is a good thing).
Things that still need to be covered: TC making. Should the mod include the recompiled doomrl.wad or a directory with the contents of such? Will doomrl.wad be available for modders along with modification and packaging tools? Should the mod file internal directory structure replicate the structure of doomrl.wad (which i know nothing about)? Should non-TC mods follow that structure as well, for uniformity's sake?
Things to look into while we're at it: the
modding wishlist.