Tutorial: All-In-One Portal Guide for GZDoom
Let’s start with the easier option:
The Line Portal
Line portals are the easiest portal to make – I dare say they are easier to build than a teleporter! Let’s start with the uses for this kind of portal and what it does. Line portals create a seamless transition from two areas that are separated in the map. The easiest way to think of them is functionally like a teleporter, but visually like you’re ‘snapping two separate parts of the map together’.
THE TYPES OF LINE PORTAL
It’s worth noting that there’s 4 types of line portal:
- Visual (acts like a solid wall)
- This acts like a solid wall. Imagine this essentially like a ‘HD 3D Camera Texture’.
- Teleporter
- Walking through one side of the portal teleports you to the opposite side.
- Interactive
- A lot like teleporter, however projectiles can pass through it and feels more ‘natural’.
- Static/Linked
- The same as interactive but now it displays on the automap as connected, too. Bare in mind that this is the hardest to work with as the lines defining both sides of the portal must be the same length and angle.
HOW TO CREATE LINE PORTALS
Lets start by creating the rooms that make up each ‘half of the portal’ first. In this example we’re making a portal that measures the same as a standard door (128 x 128). Ensure that the floor and ceiling heights are identical on both sides of the portal, otherwise this will not work properly!
Once your rooms either side of the portal are ready, draw an empty space connected to each of the portal’s lines that is at least 128px deep. The deepness of the portal defines what can and cannot pass through it, so as a precaution I would recommend leaving more space behind it in case a larger creature tried to pass through, such as an Arachnotron. If you know only a player is going to pass through, you can get away with having it 64px deep; but there’s little reason this would be the case. Refer to the picture below if you’re unsure.
This step assumes you’re mapping in UDMF format, however if you’re mapping in Doom in Hexen format this is still possible but you may need to refer to the wiki about the “thisline” parameter of the Line_SetPortal action to set the selected line’s tag (https://zdoom.org/wiki/Line_SetPortal)
Troubleshooting
Did you have any troubles? Is it not working? No worries. Here’s a checklist of things to double-check.
- Are both of the portal’s lines tagged correctly?
- Do both portals point to the opposite side?
- Is the floor height and ceiling height exactly the same on both sides?
- Is it displaying correctly but not letting you walk through?
- Double check that you left enough space behind the portal for actors to pass through. You’ll want enough space to match the largest actor that’s passing through. If it’s a player, leave 64px, if it’s something larger like a mancubus, leave 128px, etc.
- Make sure both portals are set up properly. It might be the case that you forgot to set one to Interactive.
Moving on to Stacked Sector Portals
Did you succeed with the line portals? Assuming you did, you’re probably ready to find out about stacked sector portals. I often refer to sector portals as “vertical portals” and line portals as “horizontal portals”, since this is the motion the player can make as they pass through each respective portal type.
Stacked sector portals are relatively easy to work with, if you remain careful and conscious of your mapping. The way to think about a stacked sector portal is to visualise that you’re stacking two rooms on top of each other.
Let’s use the age-old classic toy, Lego, as an example – you’ve made two separate rooms with your lego, and now you want to put one on top of the other like a building. The first of the rooms has a hole in the ceiling, the other has a hole in the floor. When you use stacked sectors it’s Doom’s way of essentially placing one room on top of the other, as demonstrated below:
First Of All, Create The Two Basic Rooms We’re Going to Connect With a Portal
To have stacked sectors in our map we need a ‘top half’ and ‘bottom half’ for our portals to connect. To keep this tutorial simple, lets start with a basic, detail-less room which is 512x512px in size, with a floor height of 0 and a ceiling height of 128. In the center of this room, we’ll draw a 256×256 square and increase the ceiling height to 192. If you’re unsure of how this should look, reference the below screenshot.
Now duplicate this room. I recommend using copy & paste instead of re-drawing this room to ensure the measurements are correct. When we connect the portal we will want the geometry to line up rather than be misaligned – this prevents your map having “void leaks” which would allow the player to get out of bounds without using cheats… unless you’re looking to make a glitchy mess that could crash the game on purpose, avoid this at all costs!
With the newly copied room, modify the floor/ceiling heights as following: In the outer ring, make the floor 256 and the ceiling 384. In the inner sector, set the floor to 192 and the ceiling to 384. Take note of how the ceiling of the “lower inner sector” lines up with the floor of the “upper inner sector” – these will be the parts we attach together with portals; and they need to connect at the same height for it to work.
Creating The “Anchor Point” and Making the Portal Functional
As the title says, let’s create an ‘anchor point’. I’ve tried and tested several methods, and was fortunately advised of a perfect way to handle this by Gutawer – so I’ll give credit where credit’s due! All you need to do is find somewhere within the portal sectors which is memorable; for example, the top left corner, and add a small line.
Refer to the screenshot below – you’ll see in both sectors we have a small line in the same place, top left, about 16px wide, then split into two with a vertex in the center. This line serves as the anchor point and all tagged sectors base their positioning on this line.
The Portal Is complete!
That’s it, assuming you’ve followed the instructions carefully, you’ve now got a working pair of portals! Pop in a player start point if you haven’t already done so, smash that test button and stare in wonder at your fully functional room-over-room portal trickery!
Example Uses
Below is a small gallery of Line & Stacked Sector portals in use, hopefully these can serve as inspiration and/or as reference for your future portal usage!
Thanks for reading. If this tutorial’s been of any use to you I’d be hugely thankful if you could share this tutorial with your friends and/or drop a comment below. Happy mapping!
Tutorial Difficulty:
Line Portals:
![](https://cdn.dfdoom.com/wp-content/uploads/2018/01/difficulty-1.png)
Sector Portals:
![](https://cdn.dfdoom.com/wp-content/uploads/2018/01/difficulty-4.png)
Required Tools & Resources
- GZDoom Builder
- Increasing patience based on how extensive your portal use will be
- (Don’t be scared, it’s not that bad!)
Any Issues?
Line portals as covered in this tutorial are “easy peasy“, but sector portals can be tricky stuff when you first start out. As with any advanced mapping technique, there’s a plethora of things that could potentially go wrong with sector portals. Below is a list of things to check if you’re having issues:
- Check that your ‘anchor lines’ as I refer to them in this tutorial are in the same position relative to eachother
- Ensure that the lower and upper sectors are tagged appropriately in all areas they are used
- If things still aren’t working but used to work, try undoing your work or restoring a backup
- Needless to say, it’s good practice to backup your map before you begin a mapping session!
- If the game is crashing, it could be that you’ve got a misplaced sector tag causing an ‘infinite loop’. Portals cannot / should not reference themselves (so no ‘lower sector tag’ in the ‘upper sector’ and vice versa)
- Refer to the ZDoom Wiki – https://zdoom.org/wiki/portal
- If you’re still having issues after trying the above, try reaching out to me via Discord and I will see if I can help.
More Tutorials:
Let’s Make Some Multiplayer Maps
Multiplayer mapping is more complex than you might imagine! This article from Decay provides a comprehensive overview about making good multiplayer maps.
Staying Motivated As A Doom Mapper
This article serves as backstory on myself as a mapper, and how I’ve stayed motivated as a mapper for over a decade; including lessons I wish I knew before!
Tutorial: Utilising the Stair Builder & Curve Tool to save time
This article is a tutorial to utilise the incredibly powerful curve linedef and stair builder tools! These tools combined allow for easy creative mapping
i am gonna try using portal at some point. and your maps below are “OMG” 🙂
Thank you! Best of luck using them. 🙂
Thanks for this guide, it’s very well-written and easy to follow. I had some trouble with “bleeding” and “hall of mirrors” effects, though I eventually solved them. I’m leaving a quick write-up of my troubles and solutions here in case anybody else finds it helpful.
For starters, I always get a “bleeding” effect when I connect two rooms with line portals. When I’m in Room A and look through the portal, the floor and ceiling of Room B stretches infinitely into the top and bottom of the screen, covering the floor and ceiling of Room A. I could never get the clean, seamless connection shown in your screenshots.
I finally solved this by simply making a “casing” and “threshold” by lowering a section of the ceiling and raising a section of the floor in front of the portal in both rooms. Subtle it ain’t, but it works.
The second problem occurred when I made the stacked rooms. When I stood in the bottom room and looked up, from certain spots, there was a “hall of mirrors” effect. This was caused by the fact that I had foolishly made the bottom room larger than the top room, not realizing that this meant the player could see into an area that “didn’t exist” from the game’s viewpoint. Preventing this visual glitch was as simple as ensuring the two rooms were either the same size, or making the bottom room a bit smaller than the top room.
For me the teleportation on the line portals work but there is no visual indication. It´s just an invisible teleporter.
Correct! They’re supposed to provide you with the ability to make non-euclidean spaces, or for the purpose of providing the illusion of room-over-room without needing to make extensive use of 3D geometry. The lack of teleporter effects here allows that to be a seamless, invisible transition. You can always use a portal as a visual representation but have the player cross a traditional teleporter linedef before they get to the portal, to make them perform a teleport complete with it’s teleport fog sounds and effects.
Ok I got it. Portals don´t render with Softpoly.
Sometimes when I do stacking rooms there is a visual bug where the thing that crosses is cut off and reappears on the other side, if I put an object that crosses the boundaries it is not seen from above and seen cut from below. I don’t know why that is, maybe it’s because of the boundaries or he doesn’t recognize the height. This becomes a headache in large areas where I have to redo everything. Any explanation?
I’m not sure I can think of a solution to this problem that doesn’t involve some awkward hacky use of the same object on both sides – I’d recommend trying to avoid having entities that sit between portals, unless it’s absolutely necessary. 😅
Hello
On some projects I saw an “endless staircases” where entrances and exits are looped in some strange ways
(met that in Hedon, myhouse and Golden Souls at very least)
If Portals should have the exact same height of floors and ceilings then how exactly this was made?
Was it a disguised STACKED SECTOR PORTALS trick or something else?
This would be using either Line Portals or Silent Teleport-to-Line effects; if you’re unsure which it might be, open up the level(s) which feature this effect in UDB and try to work out why/how it works!
is it possible to use 3d stairs and stacked portals together, or does the player have to be able to physically fit in the space between a step and the lower portal’s ceiling? i ran into an issue where the player couldn’t climb a 3d staircase through a stacked portal and was curious if this was the reason why. thanks!
I’d need to see the WAD to check exactly how you mean but in my tests this works just fine – First thought is to ensure that the player can pass through the portal at all, perhaps the Portal Type is not configured correctly?