Check for D2 IWAD before D1

Moderator: GZDoom Developers

User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Check for D2 IWAD before D1

Post by Matt »

Right now the filters are broken against WadSmoosh since it gets a positive for E1M1, etc. and is confirmed before anything else, so any IWAD containing data for both gets treated as E1 - breaking one of the most common uses of the filter when distinguishing D1 and D2 (to get around the lack of certain resources found only in D2).

I see the following note:

Code: Select all

// Doom 2 must be last to be checked becaude MAP01 is its only requirement
Is this really true, though? Can't all the D2 IWAD checks be done before the D1 ones? Especially given the shareware D1 has just as little distinct about it as D2:

Code: Select all

MustContain = "E1M1"
User avatar
Rachael
Posts: 13967
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Check for D2 IWAD before D1

Post by Rachael »

I am not understanding really exactly what breaks. Would you care to elaborate a little bit on what the problems are with detecting it as Doom 1? What mods are breaking?
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Check for D2 IWAD before D1

Post by wildweasel »

Eruanna wrote:I am not understanding really exactly what breaks. Would you care to elaborate a little bit on what the problems are with detecting it as Doom 1? What mods are breaking?
It's more the nature of what said mods do with the filter folders, honestly; Kinsie has offered me some code that is friendlier to WadSmoosh to use in place of lump filtering. The specific case I cited in the WadSmoosh thread is that Mixed Tape Vol.3's super shotgun replacement, the M1 Garand, has ammo spawns that randomly replace shotgun shells in Doom 2, but since the weapon does not appear in Doom 1, I'd used lump filtering so that the ammo for it does not spawn in Doom 1 maps. WadSmoosh gets detected as Doom 1, though, meaning that playing Doom 2 or Final Doom maps via WadSmoosh with Mixed3 loaded means you will never find ammo for the Garand.

Granted, Kinsie's code (an ACS script that detects the first character of the lumpname of the map being played) or perhaps another approach entirely (having the ammo spawners detect if there is a Garand either in the player's inventory, or in the map, before choosing whether to spawn shells or .30-06) would probably be a better solution for this...but I can't be certain what other things might break in regards to the lump filtering. Considering the only mods I know that used such a system are Mixed3 and MetaDoom (MetaDoom now uses the aforementioned ACS script instead)...
User avatar
Rachael
Posts: 13967
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Check for D2 IWAD before D1

Post by Rachael »

How about just giving WadSmoosh its own special entry?

To me, that seems a lot more ideal than trying to fudge around with the lump detection that's already in place, which I think is going to cause a lot more problems than it will solve.

Which leaves the question - does WadSmoosh IWAD have any special lumps that are unique to it? If not, can one be made for identification purposes? I'll do a pull request for that.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Check for D2 IWAD before D1

Post by Graf Zahl »

wildweasel wrote:
Eruanna wrote:I am not understanding really exactly what breaks. Would you care to elaborate a little bit on what the problems are with detecting it as Doom 1? What mods are breaking?
It's more the nature of what said mods do with the filter folders, honestly; Kinsie has offered me some code that is friendlier to WadSmoosh to use in place of lump filtering. The specific case I cited in the WadSmoosh thread is that Mixed Tape Vol.3's super shotgun replacement, the M1 Garand, has ammo spawns that randomly replace shotgun shells in Doom 2, but since the weapon does not appear in Doom 1, I'd used lump filtering so that the ammo for it does not spawn in Doom 1 maps. WadSmoosh gets detected as Doom 1, though, meaning that playing Doom 2 or Final Doom maps via WadSmoosh with Mixed3 loaded means you will never find ammo for the Garand.

Granted, Kinsie's code (an ACS script that detects the first character of the lumpname of the map being played) or perhaps another approach entirely (having the ammo spawners detect if there is a Garand either in the player's inventory, or in the map, before choosing whether to spawn shells or .30-06) would probably be a better solution for this...but I can't be certain what other things might break in regards to the lump filtering. Considering the only mods I know that used such a system are Mixed3 and MetaDoom (MetaDoom now uses the aforementioned ACS script instead)...
In other words: Instead of fixing the detection code, let's muck up the engine. No, thank you!
User avatar
Rachael
Posts: 13967
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Check for D2 IWAD before D1

Post by Rachael »

If JPL will make a special lump like WADSMUSH that ZDoom can reliably detect, I will pull request this in. It will not detect as either Doom1 or Doom2, just as "doom.wadsmoosh" for filter purposes.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Check for D2 IWAD before D1

Post by Graf Zahl »

I think it needs to be done as 'doom.doom2.wadsmoosh' so that it inherits Doom2's autoloads and other filters.
User avatar
Rachael
Posts: 13967
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Check for D2 IWAD before D1

Post by Rachael »

That can be done, too.
User avatar
Rachael
Posts: 13967
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Check for D2 IWAD before D1

Post by Rachael »

https://github.com/coelckers/gzdoom/pull/184 - Done - requires an empty "wadsmush" lump to be placed into doom_complete.pk3 for proper detection. That's something JPL will have to do.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Check for D2 IWAD before D1

Post by wildweasel »

WadSmoosh already generates an identification lump - it's called SMOOSHED.txt in the root of the generated Doom_Complete.pk3.
User avatar
Rachael
Posts: 13967
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Check for D2 IWAD before D1

Post by Rachael »

Alright, that will do. I'll change the pull request, then. (Done)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Check for D2 IWAD before D1

Post by Graf Zahl »

Sorry, but that's not good enough. Add a few more lumps to check, preferably some that never occur at the same time in the same IWAD like MAP01 and E1M1 and move it down the list. A single texture named SMOOSHED would break this.
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: Check for D2 IWAD before D1

Post by wildweasel »

Would checking for the hash of the lump work? The Smooshed lump does have text content containing a short description and URL to the WadSmoosh page.
User avatar
Rachael
Posts: 13967
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Check for D2 IWAD before D1

Post by Rachael »

Graf Zahl wrote:Sorry, but that's not good enough. Add a few more lumps to check, preferably some that never occur at the same time in the same IWAD like MAP01 and E1M1 and move it down the list. A single texture named SMOOSHED would break this.
The problem here is - that both MAP01 and E1M1 are optional, which itself will break detection if those are added. I suppose there's no real point to run WadSmoosh without Doom1/2, but yet it can still be done. Assuming those do get tossed into the resulting pk3, how far down the list should it go? Also - how many IWADs (not PWADs) do you know of that really use the smooshed lump? :)
wildweasel wrote:Would checking for the hash of the lump work? The Smooshed lump does have text content containing a short description and URL to the WadSmoosh page.
That is conceptually possible but in practice will require a bit of effort, adding in the hash check to the IWAD detection code, itself, plus updating the definition parser to handle it.
Last edited by Rachael on Wed Jan 04, 2017 12:30 pm, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Check for D2 IWAD before D1

Post by Graf Zahl »

Eruanna wrote:The problem here is - that both MAP01 and E1M1 are optional, which itself will break detection if those are added. I suppose there's no real point to run WadSmoosh without Doom1/2, but yet it can still be done. Assuming those do get tossed into the resulting pk3, how far down the list should it go?
As far as possible. But I guess when both E1M1 and MAP01 are optional there is no truly reliable detection if someone makes a custom Doom IWAD with a SMOOSHED texture.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”