Difference between revisions of "Making a self-referencing sector"

From DoomWiki.org

[unchecked revision][checked revision]
(reduce importance of old hacks)
m (The reason why was removed, restore it. Otherwise I'm alright with it.)
(6 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[image:selfref1.png|thumb|right|256px|Invisible platform]]
+
[[File:selfref1.png|thumb|right|Invisible platform]]
[[image:selfref2.png|thumb|right|256px|Deep water]]
+
[[File:selfref2.png|thumb|right|Deep water]]
 +
'''Self-referencing sectors''' are the most well-known and widely used approach for creating [[Editing:Invisible_floors|invisible floors]] and [[Editing:Deep water|deep water]] effects for vanilla maps.
  
Self-referencing sectors are the most well-known and widely used approach for creating [[Editing:Invisible_floors|invisible floors]] and [[Editing:Deep water|deep water]] effects for vanilla maps.
+
A sector is said to be self-referencing when the lines that define it are edited so that both of their sides refer to the sector, with neither referencing the neighboring sector. This makes the boundaries between the self-referencing sector and its neighbors undefined to the rendering engine, causing the sector to become invisible. The floor and ceiling of the surrounding sector will bleed through. However, the physics part of the engine will still detect when the player and other [[mobj]]s are inside the self-referencing sector, using its floor and ceiling heights for collision and movement.
 +
 
 +
Self-referencing sectors can also be used to create [[crusher]]s that deal much more damage than a normal crusher, since [[crusher]] damage is cumulative between contacted crushers. The technique used to do so will not work in [[ZDoom]]-derived ports like [[GZDoom]] or [[Zandronum]].
  
 
== Implementation ==
 
== Implementation ==
  
Create a sector for the region in which you want the effect to take place. This should be defined with the flats, light-levels and heights of the desired ''appearance''. For example, in the case of deep water, This sector should define the water level.
+
Create a sector for the region in which you want the effect to take place. This should be defined with the flats, light-levels and heights of the desired ''appearance''. For example, in the case of deep water, this sector should define the water level.
  
 
Create a sub-sector with the flats, light-levels and heights of the desired ''effect''. Using the deep water example, this sector would define the height of the player's feet.
 
Create a sub-sector with the flats, light-levels and heights of the desired ''effect''. Using the deep water example, this sector would define the height of the player's feet.
Line 17: Line 20:
  
 
* In the deep water example, sprites are not occluded by the flat. So, if you place an item in the water, it will be drawn at the height of the self-referencing sector but on top of the water-flat.
 
* In the deep water example, sprites are not occluded by the flat. So, if you place an item in the water, it will be drawn at the height of the self-referencing sector but on top of the water-flat.
 
  
 
== Seen-in ==
 
== Seen-in ==

Revision as of 06:13, 7 November 2022

Invisible platform
Deep water

Self-referencing sectors are the most well-known and widely used approach for creating invisible floors and deep water effects for vanilla maps.

A sector is said to be self-referencing when the lines that define it are edited so that both of their sides refer to the sector, with neither referencing the neighboring sector. This makes the boundaries between the self-referencing sector and its neighbors undefined to the rendering engine, causing the sector to become invisible. The floor and ceiling of the surrounding sector will bleed through. However, the physics part of the engine will still detect when the player and other mobjs are inside the self-referencing sector, using its floor and ceiling heights for collision and movement.

Self-referencing sectors can also be used to create crushers that deal much more damage than a normal crusher, since crusher damage is cumulative between contacted crushers. The technique used to do so will not work in ZDoom-derived ports like GZDoom or Zandronum.

Implementation

Create a sector for the region in which you want the effect to take place. This should be defined with the flats, light-levels and heights of the desired appearance. For example, in the case of deep water, this sector should define the water level.

Create a sub-sector with the flats, light-levels and heights of the desired effect. Using the deep water example, this sector would define the height of the player's feet.

Alter the sidedefs of the sub-sector so that both sides reference the sub-sector. This is now a self-referencing sector.

Limitations

  • Depending on your node-builder, the effected region may be limited to the sub-sector or the parent sector, or may depend on the player's direction of travel. In the example PWAD below, if you walk onto the raised section next to where the invisible floor is, the player will be at 8px off the ground. If you now walk onto the invisible floor, you will be 32px off the ground. You will remain at this height until you either leave the parent sector, or approach the 32px real sector at the other end.
  • In the deep water example, sprites are not occluded by the flat. So, if you place an item in the water, it will be drawn at the height of the self-referencing sector but on top of the water-flat.

Seen-in

Example