User Tools

Site Tools


tutorials:mapping:self_referencing_sectors

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tutorials:mapping:self_referencing_sectors [2025/08/03 02:56] fe80:5ac6:68e8:33c9:f1ab:a4ed:ace9:447btutorials:mapping:self_referencing_sectors [2025/08/04 20:44] (current) fe80:5ac6:68e8:33c9:f1ab:a4ed:ace9:447b
Line 1: Line 1:
 =====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.+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 (based on the line’s direction in the editor), 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... \\  But! If you have the outide of the line reference the interior sector as well, you get fun things. Things like... \\ 
 ;#; ;#;
Line 23: Line 23:
 {{:tutorials:mapping:srs3.png?400|}} {{:tutorials:mapping:srs3.png?400|}}
 ;#; ;#;
-Notice how the "Sector Indexfields both say "24(the bridge sector). +Notice how both 'Sector Indexfields are set to '24(the bridge sector). This tricks Doom’s renderer into skipping the floor and ceiling, making the bridge 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.
-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 (because you're confusing how this should be assigned by pointing it in the wrong direction). So force the game to trim it down by manually cutting in a sector around the bridge.+You might have noticed that the sector encompassing the bridge is pretty tight against it. There's a good reason for that. Doom’s BSP system splits sectors into subsectors and assigns them the sector index of the nearest linedef’s referenced sector. With self-referencing sectors, this can make the bridge’s properties (like heightbleed into surrounding subsectors, making it seem wider than intended. So, tightly surround the bridge with another sector to limit this.
  
 For another example of what you can do with self referencing sectors: For another example of what you can do with self referencing sectors:
Line 33: Line 32:
 ;#; ;#;
 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. 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'best to keep it above camera height+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 (hall of mirrors effect) as the player'view goes beneath the rendered floor.
 For this one I didn't cut around the sector, so you can see the issue with it assigning subsectors sector indexes. For this one I didn't cut around the sector, so you can see the issue with it assigning subsectors sector indexes.
 ;#; ;#;
 {{:tutorials:mapping:srs2.png?400|}} {{:tutorials:mapping:srs2.png?400|}}
 ;#; ;#;
-The sector is 28 (dark blue), and the highlighted corners SHOULD be 21. But because we fucked around we're finding out that they're assigned 28, and are thus also deep-water. So in practice you should surround your bridges/deep water with another sector.+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.+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: Here's the wad I ended up with:
 {{ :tutorials:mapping:bodybridge.zip |}} {{ :tutorials:mapping:bodybridge.zip |}}
tutorials/mapping/self_referencing_sectors.1754189789.txt.gz · Last modified: 2025/08/03 02:56 by fe80:5ac6:68e8:33c9:f1ab:a4ed:ace9:447b