Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Ferk

Standard way to define IWAD and extra WAD files to load for a given WAD?

Recommended Posts

I'm looking for the best way to integrate a method to autoload the IWAD and any related extra PWADs in the libretro PrBoom source port.

 

At the moment this source port is using the IWAD searching that was already in PrBoom (which simply looks for the first filename that matches a list of known IWAD names), except that I extended it so it looks also into parent folders if there's no iwad in the same folder as the PWAD. This way you can use a folder structure to place and organize your PWADs in such a way that the right IWAD is found every time (having, for example /Doom2/doom2.wad in a different folder than /UDoom/doom.wad so that /UDoom/mypwad/mypwad.wad will always load using Ultimate Doom and not Doom2).

 

I've also made it automatically load any *.deh files that match the same name of the WAD (so batman.deh will be automatically loaded when opening batman.wad).

 

I'm thinking now about making it automatically load any additional wad that starts with the same name + dot (so if you open original.wad from WolfenDoom, it'll also load  "original.orig15.wad" with extra prboom stuff, or any other wads you place starting with "original.")

 

However... I'm not sure if this is the best approach. It'd certainly be great if there was some standard way to define which IWAD a PWAD uses, and which WADs might be recommended.

I was looking at ZDL and its *.zdl files, but it has way too much unnecessary additional stuff (such as configuration on network games) and it assumes that an IWAD has been previously defined in ZDL with a specific full name, which makes it hard to locate the IWAD on disk (I just want a filename).

Are there any other attempts at this? Is any source port using a method that can be more reusable and doesn't add too much complexity?

 

One thing that would be great is if there was a lump that could be used to at least know which IWAD was the PWAD made for.

Edited by Ferk

Share this post


Link to post

There really isn't. The best you can do is some heuristics. For example, Hexen-format maps always contain a BEHAVIOR lump.

 

The rest would really depend on checking multiple, various files for lumps. For example, maps in the ExMy format will definitely denote Doom/Ultimate Doom... but you'd need to distinguish it from Heretic, which also uses that format. So you'd need some secondary lump... easy for IWADs, but many PWADs are purely levels.

 

Probably about the safest way to guess it purely off levels (no textures or anything) would be to parse the THINGS lump, with a known set of known Things to compare against. That said, this itself is no guarantee - the easiest things to pick would be stuff that's guaranteed to be in the map, but most of those are stuff like player starts (and those are universal across all ports - save for Hexen's extra ones), or teleport landings (ditto). You'd basically have to check for multiple types of Things by DoomEd numbers to have a reasonable guess.

 

If you think this is a solid approach, this page on Doom Wiki should help. 

Share this post


Link to post

There is indeed no standard.

On 3/17/2019 at 12:58 PM, Ferk said:

One thing that would be great is if there was a lump that could be used to at least know which IWAD was the PWAD made for.

 

You could implement ZDoom's GAMEINFO lump for that. If more ports supported the same way to define an IWAD to use it could become a standard eventually. If everybody did their own thing, not so much...

 

Share this post


Link to post

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
×