Tutorial #6: Portals (click to download .UNR) | Author: Dr. SiN | Last Updated: May 26th

Unreal Tutorial #6 Portals to Hell Portals.. what are they. We have all seen Unreal’s Portal effect in their execelent DM level DMRADIKUS and this has been the hardest tutorial to write. Not because creating portals are all the difficult, but tell you how to do has proven to be a task.

What is a portal? A portal is a gateway between 2 areas. As you view in to a portal you see what is happening in the other area. These allows you to create some truly wild geometry that defies the laws of space and phsyics. But how do we make them. I think it’s important to get an over view of how portals work before we build one.

You actually need to build 3 separate actors in Unreal for each portal. There is the portal housing, the gateway and the room where it sits. The portal housing is sort of a small room within the main room (like a closet) that can have only 1 exit. The gateway is the space inside the housing. Of course, all of this sits in the room.

Portals are created by setting up a zone between the gateway and the room. If your not convertible with what a zone is, I suggest you go read the Epic tutorial on zone as I will not be going in to them here. Inside the gateway (once it has been zoned off) you need to place a ZoneInfo called WarpZoneInfo. This tag is how Unreal’s engine connects portals together.

So are you ready to begin.. good!

Let’s start by making the room that will contain the first portal. Right click on Use Cube Brush and select Cube Properties. We want to create a large room that’s not too high. I suggest using Heigth=320, Width=1024, Breadth=1024. Enter these values and click on build, then close the window. Your brush should now be a nice big room. You could pick any values you wish, but for easy, I suggest sticking with even 64 pixel values. Subtract your room and texture to taste.

You have just build 1 part of the portal… the room where it exists. Next step is to build the actual portal housing. The portal housing can be of any shape, but keep 2 things in mind when you build one. First you are going to have to put a single flat plane in there and create the zone and second, you will need enough room to fit the WarpZoneInfo tag actor as well.

For this example, we will just create a simple box frame. Right click on Use Cube Brush and select Cube Properties. Set Heigth=192, Width = 128, Breadth = 128 and press enter (then close the Build a Cube Window). This will shrink your brush. The next step is to place the portal housing on the ground. Now make the brush an actor. Since we are already working in a created space, we want to click on Add Brush to World. This will create a solid block… the frame of the portal housing. When you are finished, you should end up with the following

We have have two of the three parts to a portal. All that’s left is to carve the gateway from the solid portal housing. Once again bring up the Cube Properties. We want to contract our current brush so we can cut it from the cube. Set heigth=160, width=96, breadth=96. Click on build and close the Build a Cube window

Now you have a choice. You can leave the gateway with a border around it, or you can set it on the floor. However you must move the gateway so it touches the main room. If you don’t you will be creating a gateway INSIDE a solid block.. not good. For this tutorial, we will leave a frame. Simple drag the gateway so it touch any edge of the portal housing. Once it’s in place.. pick your textures and ckick on Subtract Brush from World. There should now be a contained space within your portal housing. Your portal should look like this…

Now is a good time to make sure your geometry is ok. Add some lights around the portal housing and press F8 to rebuild your map. Now would also be a good time to save your map (and you can even test it).

Phase 2:

So we now have a complete portal setup. We have the room it exists in, we have the portal housing, and we have the gateway. But we need two of them. No problem, we will just make a copy of the current room. If you read tutorial #2 you know how simple this is. Let’s do it a different way though. Create a cube brush that big enough to cover the current room. Once it covers your entire room… click on Select all Inside. Yep.. you guessed it. In UnrealED your brush is not only your method of building, it’s your selection box as well. Once you click on that icon, everything in the room will be selected. Make a duplicate of the room by press CTRL-W and move it somewhere else. If you find you cant move the copy right away.. try pressing B to hide the brush (remember to press it again to bring the brush back later).

Once you have moved the copy somewhere else, we want to rotate the room so the portals face each other. So while the whole room is still selected, rotate it 180 degrees. Rebuild!

We should now have 2 rooms that mirror each other. I suggest changing the wall textures in one of them so it’s easy to tell them apart.

Now it’s time to define the zones and ad the zone info. Right click on Use Plane Brush and select properties. We need to build a Plane that will completely cover the gateway and form our zone. In this example, our gateway is 160 high by 96 wide. Enter these numbers and set the orientation to which side of the portal housing you built your gateway on. Click on build and close the window. You should now have a single pixel Plane that’s ready to be placed!

An important note.. sometimes UnrealED doesn’t reset the scaling position. If you use the Properties box and the plane looks HUGE or mal-formed.. simply select the plane, right click, select reset and reset all.

When we place our plane, we want to move it slightly in to the gateway. This will create a good looking lip before the portal. Move it in 1 square. Now it’s time to define the zone. Select Add Special Brush to World and under Predefined, select Zone Portal. Click on Add Special and you now have a new zone. Do not close the Add Special Brush window.

Without changing any of the dimentions of the Plane, drag it and place it to form the other zone in the other Portal Housing/Gateway. Using the same settings, add another Zone portal. You can now close this window.

Now for the very important part. It seems that the actual gateway must be EXACTLY the same size on both portals. This means the two portals should 100% mirror themselves. When you done making the zones this is what you should have…

Now for the final setep.. adding the WarpZoneInfos. Here’s the deal. Go to the browser and switch to classes. The WarpZoneInfo is located under INFO|ZONEINFO. Hightlight it and go back to the map. Right click somewhere in the gateway and select Add WarpZoneInfo here. You should now have a Little ? and a box in your gateway. Hightlight it (till it’s green) and right click. Select properties. Go to Advanced and toggle bDirectional to true. Next go to WarpZoneInfo.

Under this field, there are 3 options. The first isn’t important for our purpose. The OtherSideURL will hold the name of the other portal. For now put "P2" in that field. The ThisTag hold the name of this portal. Put "P1" here.

Close the window. Notice our little ? and box have an arror pointing off of it. Make sure this arror is point in to the back of the gateway (ie: it’s pointing in the direction you would walk to enter the portal). Make sure the WarpZoneInfo is still highlight and press CTRL-W (create a duplicate). Drag this duplcate over to the other portal. Place it somewhere inside the gateway (where it doesn’t matter, as long as it’s inside). Rotate the WarpZoneInfo so it’s directional arrow points in the right direction (ie: points in to the portal). Now right click on it. Select properties and go to WarpZoneInfo. Swap the OtherSideURL and the This Tag fields. Close the dialogue and rebuild.

Your portals are now ready to test. Make sure a player start is in your level before you test it.

Some things to remember…

1) All portals have 3 parts. The portal housing, the gateway and the room in which the portal resides. Multiple portals may share the same room.

2) The gateway in both portals must be EXACTLY the same dimensions.

3) The zoneportal plane must 100% seal off the gateway.

4) The WarpZoneInfo actors must point in to the gateway (ie: in the direction you must travel to enter the portal).

See if you can figure out how to add the cool texture effects (hint: Make the plane and make it visible).