Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Koko Ricky

How the hell do you make a self referencing sector?

Recommended Posts

I keep reading about this as a method for creating fun effects like deep water and bridges. But if I draw a sector within an existing sector, Doom Builder 2 merely interprets it as me drawing over the original sector and fails to create a new one. What am I doing wrong? Also, why are some sectors white and some grey, and is this related to my issue?

Share this post


Link to post

The trick is to edit the linedefs that surround the sector, giving both front and back sides that sector's number. Sometimes it helps to leave both sides of the linedefs untextured - here's another example, the gallows in Gothic DM Map31

GoatLord said:

Also, why are some sectors white and some grey, and is this related to my issue?

Don't know, might help if we saw what you have.

Share this post


Link to post

I'll disregard the white lines/grey lines effect, as it doesn't appear to be relevant at the moment. I've looked at both maps in Doom Builder 2. The first one isn't clear to me. I don't know what it is that's causing the deep water effect, which looks buggy in Zdoom when I load it (the player and other sprites aren't clipped by the water, I'm assuming they're supposed to be). The second example doesn't seem to involve anything other than middle textures. I'm really confused here. I've been mapping for about a year and I feel like I should understand all of this better.

Share this post


Link to post

What are you trying to use the self-referencing sector for? Typically they are used for vanilla style bridges and elevating things in the air and sometimes additional collision.

Share this post


Link to post

As simple as I can explain it:

1: Draw a sector.
2: Draw the self-referencing sector inside that sector and set the ceiling/floor heights as desired. The player will be able to walk on the floor level of this sector, or underneath the ceiling level of this sector.(note: this trick doesn't seem to work if the sector has different sectors within it.)
3:Go to the sector properties and take note of the self-referencing sector's sector number.
4: Select all the linedefs that make up the self-referencing sector.
5: Go to the sidedefs tab.
6: In the boxes labeled "Sector Index:", input the self-referencing sector's sector number.
7: Test the result.

Share this post


Link to post

The doom wiki actually has an article about making self referencing sectors but its been pretty lousy and I've been wanting to revise the whole thing and start it from scratch, by defining what a self referencing sector is, what the engine is trying to do, and how the effect can be utilized in map editing.

I used a few self referencing sectors in uac ultra in map06, but that was only after following exact directions, at the time I had no idea what I was doing.

So I'm gonna post the most detailed, basic, and informative body of text, based on what I know and my understanding of self referencing sectors in hopes of simply copying and pasting it bit by bit into the doom wiki. And of course anyone could step up to make any amendments or additions to my explanation here is they wish.

A self referencing sector, by definition, is a sector in which all its sidedefs are referring to the sector's sector id. A sector is made up of linedefs, and each linedef can have one or two sidedefs. Each sidedef has a sector reference, a number indicated by the sector id number of the sector its directly touching. In most map editors, If a sector is drawn within another sector and made entirely with two-sided lines (meaning no line in the inner sector making contact with void space) the properties of the sidedefs can be edited so that both opposing sides of the linedefs are assigned to be attached to one sector. This causes a glitch in the engine in which the walls of the sector, textured or not, are. Unable to be rendered. The floors and ceiling are detached from the surrounding sector and are unable to be rendered as well. The surrounding sectors ceiling and floor bleeds through the shape of the unrendered self-referencing sector, creating the illusion of a sector in which its physical properties are present, but visually is completely invisible.

The self-referencing sector can be interacted with just as normally as any other sector. things can stand on it, walk over it, bump into it, shoot it, etc. The self-referencing sector's "invisible" characteristic is
What makes it able to produce unique effects.

This is an effect exploited by level designers to create unusual environments. For example, if the self referencing sector's floor height is raised higher than the surrounding sector, the things placed on it will appear to be floating in midair. Such as the invisible bridge at the end of The Plutonia Experiment MAP02: Well of Souls. Another example is a self referencing sector shaped like a long thin wall with the ceiling lowered down to the floor simulating the effect of a transparent bulletproof window that can be seen through, but not able to be shot through. Self referencing sectors can utilize any of their sector properties, such as floor heights, ceiling heights, lighting, and sector effects to effect the things that can interact with it.

Self referencing sectors can have rendering problems depending on the nodebuilder used on the map and the source port used to play the map, especially source ports that support hardware rendering. This can cause the self referencing sectors to produce undesired visual errors. Some source ports such as Boom offer a transfer heights or transfer properties effect to simulate the desired results of a self referencing sector in a more efficient way that's less prone to errors between source ports.

How's that?

Share this post


Link to post

Just a quick tip: make sure the linedefs are facing inward. Took me waay too long to figure that out. :P

Share this post


Link to post

Also depends what engine/port you are using.

I recently figured out how to get do this, but then found it does not render correctly in Doomsday engine.....ATM anyway. I get HOM.

Share this post


Link to post

Goatlord: Is this for some of the maps you've discussed previously that (I think) were going to be limit removing/boom compatible?

If so you can use transfer heights (type 242).

Share this post


Link to post

Obligatory mention of the Doomworld vanilla editing tutorials.

Adding to what is already said about self-referencing sectors: you first draw everything as normal. When you're finished drawing, make note of the sector numbers of your layout. Then you need to edit the linedefs of the would-be self-referencing sector in such a way that both sides of the border linedefs refer back to only the self-referencing sector.

Say you have a part of your map consisting of sector with sector number 10. Inside, you've drawn a new square sector with number 11. If you want to make that new sector a self-referencing sector, go to linedef mode and edit the four linedefs of your new sector. You'll see that in the old situation, one of the sidedefs of one linedef refers back to sector 10 and one to sector 11. You'll need the one with '10', and put in number '11' instead. Now both sides refer back to the same sector 11. Do this for all four border linedefs, and now you've turned sector 11 into a self-referencing sector.

That means that due to the way the Doom engine works, its floor flat is 'overwritten' by the surrounding floor flat of sector 10. Which means, you appear to have an invisible sector. If you stand on it, you appear to be floating in air.

Share this post


Link to post
Mordeth said:

That means that due to the way the Doom engine works, its floor flat is 'overwritten' by the surrounding floor flat of sector 10. Which means, you appear to have an invisible sector. If you stand on it, you appear to be floating in air.


Do monsters things walk over this invisible sector or do they now better and its just an illusion for the player ?

Share this post


Link to post

Self referencing sectors are the same as any other sectors. The player can run on it, torches can stand on it, and monsters can walk on it (if there's any space for them to move.) Self referencing sectors only have the appearance of being invisible because the engine won't draw the walls on its side, and surrounding sectors floor or ceiling wraps over the void space that the sector would be covering up with its own floor/ceiling/wall textures if it weren't self referencing.

Share this post


Link to post

They do block sound, though. As in, if you shoot while inside a fully self-referenced sector, monsters won't hear your shot.

Share this post


Link to post

I figured it out after looking at a demo wad in about 5 minutes. Just sayin'.

Share this post


Link to post

Personally, unless I am editing for vanilla Doom, I wouldn't use self referencing sectors. Any modern Boom compatible port should have built-in editing features that allow any of the tricks made possible with self-referencing sectors. Because such features are purpose built for the task, I find that they are less likely to show the problems that can sometimes occur when using self referencing features.

Share this post


Link to post

I've been busy the last few days. I'm going to look over this thread a few times and see if I can implement something to test the effect soon. Thanks for the help.

Share this post


Link to post
TimeOfDeath said:

They do block sound, though. As in, if you shoot while inside a fully self-referenced sector, monsters won't hear your shot.


Oh yeah I forgot to mention that. I think its a little more in depth than that. In my experience, monsters couldn't see or hear me when I approached them as I was standing on the self referencing sector, even when they were set to deaf, where they would be able to see me from any angle. I guess as far as monsters hearing and sight are concerned, self referencing sectors are pretty much not even registered parts of the map. Kinda like when you have noclipping on and observe the monsters in a room from the outside as they are waiting to be awakened. You can't do anything to get their attention until you step into the map.

Share this post


Link to post
40oz said:

In my experience, monsters couldn't see or hear me when I approached them as I was standing on the self referencing sector, even when they were set to deaf, where they would be able to see me from any angle. .


Ok, slightly off topic, but think I just read something I didn't know. I thought 'deaf' just made them well...deaf, so you could fire behind them and they wouldn't know, but as soon as they see you, its attack mode time! However, are you saying the 'deaf' flag makes them see from any angle...or just a much higher angle of seeing....which again I still didn't know.

Share this post


Link to post

normal monster: chases you if they see you from the front or sides, or if they hear you shoot

deaf monster: chases you if they see you from the front or sides, or if they see you from any angle after they hear you shoot

In my experience, monsters couldn't see or hear me when I approached them as I was standing on the self referencing sector, even when they were set to deaf, where they would be able to see me from any angle.

I'm guessing they didn't hear you shoot yet and were facing away from you? I just did a test and they saw me when they were facing me. I assume the blocking sound thing is because there are no adjacent sectors according to the map data, since the sector references itself on all sides (probably also why you can't use floor lower to lowest etc with self ref sectors, but that and the no sound thing can be fixed with merged dummy sectors).

Share this post


Link to post

I've tried implementing this myself, and have examined selfred.wad again, and have reread a number of the posts. I still don't really understand what I'm doing and can't get either invisible platforms nor deep water effects to work. When I read the instructions, I understand fragments but not the whole picture.

Share this post


Link to post

Perhaps the terminology is not helping.

Each linedef can have _any_ sector on each side, or if it is one-sided then any sector on that side.

Hence you could have a map where every linedef has a unique sector on each side, but that is not really valid -- a proper "sector" is only formed when all the linedefs in a loop have the same sector on the same sides of the linedefs.

These tricks rely on linedefs which:
(1) have the same sector on both sides, and
(2) this sector is different from what it should be in that area of the map.

Because of (1), the DOOM renderer does not draw anything for these lines, except for middle textures like railings. So they are often invisible. But the player still does physics against those lines, hence if the fake sector has a lower floor than nearby stuff, the player will go lower and that creates the illusion of deep water. If the fake sector is higher than nearby stuff, the player appears to climb an invisible stair.

The way I make these things is similar to Mordeth's reply: create the fake sector as a small square off the side of the map, or below it, and then edit the sidedef information of the lines where you want to make the effect and change their sector numbers to match the number of the fake sector.

Share this post


Link to post

I successfully got a sector to reference one outside the map, but I don't know how to make a deep water effect.

Share this post


Link to post
GoatLord said:

I successfully got a sector to reference one outside the map, but I don't know how to make a deep water effect.


By deep water, do you mean ankle deep water, or jump in and swim deep water?

The ankle deep water is easy, just draw the "deep" sector within the water sector and lower it by however much you want. The trick is to leave the edges of the "deep" sector with no texture. This causes the flat of the water sector to bleed over the "deep" sector. Thus, it seems like you step into deep water.

Keep in mind that if the water goes above the player's head they will see the HOM effect of the untextured edges.

Share this post


Link to post
GoatLord said:

I successfully got a sector to reference one outside the map, but I don't know how to make a deep water effect.


deep water is stupid easy and can be done without having to edit sidedefs at all. If you create a water sector, with another sector bordering the inside of it by 1-8 map units, then lower the floor height of the inner sector to about 16 or 24 units lower, and leave the walls untextured, the deep water effect will be simulated. However, in software rendering, you'll still see the entire monster and item's sprite through the water. In OpenGL (on most ports i believe), the monsters or items will appear to be submerged in it.

Share this post


Link to post
Memfis said:

^ Wouldn't that be very ugly looking, with a clearly visible HOM?


The idea is that the floor texture bleeds through the hole and cover it up. It's exploiting Doom's flood-filling approach to flat texturing (the same approach responsible for slime trails).

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×