Jump to content

PSX Doom discovery - mysterious sector flags


Recommended Posts

Creating this thread to document and publish some strange stuff I ran into recently for PSX Doom, which was discussed on the GEC Team Discord server. Maybe somebody else has noticed this before, not sure, but I'll throw it out there anyway... Perhaps some of you might know something or have an idea :)

 

In PSX Doom sectors have a new field added for flags, similar to the flags field already present for linedefs and things. In the retail game just 1 bit (the lowest bit) of this 16-bit field is used, and it controls whether a sector uses reverb for its sound effects or not. Typically this is used to disable reverb in outdoor areas, when set. No other bits of the flags field are used in the retail machine code, as far as we can tell.

 

For PsyDoom and upcoming versions of the GEC Master Edition we decided to repurpose one of these unused bits (the next one up, 0x2) to achieve a new effect similar to self referencing sectors on the PC. The new flag would enable 'invisible' floors, by making a floor render at the height of the lowest sector surrounding it. This would allow maps from say Plutonia, to be converted more faithfully to the PSX engine and enable invisible bridges like this one:

 

Spoiler

Untitled.jpg.67ce3923341fd045884d55be9c121f7b.jpg

 

So this idea worked great initially, until I started testing some maps from the original game, and noticed things like this:

Spoiler

Untitled.jpg.e05764ce2b449998d96024a1c319551c.jpgUntitled.jpg.91b56783fd7315aa67ff3e5796ddc55f.jpg

 

Oh no - the new invisible floor trick is being applied where we don't want it! So it turns out that some of the sectors in the original game were already using this flag (0x2) for some reason. To investigate further, I did a quick pass through both Doom and Final Doom and found it used in the following maps:

Doom map usages (flag 0x2):
    04, 05, 06, 07, 10, 14, 18, 21, 23, 28,
    29, 33, 34, 35, 39, 41, 44, 45, 46, 47,
    49, 50, 54, 55, 57, 58, 59

Final Doom map usages (flag 0x2):
    06, 07, 08, 14, 15, 17, 18, 19, 20, 23,
    24, 25, 26, 27, 28

 

Next, I thought well why not try the next bit up for the new flag we want to add, 0x4. Sure enough I found sector flag 0x4 used in the following maps in both Doom and Final Doom:

Doom map usages (flag 0x4):
    04, 05, 06, 07, 09, 10, 14, 18, 19, 27,
    28, 29, 30, 33, 34, 35, 39, 41, 44, 45,
    46, 47, 50, 54, 55, 57, 58, 59

Final Doom map usages (flag 0x4):
    03, 06, 08, 14, 15, 17, 18, 19, 20, 23,
    24, 25, 26, 27, 28, 29

 

So I kept repeating this experiment and searching for a single bit (out of the 16 available) in the flags field which WASN'T already in use in either Doom or Final Doom. Turns out every single bit in the flags field has at least one usage in either Doom or Final Doom.

 

Perplexed by this, I applied a very quick hack to PsyDoom's Vulkan renderer to help visualize when these mystery sector flags are used. The hack colors sector floors and walls in a solid color, based on which flag bits are set. Here are some screenshots from various different maps showing where the mystery sector flags are used:
 

Spoiler

 

Untitled.jpg.087acfadbbce5ec08543283f26682b5d.jpgUntitled.jpg.119f7f9ab82a7d505a666cb1be3548f0.jpg

Untitled.jpg.695f2186f83fad3314ffe419c357b35a.jpgUntitled.jpg.9045957cfdc153863acabe60a06efdb3.jpg

Untitled.jpg.806031d365b00cdd0b9be2dc259e3564.jpgUntitled.jpg.bc3399f52f2c7b9e6f05551d8025cff9.jpg

Untitled.jpg.b0fd899c73e432490093b15332232ae0.jpgUntitled.jpg.7ac316ad20ea9b7d6531443c5af70d8b.jpg

Untitled.jpg.f00cce2ea8580375cd00b471f8e3f425.jpgUntitled.jpg.062c5c8ac16f4ad0785d69ae94cbccea.jpg

Untitled.jpg.5d5a67cc130e5d79c3826e3cd0c415a4.jpgUntitled.jpg.2a227a933b1eaddfd1880af0dc275ffe.jpg

Untitled.jpg.38fd00f15361805fee15d7030252f25d.jpgUntitled.jpg.54031a35ad6819cf9edefd15ec4bc7f5.jpg

Untitled.jpg.2c9f272496276a507bc936e5f38c1df9.jpgUntitled.jpg.6214f323e356d17263a6601741374fee.jpg

Untitled.jpg.f94a1b96d6284d21ff73da9e4eff9b32.jpg

 

 

Very very strange...

 

Some patterns I've noticed with these flags, is that they tend to be used a lot around key doors or keys but that's not always the case. For example in the "Unruly Evil" screenshot the torch light sector has the mystery flags set for some reason. "Club Doom" also has the flags set all over the place.

 

Initially I thought the flags might have been some leftover from a feature that was abandoned earlier in development. Seeing that these flags were carried over to Final Doom and apparently very deliberately set throughout the maps makes me think otherwise, however.

 

At a high level it seems like these flags might have been used for development purposes, but it's unclear exactly what their use was. Some ideas I had was that they were used for some sort of editor tagging functionality, or perhaps to offer hints to the nodebuilder on how to split up the map. It's also possible different bits of the flags field might have had very different purposes - which might further confuse the matter.

 

Anyhow, that's a quick overview of what I ran into. A little bit of a mystery that maybe we'll never solve, but interesting nonetheless. Feel free to comment if you have any interesting theories! And of course if you want to play around with this visualization hack for PsyDoom and explore further, the code is here:

https://github.com/BodbDearg/PsyDoom/blob/f7c35c4304913e40119ad4d48de9c3c0d7e5aeba/extras/psydoom_code_hacks/view_unknown_psx_sector_flags_hack.diff

Share this post


Link to post

Some of the PSX Doom devs have been around a few times, notably Tim Heydelaar (@Hyde) so perhaps if they're still around, they could perhaps help shed light on these mysterious flags.

Share this post


Link to post
19 hours ago, Gez said:

Some of the PSX Doom devs have been around a few times, notably Tim Heydelaar (@Hyde) so perhaps if they're still around, they could perhaps help shed light on these mysterious flags.

I'd mentioned Tim in the GEC discord myself, but he hasn't been here in a good 1 1/2 years.

 

But if anyone would know, it'd be him or Randy Estrella.

Share this post


Link to post
On 5/10/2021 at 7:38 AM, Gez said:

so perhaps if they're still around, they could perhaps help shed light on these mysterious flags.

 

I wouldn't be too optimistic, at least through Doomworld.

image.png.499a5c3f4eeeb917f865f53c3e4bf39a.png

Share this post


Link to post

Hmm, I've always wondered why quite a few of these sectors (but not all of them) had their reverb effects missing when playing PSX Doom throughout the years, specifically the colored light key areas from the Jaguar port.

 

Theory time, one thing in common of most of the sectors pictured are that they were newly created for the PSX port from their original levels. Most of them were done for colored lighting purposes around the doors and keys, but I find the one in the yellow key room of Map07 to be rather interesting. In the original Jaguar port that enclosure in the center of the room had completely solid walls, but the PSX Doom team went back and made it more like the PC original by putting the gap in the bottom of the wall. Also in Unruly Evil that torch light sector was newly created for the PSX port, the original map has the whole room as one sector. A lot of these sectors also have different lighting levels from their surrounding sectors as well to blend the colored lighting better, as evidenced from playing Saturn Doom which has no colored lighting to better detail the difference (Hey, I had to mention Saturn Doom at least once, right? :P).

 

Spoiler

1772692290_satdoom.2021-05-1110_38_32.png.26cb21eaba6380d4a95bf1e341afdfce.png

 

1654434767_satdoom.2021-05-1110_42_38.png.3b25c0d75843261a0b010e8fba1f516a.png

 

788771193_satdoom.2021-05-1110_43_07.png.3d53e9cca8569fb6cb6fc56f3227e1e7.png

 

31399134_satdoom.2021-05-1110_44_04.png.c6b673d97894c6b46de23239083cd419.png

 

1116466150_satdoom.2021-05-1110_50_36.png.2be40537922122541e53d2bf55b61e35.png

 

This of course doesn't explain why the flags are used in the PSX exclusive levels though, plus for sectors that were clearly edited from their originals that don't have the flags set (Like the secret area with the yellow key door in E1M3). Perhaps it could have something to do with the lighting in some way?

Share this post


Link to post
On 5/10/2021 at 11:07 PM, Dark Pulse said:

I'd mentioned Tim in the GEC discord myself, but he hasn't been here in a good 1 1/2 years.

 

But if anyone would know, it'd be him or Randy Estrella.

 

Yeah who knows, maybe we'll get lucky and he might pop on at some point to explain - assuming he can recall that is... (it was a long time ago at this point)

 

On 5/11/2021 at 9:03 AM, Mattfrie1 said:

This of course doesn't explain why the flags are used in the PSX exclusive levels though, plus for sectors that were clearly edited from their originals that don't have the flags set (Like the secret area with the yellow key door in E1M3). Perhaps it could have something to do with the lighting in some way?

 

Yeah something lighting related was one of the theories we discussed on the GEC Discord. There doesn't seem to be any definitive connection however between lighting and the appearance of the flags from what I can tell, or at least no consistent one. It does seem to occur a lot around key doors though, which often have colored lighting applied as a hint. What a strange mystery...

 

Another (less interesting) theory might be that we are just looking at junk data which was not properly initialized. Maybe whatever editing tools were used just initialized that single bit that was used (for reverb) and the rest of the bits were left as garbage/undefined values. Perhaps the tools to import maps from the PC also tended to cleanly initialize/define the flags field to '0' so the garbage mainly occurred in new sectors that were edited after that?

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...