Game Development Community

Portals, mirrors, and more

by Maddermadcat · in Constructor · 03/14/2008 (9:02 am) · 13 replies

Hey guys,

I have several questions about level editing in Constructor. If I have a large interior and wish to divide it into zones with portals, will this speed up the game? Or does Torque only recognize whether the player is looking into the interior or not? Next, I've been having some problems with mirrors. Could anyone walk me through making brushes reflective? Finally, fog and water -- is there any way to fill a room with fog without using water blocks? And are water brushes anywhere in Constructor's future?

Thanks in advance for any answers.

#1
03/14/2008 (6:37 pm)
Place the mirror entity into the face you want reflective. I have a mirror .map and .csx sitting around that I used to use as an example. I'll see if I can find it.
#2
03/15/2008 (9:03 am)
Well, I have quite a few reflective faces -- would I need to create an entity for each of them?
#3
03/15/2008 (10:38 am)
@Maddermadcat:

You do know that each reflective surface will cause the scene to be rendered again, right?
#4
03/15/2008 (11:28 am)
Yes. The hit my framerate takes is a bit troubling, I might end up settling for an environment map on the windows.

Got the mirrors working, as you probably guessed. Thanks for the help, David. : )
#5
03/15/2008 (9:36 pm)
I created a hotel with 5000 rooms (as a test), each with a mirror in the bathroom.
.
.
.
I won't be doing that again.
#6
03/19/2008 (4:13 pm)
I read a TDN article a while ago that seemed to imply that portals can be used to create as many zones within an interior as you like. So I suppose you could portalize multiple rooms within an interior? Or am I wrong?

Still need this answered. And it would probably have helped your hotel if it works. :P
#7
04/03/2008 (3:07 pm)
What is a portal?
#8
04/03/2008 (6:02 pm)
@Madder

You are correct.. in one interior I have around 40 portals working perfectly. You would need to design the area with the mirrors in a specific way to allow the portal to do its job though.

@Lawson


Portals are used to make zones. Zones are designed to improve rendering speeds. To be properly constructed, a zone has to be completely sealed by structural brushes and portal brushes. Cracks (spaces between brushes) will cause zone leaks and the zone won't be created during the compile process. If not properly constructed, you may get lower FPS (frames per second) when the game is rendering. Portals can also separate a zone from ambient light or sound. Portals are generally used over windows and doorways.

Constructor 1.0.2 (or higher) supports portals for TGE 1.5.2 with the Export As DIF... export. It supports portals for TGE 1.4.2, TGE 1.5.0, and TGEA 1.0.1 with the Export As Legacy... options.

Another explanation

A simple but flawed way to think of zones is: Every 'thing' in the game 'world' is on this long list of 'things'. It takes time to check the list to see if the 'thing' should be rendered. By putting 'things' into a zone you have created a new 'thing' list for that zone, and now the main 'world' list is shorter.

Portals help define an area so that once none of the portal area is visible, the full area can be ignored. If any part of the portal area is visible, whatever is visible will be rendered but occlude the rest of the zone that isn't visible (unless you're inside that zone). It is pointless to use a lot of portals, because now you have created many of the 'thing' lists. It is also pointless to portal an area that is often visible (now the list reshuffling takes as much time as not being in a zone).

The best way to learn where and when to use a portal is to watch your FPS. If you come into an area or view that makes the FPS stutter, portal it off. If that same area is visible from many locations and angles, portals will not help.

How to create a portal

Portals are regular brushes that you convert into portals through Constructor in the same place the other brush types are listed (left hand side, under object properties).

To allow sun light to pass through the portal; in Constructor's menu go to: Scene > Manage Entities... Select your portal from the left and change the 0 to a 1 for the 'ambient' setting on the right.




Link: Click Me!
#9
04/03/2008 (6:41 pm)
So are light leaks the same as zone leaks? Because I have my walls touching and they still let light leaks in at certain angles. Same for zone?
#10
04/03/2008 (7:47 pm)
Light leaks are not associated with zones. You can have a room perfectly zoned off and still get light leaks under the walls. As far as I know, it has to do with lexel size. When each surface of the interior is lit, the outer border of lexels hangs over the boundaries of the surface. If the lexel is big enough that part of it extends beneath a wall where that part is lit by the sun or another light source, then that light (from outside the zone) will get added to the lexel's intensity. This ends up looking like light is leaking under walls. To avoid this, you can either make your walls thicker, so that the lexel does not reach the other side, or make the lexels smaller by increasing the lightmap resolution. To do this, simply decrease the light_geometry_scale (Scene->Manage Entities->worldspawn) by powers of two and relight until the light leak goes away. The only drawback to this method is your DIF file size gets bigger as the lightmap gets bigger.
#11
04/04/2008 (7:15 pm)
Or, if what your making is strictly interior.. turn off the sun completely. ;)
#12
04/06/2008 (6:37 pm)
Wow, thanks Ryan -- I've been wanting to figure out how to make my lightmaps nicer. The lighting profiles manager has been working for me, but only in constructor -- exporting to torque gives me the same old small lightmaps. :\

I see nobody's bothered to answer my questions about fog/water brushes. :P

Damn my lack of experience. If I could, I would've tried to add them myself.

EDIT: BTW, can anyone tell me if I still have to use the map2dif exporter to take advantage of portals?
#13
04/06/2008 (8:48 pm)
If you really want to see what portals can do, run the stronghold mission in a debug build of torque, press F9 until everything is wireframe, then walk into a cottage. The outside world is only rendered behind the windows instead of everywhere.