Portals and Sunlight
by T. John Laird · in Constructor · 12/01/2007 (10:46 am) · 10 replies
As you've probably ascertained I'm new to constructor. Right now I have a two story above ground building with a basement.
One thing I keep on catching references to is portals. Can anyone explain how they work? I've looked at the TDN documentation and it is missing. I understand that someone is selling a video tutorial but I'd rather not spend the money if I don't have to.
Another thing I've read about is sunlight in constructor. It just dosen't make a whole lot of sense to me. Wouldn't the sun in the game world provide the sunlight for the building instead of constructor?
One thing I keep on catching references to is portals. Can anyone explain how they work? I've looked at the TDN documentation and it is missing. I understand that someone is selling a video tutorial but I'd rather not spend the money if I don't have to.
Another thing I've read about is sunlight in constructor. It just dosen't make a whole lot of sense to me. Wouldn't the sun in the game world provide the sunlight for the building instead of constructor?
About the author
#2
www.divshare.com/download/2191335-89a
12/01/2007 (7:51 pm)
Try this. It was suggested to me recently. Otherwise I would go to TDN and read what they have available there, the Quark website has a few good tutorials as well that have the same principles as Constructor.www.divshare.com/download/2191335-89a
#3
Afew people make portals slightly differently, but there are afew general rules. A portal must be buried inside of the brushes surrounding it ever so slightly. This means if you are placinf a portal in a hallway or a doorway that is square.. the edges of the portal must overlap those brushes just slightly.. one unit will do for overlap as well as thickness. To much can cuase issues. Next thing.. portals are regular brushes that you convert into portals through constructor in the same place the other brush types are listed (left hand side). Then, you must consider that if any two portals share the same plain, it can cause glitches. An example of sharing the same plain would be a long hallway. The mapper creates a portal at one end, then copies the same portal, and slides it down the hall to it's other side. If you can look in one of the grids and both portals line up perfectly, this is bad.
When you map, you must always keep in mind portal placement along with line of sight. 90 degree turns help nicely where applicable. By using the debug.exe, you can check your portals by pressing F9 once or twice. When you do, it will look someething like this:

If your area is all white, then your portal is not functioning appropriately.
I kind of rambled so sorry. If you have specific questions, ask them and I will give you the answers.
LK
12/01/2007 (7:59 pm)
Portals work by basically taking a an interior, and "breaking" it up into seperate sections. By adding a portal to the entrance to a room, it will effectively "seal" the room and keep it from being drawn when the player is not in it, or in the immediate area. The exception to this would be, line of sight. If an area is in the players line of sight, it will be drawn regardless if the area is portaled or not. Same for portals them selves. If you are in a room, and can see even the slightest edge of a portal.. everything on the other side of that portal will be drawn, up until the next portaled area. In this engine, structural, detail, or any other kind of brush does NOT stop VIS, so unless you use portals (which when used appropriately, will stop this) or, use fog or alter the viewable distance etc.. everything will be drawn regardless if the player can see it or not. Afew people make portals slightly differently, but there are afew general rules. A portal must be buried inside of the brushes surrounding it ever so slightly. This means if you are placinf a portal in a hallway or a doorway that is square.. the edges of the portal must overlap those brushes just slightly.. one unit will do for overlap as well as thickness. To much can cuase issues. Next thing.. portals are regular brushes that you convert into portals through constructor in the same place the other brush types are listed (left hand side). Then, you must consider that if any two portals share the same plain, it can cause glitches. An example of sharing the same plain would be a long hallway. The mapper creates a portal at one end, then copies the same portal, and slides it down the hall to it's other side. If you can look in one of the grids and both portals line up perfectly, this is bad.
When you map, you must always keep in mind portal placement along with line of sight. 90 degree turns help nicely where applicable. By using the debug.exe, you can check your portals by pressing F9 once or twice. When you do, it will look someething like this:
If your area is all white, then your portal is not functioning appropriately.
I kind of rambled so sorry. If you have specific questions, ask them and I will give you the answers.
LK
#4
Question: Must a portal only be touching 4 brushes, or can it be more? If it can only be 4, how would you portalize an arched doorway?
12/05/2007 (8:57 am)
Wow Andrew, I appreciate thorough answers like that, so ramble away! I think my coplanar portals have been causing me problems with my current constructor project. It would be awesome if static lights and sunlight affected portalized areas' lightmaps too, so you wouldn't get a harsh line at the portal boundary. Hmmm, maybe I'll put that on my Christmas wish list!Question: Must a portal only be touching 4 brushes, or can it be more? If it can only be 4, how would you portalize an arched doorway?
#5
Scene > Manage Entities...
Select your portal from the left and change the 0 to a 1 for the 'ambient' setting on the right.
As for the 4-brush thing ... not sure because I have multiple brushes around my doorway and I'm having issus. I was just about to mess with it, in fact, when I saw this post. I can tell you that if you have multiple brushes, they need to be 'flat' in the openning ... I have a cave section that wouldn't export if until some/most/all (depending on the cave section) of my brushes were flat in the opening ... the ones that were in direct contact with the portal .. or at least so it seemed. I have also had some (limited) success though too, with these multiple brushes .. so it seems more random. Anyway, my example has approx. 29 brushes in the opening, if I'm counting/thinking about it right.
12/05/2007 (9:28 am)
You can allow the sun to pass through the portal, actually. 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.
As for the 4-brush thing ... not sure because I have multiple brushes around my doorway and I'm having issus. I was just about to mess with it, in fact, when I saw this post. I can tell you that if you have multiple brushes, they need to be 'flat' in the openning ... I have a cave section that wouldn't export if until some/most/all (depending on the cave section) of my brushes were flat in the opening ... the ones that were in direct contact with the portal .. or at least so it seemed. I have also had some (limited) success though too, with these multiple brushes .. so it seems more random. Anyway, my example has approx. 29 brushes in the opening, if I'm counting/thinking about it right.
#6
12/05/2007 (10:04 am)
Thanks Woody, that was helpful (and easy)! I made all my portals non-coplanar as Andrew mentioned, but the house I'm working on still won't portalize properly. In debug mode, I hit F9 twice to see the zones (that's a cool feature, btw) and the house remains textured and lit, while all other dif's in the scene turn white and the zones are colored as expected. I'm stumped.
#7
12/05/2007 (11:05 am)
Thanks for the help. I have an arched doorway too...so I'll let you know how it turns out.
#8
12/14/2007 (7:50 pm)
Ryan, there is likely a small leak or something similar in your room(s). Also, double-check and make sure that your outter wall brushes are all structural and not detail. You could always send it over ... maybe something will jump out at me, maybe not.
#9
12/16/2007 (10:21 pm)
I seem to have gotten the portals to work. Having to overlap the portal brushes kind of bothers me though. Kind of a brokedick way of doing things. If it works, it works though. Thanks for the help.
#10
No, A portal may overlap with more than 4 other brushes and still work appropriately.
This is odd, since any dif that is not portaled, or not portaled correctly when using this render mode will appear white. Of course, you will need to enter the actual dif to see if its portaled IF the outside "walls" (brush faces) have any other texture on them except null. I have not tried multiple difs in this render mode to see if selecting one effects others, but seeing textures and lighting hints to me it has nothing to do with the portals themselves.
Yes, depending on a person's background.. what side of level design they may come from, overlapping brushes may feel very strange. I think the overall reason is, during compiling/converting, a brush may be moved ever so slightly.. maybe like .00001. because of this, if we lined up portals perfectly, there would always be a chance that once you opened the dif, the portal would technically no longer be lined up with the other brushwork. I can relate, having been trained that overlapping brushes was a huge no-no in all circumstances, that any brush face not seen, has no business being there, and all angles should be joined at 45's. :p
12/17/2007 (8:43 am)
Quote:Question: Must a portal only be touching 4 brushes, or can it be more? If it can only be 4, how would you portalize an arched doorway?
No, A portal may overlap with more than 4 other brushes and still work appropriately.
Quote:the house remains textured and lit, while all other dif's in the scene turn white and the zones are colored as expected. I'm stumped.
This is odd, since any dif that is not portaled, or not portaled correctly when using this render mode will appear white. Of course, you will need to enter the actual dif to see if its portaled IF the outside "walls" (brush faces) have any other texture on them except null. I have not tried multiple difs in this render mode to see if selecting one effects others, but seeing textures and lighting hints to me it has nothing to do with the portals themselves.
Quote:I seem to have gotten the portals to work. Having to overlap the portal brushes kind of bothers me though. Kind of a brokedick way of doing things. If it works, it works though. Thanks for the help.
Yes, depending on a person's background.. what side of level design they may come from, overlapping brushes may feel very strange. I think the overall reason is, during compiling/converting, a brush may be moved ever so slightly.. maybe like .00001. because of this, if we lined up portals perfectly, there would always be a chance that once you opened the dif, the portal would technically no longer be lined up with the other brushwork. I can relate, having been trained that overlapping brushes was a huge no-no in all circumstances, that any brush face not seen, has no business being there, and all angles should be joined at 45's. :p
Torque Owner T. John Laird