Game Development Community

Creating Portals (doorways etc) in Constructor

by Rob Evans · 07/02/2007 (11:35 pm) · 16 comments

Having just spent about an hour trying to figure out how to do this I thought I'd type it up for anyone who's also a complete noob and might need some help...

I'm writing a space sim and after getting all the engine changes in place (phew) I thought I'd concentrate on making some simple space stations to play around with but when I hollowed out the sections where I wanted the ship docking to occur and exported the dif file, I place the station in my scene and tried to fly into the docking port... bang. My ship collided with thin air!

OK, so this is probably the point where many seasoned Torque peeps will laugh, but how was I to know I needed to actually set up where entrances are? :o)

So, all you need to do to make a VERY simple test object is this:

Create a cube primitive using the Build Cube button on the tools menu (top left). - Make sure you have the create tab selected so you can see the options I'm talking about.

v2.wastedwebspace.co.uk/gamedev/step1.png
Next, we're going to hollow out this cube to make a space for our ship to dock so click the modify tab in the tools box and click the hollow brush button. If you get an error about not having a brush selected, click on your box in the perspective view first, then click the hollow button.

You'll get asked how thick you want the walls, the default is 0.5 and we'll leave it like that for the moment.

v2.wastedwebspace.co.uk/gamedev/step2.png
As you can see, the program has created an interior area inside our box. Cool eh? Gotta love those guys at GG!

So now we have a box with an interior, how do we make an opening so that we can walk (or fly) inside?

First, go back to the create tab on the tool box and click the Build Cube button again. We're going to build another cube and use it to cut a hole in our current box by using CSG Subtract.

Once you've created your new cube, move it so that it intersects the first box where you want the "door" to be. You can move your obects by clicking the Modify tab in tools box and then clicking the Translate button.

v2.wastedwebspace.co.uk/gamedev/step3.png
Now click the CSG Subtract button. Once you've done that, to see your results, move the new box away from the old one and you'll see something similar to this:

v2.wastedwebspace.co.uk/gamedev/step4.png
Okey, so we've made the door, now lets tell Torque to actually let peeps in!

Press CTRL-Z to undo your move action so that the new box is back intersecting the old one. Now we tell the Constructor that this new box is actually a portal.

To do that, click the Object tab in the properties menu, then click Portal. Your new box will turn pink like so:

v2.wastedwebspace.co.uk/gamedev/step5.png
This is it... now the bit that really tripped me up was that once I'd done all of this, when I exported the dif file, it still didn't work!

The trick is to export using the export menu's map2dif plus. See here:

v2.wastedwebspace.co.uk/gamedev/step6.png
That's it! This is also the first tutorial I've ever written so excuse the crappy arrows in the pics!

Let me know if you need any help with it.

#1
07/04/2007 (6:48 am)
Simple but excellent. Don't hesitate to write more.
#2
07/04/2007 (2:10 pm)
Thanks for that.

Why does the portal box have to be so large? Does it have to extend a certain distance beyond the collision mesh of the interior it is providing access to?
#3
07/04/2007 (3:08 pm)
@Trevor - Thanks!

@Robert - To be honest, I don't think the portal has to be that big, it was just easier to use the shape that was already at hand! I'm sure a reduced size would be fine, however I really just wanted to show the steps involved in making a working portal :o)
#4
07/04/2007 (8:49 pm)
Rob, very nice ... I like the simple, to the point, approach. Very easy to follow, I feel confident that I can do this in a matter of seconds ... and I've never even touched constructor ;)

#5
07/04/2007 (10:28 pm)
Thanks... constructor is pretty cool actually. My advice is save after every change though... it's crashed on me more than once!
#6
07/31/2007 (7:03 pm)
What's the point of all of that when you can just use the knife and cut any shape door you want; put in "trim" around it and volia....you have a nice door. I've never used the CSG Subtract...and I've always just cut my doors/windows out using my "trim" as a pattern. Having said that...is there a point to using that CSG subtract and making a portal? Maybe for the sake of keeping the "interior" separate from the outside (Lighting mainly), but allowing your player to still walk through? What purpose does it serve that can't be accomplished easier? Also, what is the difference between the Export as Dif and Torque Game Engine (map2dif plus)

Rob,

I found out too that if you have anything in the modify tab selected and you click on the 3D Viewpoint view, it will lock up on you.
#7
09/13/2007 (12:16 am)
Thanks, this is really great. But I noticed you can't export the dts meshes any more using the map2dif plus option.

thanks,

Kev
#8
10/02/2007 (12:24 am)
Thanks, I've heard portals are used to keep environmental effects outside of interiors. But when I make a building the storm still rages on inside my building, does anyone know how to fix this and if portals are the answer and if so how... thanks
#9
10/03/2007 (3:10 pm)
@Jesse P,

I don't remember the link, but run a search on interior fix. There is a resource that solves that problem nicely.
#10
10/03/2007 (3:39 pm)
@Jesse P, Snow/Rain that stays outside where it belongs - by ken finney
#11
10/03/2007 (7:39 pm)
Thanks, it worked, but I had to put portals in all the walls of the room overlapping
#12
03/02/2008 (2:21 am)
Wow thanks! Just started learning constructor today and this really helped me.
#13
07/06/2008 (9:46 pm)
Thanks, i have been wondering how to do this since i bought the Tim Aste combo pack, because he uses portals.

from Ross
#14
12/15/2008 (8:50 am)
Does it really work by doing so??

I think the portal must be inside the opening space between external and interior.

What ever, i can't make my portal work by doing what you demostrate.
#15
01/21/2009 (2:44 pm)
I just did it step by step using Constructor v1.0.3 and it worked PERFECTLY! Thanks Rob! This is one of the easiest, and most useful tutorials I've ever seen. Maybe its the third pot of coffee or something, but I'm literally jumping up and down :)

Seriously though, great job! This was my first time using Constructor (long time QuArK fan), and I think I'm hooked. I hope to see more from you.

Thanks again!
Tony
Infinitum3D
#16
08/07/2009 (10:11 am)
Thanks for the tutorial!
it really helped me!

BlazerYo