Game Development Community

Creating Portals (doorways etc) in Constructor

by Rob Evans · 07/02/2007 (3:38 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/02/2007 (3:46 pm)
Thanks Rob I could use this! Perhaps convert it into a true resource?
#2
07/02/2007 (3:53 pm)
How do I convert it into a true resource? (I'm new here!)

Ahh ok... I see... OK, I've created a proper resource from this.
#3
07/02/2007 (3:55 pm)
Does Map2DifPlus no longer require that the portal have all its edges enclosed within other surfaces? Or was that never a requirement, but only a "best practice?"
#4
07/02/2007 (4:02 pm)
It certainly works without worrying about all edges enclosed. I'm not especially familiar with the tool however so you're probably right that it's best practise!
#5
07/02/2007 (7:37 pm)
Just curious but have you tried just exporting as a dif?

I do it all the time without any problems, but I do have to make the portal brush different.
#6
07/02/2007 (10:30 pm)
Resources can be created from this page...

www.garagegames.com/index.php?sec=mg&mod=resource&page=overview
#7
07/03/2007 (7:37 pm)
@Anthony - I have tried to export as a dif and I get the same result as if I hadn't created a portal at all. Maybe I'm doing this in an unconventional way - if there's another way to do it, could you me know... I'd be interested to hear your method!
#8
11/27/2007 (12:05 pm)
This is very useful for the people who have experience with difs for the first time , and answers the some of the first artist's questions. Thanks!
#9
11/27/2007 (3:51 pm)
@Picasso - Thanks! I haven't been doing anything with Torque recently... let me know how you get on with stuff here.
#10
12/09/2007 (3:38 am)
Small and simple resource, I love it, straight to the point, perfectly explained and I also learn some other stuff from it! Thanks!
#11
12/09/2007 (4:00 pm)
Hey sorry for double commenting but does this work in 1.4? I tried it but Torque just closed when I loaded the map2dif exported file with a portal... Why!?
#12
12/10/2007 (1:18 pm)
I remember having some problems with Torque crashing with objects created in constructor but when I used the map2dif plus it solved the problems. Are you using map2dif or map2dif plus... the last step of the export is crucial.
#13
12/10/2007 (4:24 pm)
There is only a map2dif plus, that's the one I'm using the one you're also highlighting above!
#14
04/16/2008 (7:20 pm)
Hey nice tutorial Rob. I found that for this tutorial to work in TGEA 1.7.0 I had to do a little bit of modification to the tutorial steps. Hope this helps those that are having trouble:

1. Once you create the portal object, I found that insetting it slightly into the opening so that it was not flush or sticking out of the doorway was the only way that it would properly create the "zone" (green interior walls if you use the F9 zone display).

2. I also found that it would sometimes help if I increased the scaled of the portal brush slightly so it overlapped the brushes surrounding it slightly.

3. Using the default Export to DIF menu option in Constructor 1.0.4 worked just fine for me (and when I used the map2dif plus indicated above I would receive errors when placing the object in Torque)
#15
07/09/2008 (12:41 pm)
I imagine that some of the problems are due to differing versions of the software. Thanks Lorne for the update!
#16
09/11/2008 (6:18 pm)
Is there a different exporter needed to do this with TGEA 1.7.1? I haven't seen a single portal exported yet when using the Interior Zones view mode.