areaportals used in outdoor maps

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

areaportals used in outdoor maps

Post by bdbodger »

I just did an areaportal a new or should I say different way for an outdoor map . What I did was cut a skybox in half with a script_object with an areaportal brush inside it and nodraw on the script_object . then I did

$myobject openportal

when I wanted it to open . Worked good I think it is a better way that a lot of targeted vis leafgroups . I mean if your map has corners you can walk around you can close off parts of your map at will . A lot of corners mean a lot of areaportals you can make so the only parts of the map being drawn can be a smaller space . I had a plane fly in and some ai run in from an area on the other side of the portal because nodraw is notsolid it worked ok . I was thinking makeing some portal walls .

what do you think about that idea ?
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

It sounds interesting, but I cant see how it would be better, easier, or less complex than using vis_leafgroups...

And if I'm not missunderstanding you, you can only use it for SP maps as (to my knowledge) opening an areaportal affects everyone in the VIS group affected by the areaportal.

Can you give a more detailed example of how you used the areaportals? I'm not sure I understood exactly how you used them...
Admin .MAP Forums
Image
Head above heels.
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

it is for single player . The other method was to make vis leafgroups and target them but if you have a large map that is a lot of targeting or can be but if your map had areaportal walls that you can't see you could open or close them at will . It's just an idea but lets say you made a map that was outdoor but more like a hallway with sky and rooms . you could do like you do for a building and section it off with these portal walls . I made a map once that was T shaped when I stood at the bottom of the T I could see what was at the ends of the T at the top right and left I couldn't shoot because the bullets went outside the skybox but I could see the ai's . Yes you could target it but if you used the portal walls all you need to do is make one wall at one way into the area and another at another way into the area and maybe control them with triggers . You could put 4 walls around an area to hide what is inside . I don't know can you just remove a vis leafgroup or turn it on or off or retarget it ? I was just looking for ways to improve frames .
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Now I see what you are suggesting. And yes, that seems like it will work. But I'm still not convinced that it is simpler than using vis_leafgroups. Just the areaportals are simple enough, but as you need triggres and scripting to control them, the complexity will rise quite a lot.

I'd say: If it works for you, use it. If not, don't... ;)
Admin .MAP Forums
Image
Head above heels.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

openportal

Post by tltrude »

What does "openportal" do? Is it a script line that a trigger activates?

I have managed to put in 8 areas in my map, but they didn't do much for the fps. I even put in two vis_leafgroups and still I get low fps when outside where the skybox is.

My areas seem to leak too (looking at it with tris 2). Only parts of the map vanish when I am inside an area. It seems to be caused by brushes that are part of more than one area--like a floor brush. I guess I just don't know how to define an area properly.

In one area, a hallway with doors at either end, I noticed that a large group of detail brushes were not being removed outside the area. But, script_object brushes were being removed. So I turned the detail brushes into a big script_object, but I should not have to do that.
Last edited by tltrude on Fri Oct 03, 2003 6:13 pm, edited 1 time in total.
Tom Trude,

Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Re: openportal

Post by Bjarne BZR »

tltrude wrote:What does "openportal" do? Is it a script line that a trigger activates?
openportal and closeportal opens and closes an areaportal explicitly ( in scripting, yes ). Normally you put them inside doors, and this opening and closing of the portal is handeled automatically without the need for scripting... however, sometimes you need to control it manually. Like this thing bdbodger is suggesting, and when you script a door yourself ( as when making doors that rotate up or down ).
Admin .MAP Forums
Image
Head above heels.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Targetname

Post by tltrude »

How do you targetname the area when you have a hatch? I see how bd did it, but ..........
Tom Trude,

Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

You don't targetname the area, you targetname the areaportal separating the areas.
Admin .MAP Forums
Image
Head above heels.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

Script_object

Post by tltrude »

So, how do you turn the areaportal brush into an entity with a targetname? My area brushes are worldspawn!
Tom Trude,

Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

actually you can't name the area portal itself if you do it becomes an entity and you will get an error during compile that says areaportal only allowed in world . You need to put something around the area portal like a script object or door . Then when you use openportal it will open the areaportal that it surrounds . Like a trap door or in my case I used a script object with a nodraw texture . I thought of another use for it . You know how area portals don't work for room with a window what if you put a couple of area portal walls to the left and right outside the window where you can't really see them . You are right about the scripting needed for some of these but at least it is controlable by script where I don't know if you can do that with vis leafgroups has anyone tried to target one vis leafgroup to another from script ? Or un target them ? Brushes that are in or partly in both areas separated by an area portal will draw the brushes need to be fully inside or outside the area .
crunch
Major
Posts: 348
Joined: Sat Jun 14, 2003 2:34 pm
Location: USA
Contact:

Post by crunch »

Yes, the area portal idea outside in a single playermap can be an effective way to cut your map in half, or thirds, or fourths, etc......
But, if you simply cut your map in half, and have a portaled entry to the other section, then that entire section will be drawn all at once, and your FPS in each area is not as high as it can be.

By using vis_leafgroups, you can easily divide your areas further than simply having 1/2 not see the other 1/2.

Also-----area portals DO work with windows, and that is the reason NOT to use them. If you portal a room that has a transparent window, the inside won't be drawn, and this "blank area" can be seen from outside.

Von used the open/closeportal command in a trapdoor script in Alsace, and it worked great. But it separated an underground area from an aboveground area. For the skyboxes (of which we had a few), we created "vis-seals." These seals were placed in the opening of the skyboxes where 2 met.
By targeting all the leafgroups in an area to these seals, nothing beyond it was drawn, and a solid vis structure was left intact.
Another hint when using vis_;eafgroups in an outdoor map.......make them touch the top and bottom of your skybox. This will prevent any unnecessary portals being created. (Another Von-vis idea that is excellent.)

As you can see, I am a strong proponenet of vis_leafgroups over area portals to seal outdoor areas from eachother.

Kill Ya Later!
Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Well... I'm sorry... I remembered wrong. Thanx for putting me in my place :)

Here is the script for a hatch with an areaportal covering the hatch hole:

Code: Select all

setup_hatches:
	// Hatch to lower deck
	level.hatch_open = 0
	level.hatch_moving = 0
	$hatch_trigger_opened hide
	$hatch_trigger_closed show
end

use_hatch local.close_only:
	if(local.close_only !=1 || ( local.close_only ==1 && level.hatch_open) ) {
		if(level.hatch_moving == 0) {
			level.hatch_moving = 1
			local.hatch_time = 1

			$hatch time local.hatch_time

			if (level.hatch_open) {
				$hatch rotateZup 90
				$hatch_trigger_opened hide
				$hatch_trigger_closed show
				$hatch playsound hatch_close
			} else {
				$hatch openportal
				$hatch rotateZup -90
				$hatch_trigger_opened show
				$hatch_trigger_closed hide
				$hatch playsound hatch_open
			}
			level.hatch_open = !level.hatch_open

			$hatch waitmove
			level.hatch_moving = 0
			if(!level.hatch_open) {
				$hatch closeportal
			}
			if(level.hatch_open) {
				thread hatch_auto_shut
			}
		}
	}
end

hatch_auto_shut:
	level.time_left_to_auto_shut = 3
	if( level.auto_shut_active != 1 ) {
		level.auto_shut_active = 1
		while ( level.time_left_to_auto_shut > 0 ) {
			level.time_left_to_auto_shut --
			wait 1
		}
		thread use_hatch 1
	}
	level.auto_shut_active = 0
end
...as you can se the areaportal related commands are given to the script_object hatch, not the areaportal itself...
Admin .MAP Forums
Image
Head above heels.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

doors

Post by tltrude »

Ok, I get it now. That hatch seems a bit over-scripted to me, but I am seeing it out of context.

I have some more dumb questions. Can you use a single area brush on a set of double doors? What does "area brush not touching two areas" mean?

My map has a large "L" shaped cave area in the center with many exits. I can butt closed off areas to it, but I can't get it to be an area itself. So, all the doors have area brushes except two. Those two doors ( one is a double door) seperate the cave from the outside (skybox area). There is also a third hole filled with (wall exploder) script_object brushes. If I try to put area brushes in any or all of those three places I get the "not two areas" error. One of the two doors (the single one) can be seen in the screenshot below.

Image
Tom Trude,

Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Re: doors

Post by Bjarne BZR »

tltrude wrote:Ok, I get it now. That hatch seems a bit over-scripted to me, but I am seeing it out of context.
Well, it is a bit complex... it started out simple, but then I needed it to work in a more complex manner so thats what I ended up with... not very good as a tutorial script I guess ;)
tltrude wrote: I have some more dumb questions. Can you use a single area brush on a set of double doors? What does "area brush not touching two areas" mean?
I think so...
The brush must seal of one area from another (by itslf or together with other areaportals). My guess is that you havent created separate areas properly.
tltrude wrote:My map has a large "L" shaped cave area in the center with many exits. I can butt closed off areas to it, but I can't get it to be an area itself. So, all the doors have area brushes except two. Those two doors ( one is a double door) seperate the cave from the outside (skybox area). There is also a third hole filled with (wall exploder) script_object brushes. If I try to put area brushes in any or all of those three places I get the "not two areas" error. One of the two doors (the single one) can be seen in the screenshot below.
Put areaportals through all the doors and the wall exploder. Script the one through the exploder manually. If these areaportals seal off the area together: you should be up and running. Remember to cover the openings completely and overlap a bit so there are no leaks,
Admin .MAP Forums
Image
Head above heels.
crunch
Major
Posts: 348
Joined: Sat Jun 14, 2003 2:34 pm
Location: USA
Contact:

Post by crunch »

You can use 1 area brush for a set of double doors. Keep the origins within the bounds of the door brushes, and be sure that it's frames are not detail if the frame brushes that are on the inside are also the same brushes that are on the outside.
For your "not touching two areas", that could be caused by several things.(Including detailed door frames)

Most likely, it is the exploder. Like a skybox, an "area" that is portaled needs to be completely sealed and structural. So all the outer borders of the area must be structural. The exploder is an entity, and thus not structural, so putting an area portal there will not work.

I would suggest making an L shaped bend in the exit somewhere (either before the exploder or after), that can then be sealed with a hint brush. The hint will create the structural brush necessary to seal the area. (You won't need an actual area brush in that spot if you add the hint brush.)

All the doors will need area portals, also.

I noticed there is a large glass atrium in the cave (very nice, BTW!).....I take it that the area beyond it is also part of the same portaled space. Therefore all the outermost brushes there must also be structural.

Hope this helps. Kill Ya Later!

EDIT: I did not see Bjarne's post before I submitted this reply... (I guess it took at least 9 minutes to type)

Bjarne mentioned scripting the portal for the exploder.....I would not recommend this, because then the portal cannot be closed after the explosion. The hint brush will seal the portaled area and keep FPS up even when not in that area after the explosion takes place.

I have also always filled the door opening with exactly the same size area brush as the door. (Overlapping actually generates extra portals.)

Just curious Bjarne, have you noticed any adverse effects doing this? Perhaps the difference is minor, and either way works just the same.
Image
Post Reply