Linked portals tutorial
NOTE: This tutorial assumes that you know the basics of Doom editing; however, the information provided here is not Slade-specific, and the techniques can be used in other editors: the diagrams are provided only as an example. Also, the latest SVN build of Eternity was used here, so unless your version of Eternity is up-to-date, portals may not work as intended or at all.
Linked portals are a powerful feature of the Eternity Engine that allow you to connect two separate areas of a map via the floor/ceiling or a linedef, allowing the player to see, shoot, and even move seamlessly from one area into another. They are similar to two-way portals apart from the fact that you can pass through them. First off, let's see how to create a floor/ceiling portal!
The first thing we want to do is to make a couple of separate sectors that will house our portal. What we're going to do here is to have two 'levels' in one room, with a hole in the middle so you can see from the top level into the bottom, and vice versa. Of course, with portals you're not just limited to this, but it's a good place to start. Draw two square sectors, say 256x256 units in size, and place them fairly far apart, as shown in the diagram below.
So, let's choose the sector on the left as our 'upper' level, and the one on the right as the 'lower'. Now, we need to think in three dimensions (a first for Doom editing!), and make one of the sectors higher than the other. This will enable the player to fall from one to the other. Change the floor height of the right-hand sector to -128, and the ceiling height to 0 - the floor height of the left one. Now, draw a 128x128 sector in the centre of each of your two sectors - this will be our hole.
Once we've done that, we can start to work on creating the functioning portal! This part can get fairly confusing (at least it did for me) so take your time. First of all, select one of the linedefs in the left-hand portal sector (the 'hole' we just created). It doesn't matter which linedef you select, but it needs to be the same side as the line you'll choose in a moment on the right-hand sector. In this example, we'll pick the bottom linedef. In the line's properties, change its special type to 361 - Linked Floor Anchor (if your version of Slade doesn't have linked portals in its configuration files, you can download an updated slade.pk3 file here (thanks to esselfortium), or you can still enter 361 manually and as long as you have the correct version of the Eternity Engine, it'll work). Also, make the sector tag for this line 1.
Alright, now it's time to work on the second sector. Select the bottom linedef (or the equivalent of the linedef you tagged on the first sector) of your right-hand 'hole' sector and edit its properties - give this line the special type 359 - Linked Portal Floor and the same tag as the first, 1. Tagging these two lines like this gives the engine a 'starting point' from where to draw the other side of the portal, thus rendering it correctly.
Now, go ahead and give the left middle sector a sector tag of 1 - so that the two lines you tagged previously refer to this sector.
Great! Now, that's one half of the process done - we're going to have to use the same process, but in reverse, to allow the player to see through the hole in the right-hand sector when he falls down there. I'll run through it again but there's a few subtle changes you should notice. Like the first time, pick a line on the right-hand sector - the bottom one is already used, so let's use the top one. Give this line the special 360 - Linked Ceiling Anchor (I'll explain why this is different in a moment), and give it the sector tag 2.
After that, select the same corresponding line on the left-hand sector, and give it the special 358 - Linked Portal Ceiling, and the same sector tag - 2.
Now all we have to do is give the right-hand sector a tag of 2, and we're done!
Alright, now all that's left is to insert a player 1 start thing, save, and try it out in Eternity! One thing you might notice is that the 'platform' you're standing on looks rather thin - we'll take care of that in just a minute. Hopefully, it should look something like the screenshots below -
Looking down into the hole...
...and looking back up!
If, when you try to walk into the hole, you end up seemingly floating in mid-air, you'll need to change one of Eternity's compatibility flags - 'Monsters have infinite height'. The default setting for this option is 'yes', as shown in the screenshot below - you'll want to change it to 'no' to allow you to fall through linked portals.
Alright, with everything in order now... let's make that platform a little thicker, shall we? This is a simple process, and there are a couple of ways to go about it. First, we can raise the floor height of the left surrounding sector - and apply lower textures to the sidedefs surrounding the hole. Or, we can lower the ceiling height of the right surrounding sector, and apply upper textures as appropriate. It doesn't really matter what you do, but in this tutorial I'll do the latter. Select the right-hand surrounding sector, and change the ceiling height to -16, and the floor height to -144 (to keep the wall textures from being drawn 'short', and to appease the gods of symmetry, this room should remain 128 units tall - however it's all up to personal preference).
Of course, we'll need to modify the floor height of the right-hand 'hole' sector too, so that it's the same as its surrounding sector, so change that to -144, too.
Now to deal with the upper textures. Select the linedefs in the right-hand 'hole' sector and view their properties. Click on the 'Front Side' tab across the top of the dialogue box, and choose an appropriate texture as the 'Upper' texture. In this example, I've chosen 'STEP5' because it's one of my favourite step textures, and it's a good height for our platform.
So there we have it! Hopefully, you've managed to create your first linked floor/ceiling portal - it should look something like the screenshot below.
As I mentioned before, for the right-hand sector we used the same method as the first portal but slightly different. This is because, in its case, the left-hand sector is to be drawn above it - on its ceiling. So, in that case, it's a ceiling portal, while in the first instance, it was a floor portal. Alright, with that out of the way, I'll just quickly go over the process of creating linked floor & ceiling portals:
- Create two separate areas of the map that you'll link together using portals - one area above another, for example.
- Make sure that the two areas have an appropriate height difference, as if they were physically above each other - think in three dimensions!
- Pick a line in the 'upper' portal sector and give it the special type 361 - Linked Floor Anchor and a sector tag.
- Pick the corresponding line in the 'lower' portal sector and give it the special type 359 - Linked Portal Floor, and the same sector tag as the line previously.
- Give the 'upper' portal sector this sector tag, too.
- In other words: the sector that you walk around in should have the anchor line, and be tagged, while the sector you look into should have the portal line.
- Repeat the process for the other sector, but in reverse, using ceiling anchors and ceiling portal lines as appropriate.
And there we go! Hopefully this has helped inspire you to use what I consider one of the niftiest effects the Eternity Engine has to offer - happy portaling!