Editing Portal

From Eternity Wiki
Jump to navigationJump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 26: Line 26:
A sector off of the main map area which is used by line or sector specials as a model, or as housing for lines which need to be a specific size.
A sector off of the main map area which is used by line or sector specials as a model, or as housing for lines which need to be a specific size.


== Simple rendering portals ==
== Fixed Plane Portals ==
These portals produce simple rendering effects: based on floor and ceiling models, or using skyboxes. They're not interactive but can be useful for rendering skies or infinite extents at the edge of the map.


=== Fixed plane portals ===
Fixed plane portals (as the name implies) render a single, fixed plane into the portal window. The plane is always rendered a the same height and texture offset even when the camera changes its position.


Fixed plane portals (as the name implies) render a single, fixed plane into the portal window. The plane is always rendered at the same height and texture offset even when the camera changes its position.
Line specials:
 
Line special (UDMF format): [[Portal_Define]]
 
Line specials (classic Doom format):


:283 Apply fixed plane portal to the ceilings of tagged sectors
:283 Apply fixed plane portal to the ceilings of tagged sectors
Line 43: Line 38:
The front side sector of the special line is used to generate the plane. The ceiling texture, sector light, and ceiling texture scrolling are all used as attributes for the rendered fixed plane. The absolute height of the ceiling is used as the height of the plane. That is, if the special line front sector has a ceiling height of 64, the plane will always render at 64 units above the camera height. If the ceiling height is 128, the plane will always render at 128 units above the camera height, and so on.
The front side sector of the special line is used to generate the plane. The ceiling texture, sector light, and ceiling texture scrolling are all used as attributes for the rendered fixed plane. The absolute height of the ceiling is used as the height of the plane. That is, if the special line front sector has a ceiling height of 64, the plane will always render at 64 units above the camera height. If the ceiling height is 128, the plane will always render at 128 units above the camera height, and so on.


==== Example ====
For example:
===== Classic Doom format =====


[[Image:Pfixedplane01.png]]  [[Image:Pfixedplane02.png]]
[[Image:Pfixedplane01.png]]  [[Image:Pfixedplane02.png]]


The left image shows a simple map with a small sector off to the side of the rest of the map. One of the lines in this sector has been given  a 283 special which will apply a fixed plane portal to all tagged sector ceilings. The height of the dummy sector is set to 128, the blue water texture FWATER1 is the ceiling texture, there is no scrolling applied to the ceiling, and the ceiling height is 128.
The left image shows a simple map with a small sector off to the side of the rest of the map. One of the lines in this sector has been given  a 283 special which will apply a fixed play portal to all tagged sector ceilings. The height of the dummy sector is set to 128, the blue water texture FWATER1 is the ceiling texture, there is no scrolling applied to the ceiling, and the ceiling height is 128.


The right image shows what the map looks like in [[Eternity]]. Notice the rendered height of the plane is the same as a ceiling 128 units above eye level.
The right image shows what the map looks like in [[Eternity]]. Notice the rendered height of the plane is the same as a ceiling 128 units above eye level.
Line 60: Line 54:
The highlighted wall has been given a special of 289 and tagged to the portal line. In-game, the tagged wall now displays the portal. Note: The 289 line special works for all portal types.
The highlighted wall has been given a special of 289 and tagged to the portal line. In-game, the tagged wall now displays the portal. Note: The 289 line special works for all portal types.


===== UDMF format =====
== Horizon Plane Portals ==
In [[UDMF]], you still use a dummy sector, but instead of using classic specials 283-285, you use [[Portal_Define]] and give it a unique portal ID (to be sure, just use editor's "find new tag" feature or pick a large number such as 1000). Then select all sectors or linedefs where you want the portal to appear, and set their '''floorportal''', '''ceilingportal''' or (for linedefs) '''portal''' UDMF fields to the same portal ID.
 
=== Horizon Plane Portals ===


Horizon portals display two planes which appear to go on forever until they meet in the middle (horizon). The plane coordinates are not fixed, and will appear to move with the camera. This can be used to achieve the illusion that water or grass goes off far into the distance without having to make overly large sectors.
Horizon portals display two planes which appear to go on forever until they meet in the middle (horizon). The plane coordinates are not fixed, and will appear to move with the camera. This can be used to achieve the illusion that water or grass goes off far into the distance without having to make overly large sectors.


Line specials (UDMF): [[Portal_Define]], [[Line_Horizon]]
Line specials:
 
Line specials (classic Doom format):


:286 Apply horizon portal to the ceilings of tagged sectors
:286 Apply horizon portal to the ceilings of tagged sectors
:287 Apply horizon portal to the floors of tagged sectors
:287 Apply horizon portal to the floors of tagged sectors
:288 Apply horizon portal to the floors and ceilings of tagged sectors
:288 Apply horizon portal to the floors and ceilings of tagged sectors
:450 Apply horizon portal on this line using the floor and ceiling of front sector (tag not used)
==== Example ====
You can use classic types 286-288 or UDMF [[Portal_Define]] in a similar way to the plane portals. But much easier is to use classic 450 or UDMF [[Line_Horizon]] on a sector's walls to copy its floor and ceiling rendering into infinity. No tag or args needed for this. Following is an example using 286-288.


Like the fixed plane portals, the front sector of the special line is used. The top plane uses the front sector ceiling (height, texture, scrolling, light) as its model, and the bottom plane uses the front sector floor (height, texture, scrolling, light) as its model. Example:
Like the fixed plane portals, the front sector of the special line is used. The top plane uses the front sector ceiling (height, texture, scrolling, light) as its model, and the bottom plane uses the front sector floor (height, texture, scrolling, light) as its model. Example:
Line 87: Line 72:
Note: If the camera ever travels below the floor height of a horizon portal, the bottom plane will appear to move in the opposite direction of the camera movement until the camera is once again above the floor height.
Note: If the camera ever travels below the floor height of a horizon portal, the bottom plane will appear to move in the opposite direction of the camera movement until the camera is once again above the floor height.


=== Skybox Portals ===
== Skybox Portals ==


Skybox portals draw another part of the map into the portal window. The scene in the portal window will use the angle from the player camera, but will render the scene from the location of the skybox camera. This helps create the illusion that the contents of the skybox actually surround the map and are much larger in size than they really are.
Skybox portals draw another part of the map into the portal window. The scene in the portal window will use the angle from the player camera, but will render the scene from the location of the skybox camera. This helps create the illusion that the contents of the skybox actually surround the map and are much larger in size than they really are.


Line special (UDMF): [[Portal_Define]]
Line specials:
 
Line specials (classic Doom format):


:290 Apply skybox portals to the ceilings of tagged sectors
:290 Apply skybox portals to the ceilings of tagged sectors
Line 101: Line 84:
The front sector of the special line becomes the "skybox sector". This is not the only sector that gets rendered, but this sector is where [[Eternity]] will look for the skybox camera object which will be the point the skybox is rendered from.
The front sector of the special line becomes the "skybox sector". This is not the only sector that gets rendered, but this sector is where [[Eternity]] will look for the skybox camera object which will be the point the skybox is rendered from.


==== Example ====
For example:


[[Image:Pskybox01.png]]
[[Image:Pskybox01.png]]


(for UDMF, use [[Portal_Define]] with a unique portal ID and the sector '''floorportal''', '''ceilingportal''' and linedef '''portal''' fields.)
This map has a skybox portal applied to the ceiling and wall of the sector with the player start. The "Skybox sector" is the small rectangular one which contains the EESkyboxCamera object. The camera object always spawns on the floor, so the skybox sector has been made a glass floor 48 units above the surrounding area so the camera will be above the floor of the box.
 
This map has a skybox portal applied to the ceiling and wall of the sector with the player start. The "Skybox sector" is the small rectangular one which contains the EESkyboxCam object. The camera object always spawns on the floor, so the skybox sector has been made a glass floor 48 units above the surrounding area so the camera will be above the floor of the box.


[[Image:Pskybox02.png]] [[Image:Pskybox03.png]]
[[Image:Pskybox02.png]] [[Image:Pskybox03.png]]
Line 117: Line 98:
[[Image:Pskybox04.png]]
[[Image:Pskybox04.png]]


== Anchored portals ==
== Anchored Portals ==
Anchored portals are those which render another part of the map on a window. They are of two types: purely visual, and interactive (historically the purely visual ones have been available long before the interactive ones, hence the separation). Interactive portals are also called ''linked'' portals and are the most important kind, as they allow extending gameplay to 3D (multistory) and even 4D/5D (discontinuous connections allowing "impossible" maps, albeit with some restrictions).


=== Visual anchored portals ===
Anchored portals are the most powerful and complex of all the basic portal types. Anchored portals will render another area of the map into the portal window, but the portal camera moves as the player moves, creating the illusion that the other area of the map is actually connected to the main area. This can be used to create the appearance of 3D architecture. Before use, however, an understanding of how these portals work is important.


Anchored portals are more complex than previous portal types. They are the base for linked (interactive portals). These portals however are not interactive; they're purely visual.
In order to piece the parts of a map together, an anchored portal needs to know how far apart they are. The distance is determined with the use of specific line specials. Each anchored portal needs a "portal line" (the line with the anchored portal special) which usually area the portal should render, and an "anchor line" which is usually located in the main map area. The distance between these lines becomes the offset, that is, how far [[Eternity]] needs to move the camera from where the player stands to get the portal area.
 
Anchored portals will render another area of the map into the portal window, but the portal camera moves as the player moves, creating the illusion that the other area of the map is actually connected to the main area. This can be used to create the appearance of 3D architecture. Before use, however, an understanding of how these portals work is important.
 
In order to piece the parts of a map together, an anchored portal needs to know how far apart they are. The distance is determined with the use of specific line specials. Each anchored portal needs a "portal line" (the line with the anchored portal special) which usually is area the portal should render, and an "anchor line" which is usually located in the main map area. The distance and angle between these lines become the offset and rotation respectively, that is, how far [[Eternity]] needs to move the camera and rotate it from where the player stands to get the portal area.


Line specials:
Line specials:
Line 152: Line 128:
In the example, the distance is 512 units to the east and 0 units north. This set of numbers becomes the "portal offset" (distance between where the player stands and where the portal camera should go) and when the portal is rendered, the portal camera is place 512 map units east of the player camera, and the map is rendered from the portal camera.  
In the example, the distance is 512 units to the east and 0 units north. This set of numbers becomes the "portal offset" (distance between where the player stands and where the portal camera should go) and when the portal is rendered, the portal camera is place 512 map units east of the player camera, and the map is rendered from the portal camera.  


==== Portals Faking Reflective Flats ====
If the portal camera becomes obstructed, unwanted results can occur:
[[Image:Reflective_portals.png|320px]]


When paired with ''[[ExtraData]]'' lump, anchored portals can fake a reflecting floor / ceiling effect.
[[Image:Panchored04.png]]


To achieve this you need to:
In the example above, the camera actually "wanders" out of the portal area and into the main part of the map resulting in an unwanted wall rendering in the portal window. To prevent occurrences such as this, it is usually a good idea to place the portal area a good distance away from any other map architecture to prevent the camera from "wandering into" anything else. If the camera moves out of the portal area, it won't cause problems as long as it is not obstructed by other map architecture.
* Recreate an z-mirrored copy of the rooms you want to be reflected.
* Connect portals as you'd normally do.
* Enable '''ExtraData''' definition for a sector (i.e. give a ''401'' special to a LineDef facing the sector which flat's alpha you want to modify).
* Add [[MapInfo]] lump that calls specific '''ExtraData''' script when map is played:
<pre>
[MAP01]
    levelname = my level
    extradata = EXTRA01
</pre>
* Add '''EXTRA01''' lump containing something along those lines:
<pre>
sector {
recordnum 1
portalflags.floor overlay
overlayalpha.floor 50%
}
</pre>


: ''See: [[Portal#Examples]]'' for a demonstration file
== Linked Portals ==
 
=== Linked Portals ===


:''See: [[Linked portals]]''
:''See: [[Linked portals]]''
==Copying portals==
Portals placed on a kind of surface can be copied into other surfaces: sectors or linedefs.
===Copying to a linedef's middle part===
You can use linedef special 289 to copy a sector floor/ceiling portal into linedef's front middle part. Use the tag of a sector which has been given a floor or ceiling portal.
===Copying to the front sector===
You can use linedef special 385 to copy a like-tagged sector's floor/ceiling portal to the front sector. Useful when the front sector needs to have a different tag, and you don't want to add more control linedefs to address it. In this case, you can use this 385 special to copy the portal.
===Copying to the lower or upper front edge of the linedef===
This is what we sometimes call "edge portals", because they apply on upper and lower edges of a linedef (where normally such a texture is applied). They're always on the front side.
A portal that resides on the back sector of the linedef can be copied, as an extension, to the front side's lower or upper part. On UDMF, use the '''upperportal''' and '''lowerportal''' boolean attributes of '''linedef'''. In the classic format, you need to use the [[ExtraData]] LOWERPORTAL or UPPERPORTAL extended linedef flag.
If it's a linked portal, the side in the other layer should most likely have a standard wall portal leading back. In UDMF, give that linedef the '''portal''' attribute with the same value as the ceiling or floor's portal ID ('''ceilingportal''', '''floorportal''') of the containing sector. In the classic format, it has to be defined with classic special 376 (apply linedef linked portal) and the tag of this linedef.
See also [[Edge portals]].
==Examples==
[https://s3-eu-west-1.amazonaws.com/eternity/portals_reflective.wad portals faking reflective floors]
[[Category:Editing]]
[[Category:Portals]]
Please note that all contributions to Eternity Wiki are considered to be released under the GNU Free Documentation License 1.2 (see Eternity Wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)