User Tools

Site Tools


tutorials:mapping:self_referencing_sectors

Self Referencing Sectors

Normally, when you have a sector inside another sector, the lines that make up the interior sector reference both sectors. The outside sector is referenced by the front or back of the lines (depending on which way you have the normals flipped), and the other side references the interior sector itself. But! If you have the outide of the line reference the interior sector as well, you get fun things. Things like…

Do you dare cross the corpse bridge?

Invisible sectors! Both the front and back of the sector's lines that make up this corpse bridge are referencing the interior sector index. And it makes the bridge sector invisible. The outside sector index is 3, and the inside is 24. Like so:

Sector 3's floor height is at -320, and Sector 24's is at 0. Normally, for the lines that make up the bridge sector (highlited in green), the referenced sector indexes would like like this (in the Edit Linedef panel):

But I made them look like this:

Notice how the “Sector Index” fields both say “24” (the bridge sector). Now the bridge is invisible. I just dumped some bodies on top to make it a corpse bridge. You can't walk under the bodies, of course, but the effect is nice.

You might have noticed that the sector encompassing the bridge is pretty tight against it. There's a good reason for that. Due to how Doom cuts up Sectors into Subsectors, and assigns those subsectors a sector index from an encompassing sector, you could end up with a bridge that is wider than you want it (you're altering the assignment of those subsectors, so they think they they should be with the bridge sector. So force the game to trim it down by manually cutting in a sector around the bridge.

For another example of what you can do with self referencing sectors:

Deep water! Or blood. This effect is more subtle, but in-game it's noticeable. Especially if you put a lowered tunnel above the deep-water to sell the effect. Opposite of the bridge, lower this sector down instead of raising it up, and have the lines that make it up reference the lowered sector on both sides. If you lower it too low you'll get rendering issues, so it's best to keep the water-line above camera height. For this one I didn't cut around the sector, so you can see the issue with it assigning subsectors sector indexes.

The sector is 28 (dark blue), and the highlighted corners SHOULD be 21. But because we fucked around we're finding out that the corners are assigned 28, and are thus also deep-water. So in practice you should surround your bridges/deep water with another sector.

That's it. Basic self referencing sectors. Hopefully this all made sense. They're a little tricky, but neat if you want a fun effect. And they can be used in conjunction with instantly-moving-floors and mid-textures to make bridges that you can pass over/under. But that's for another time.

Here's the wad I ended up with: bodybridge.zip

tutorials/mapping/self_referencing_sectors.txt · Last modified: 2025/08/03 03:12 by fe80:5ac6:68e8:33c9:f1ab:a4ed:ace9:447b