Using an IWAD as a resource WAD
Brought to you by:
e6y
Hi,
it should be possible to use e.g. doom1.wad as a resource for a doom2 IWAD, e.g. freedoom.
When run via "prboom-plus -iwad freedoom.wad -file doom1.wad" I am greeted with doom1.wad's title screen and then prboom-plus crashes. I have to add another Doom 2 PWAD to the "-file" parameter for it to work, e.g. "prboom-plus -iwad freedoom.wad -file doom1.wad av.wad". However, I think the former case should work, too, replacing everything from freedoom.wad that is also present in doom1.wad.
The issue is discussed here:
http://www.doomworld.com/vb/source-ports/62754-using-doom1-wad-shareware-doom-as-a-resource-pwad/
- Fabian
BTW, the other way round, i.e. "prboom+ -iwad doom1.wad -file freedoom.wad" seems to work fine. I can play the shareware episode with all content replaced by freedoom's.
Hm, I think the whole issue boils down to: "Never consider a WAD passed to the -file parameter as an IWAD."
What do you think?
> "Never consider a WAD passed to the -file parameter as an IWAD."
Na, it's not that easy. I just turned DOOM.WAD forcefully into a PWAD by changing its first byte to 'P', but it still does not work as expected. :/
> Na, it's not that easy. I just turned DOOM.WAD forcefully into a PWAD by
> changing its first byte to 'P', but it still does not work as expected. :/
Turns out it has to do with incompatible TEXTURE1 and TEXTURE2 lumps (and PNAMES) between Doom 2 and Shareware Doom.
Alright, I got it: We simply need to prevent PWADs from overriding the IWAD's TEXTURE1 and PNAMES lumps. I tried the attached patch/hack with the following command "prboom-plus -iwad freedoom -file doom1" and it worked as expected: It runs Freedoom and each patch/sprite/whatever got replaced by the version in doom1.wad; lumps not present in the shareware WAD were taken from the Freedoom WAD instead.
I know, the patch is just a hack and it would be better to introduce cummulative TEXTURE1 and PNAMES lumps, but it does its job at least for the requested use case.
Prevent PWADs from overriding the IWAD's TEXTURE1 and PNAMES lumps
Check if the resource PWAD is really an IWAD, simplified lump name check
*Friendly Weekly Patch Reminder [tm]* ;)
Does this have a chance? If not, what's missing?
Next patch revision: Instead of skipping the lumps in question, simply rename them so they are ignored by the game. This way, the patch works independently of the order in which the resource IWAD, e.g. doom1.wad, and additional PWADS are loaded on the commend line.
Rename the affected lumps instead of skipping them
Are there any known issues with the latest patch?
None that I have found yet. The only theoretical issue occurs if you include another PWAD that intentionally ships a lump called "-IGNORE-".
i don't believe that the such small patch could fix the issue :)
Please, try the patch and see for yourself that it works. ;)
There is another possible issue:
Because of the !strncmp() test, the code does not work for IWADs that do not declare themselves as such. TTBOMK this does only affect DOOM.WAD and DOOM2.WAD from the Doom 3 BFG Edition and CHEX.WAD. The latter has never been intended to be a full replacement IWAD, e.g. it is missing sprites for most of the higher monsters. And owners of the former do already have both full games and most probably don't need that code anyway. We could also drop that test, but I am not sure if there aren't any PWADs out there that purposely contain full replacements for the TEXTURE1 and PNAMES lumps?
cough
i can't check it right now, sorry. probably within next week