[Tutorial] Areaportals - All you need to know

Psy

The Imp Queen
aa
Apr 9, 2008
1,706
1,491
Grazr is right. Look at these.

badwater-1.jpg

badwater-2.jpg

badwater-3.jpg

badwater-4.jpg
 

grazr

Old Man Mutant Ninja Turtle
aa
Mar 4, 2008
5,441
3,814
Areaportal's also stop player models from being rendered, you can consider this as well, especially for high traffic area's. Although i'm not sure about particle effects.
 

Psy

The Imp Queen
aa
Apr 9, 2008
1,706
1,491
Not really. Areaportals do split visleafs which can make VVIS take longer but for a good cause. When a large amount of time is spent on portalflow this is due to bad mapping technique and a lack of planning ahead to work in favour of how VIS works.
 

scswift

L1: Registered
Nov 11, 2009
4
0
From a programming standpoint, I think it's interesting how the engine takes the portal's convex polygon and wraps it in a 2D axis-aligned bounding box on the screen for the actual clipping. They must do this as well for the bounding boxes of the props.

Comparing two screen-space rectangles to see if they overlap is much cheaper (and easier to code) than testing a 3D bounding box against a convex screen-space polygon.

Of course you end up including a few props here and there which aren't actually visible through the portal, but that is an acceptable tradeoff.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
From a programming standpoint, I think it's interesting how the engine takes the portal's convex polygon and wraps it in a 2D axis-aligned bounding box on the screen for the actual clipping. They must do this as well for the bounding boxes of the props.
All player collision boxes are also AABB, used for testing if players are touching one another and for weapons like rockets, huntsman, and melee attacks. The flamethrower's normally-invisible projectiles are too.
 

andriod

L1: Registered
Nov 20, 2009
7
0
sorry if this sounds noob, im new to mapping.

So it will only merge if it has the same dimensions and position, and by linking them you have to name them the same.

Now my questions:
To close a certain room off you would have to link them, and to link they have to have the same name, right?
So if the above is true say you have more than 2 exits from the room, then you would have to name 3 areaportals the same, correct?
 

Psy

The Imp Queen
aa
Apr 9, 2008
1,706
1,491
Each areaportal would need a unique name if it is to be linked and controlled by a func_door. You don't need every areaportal in an area to be linked and so they can just remain open.
 

Mr Egg

L1: Registered
Apr 29, 2010
31
6
Yeah, Aeraportals seem great and all, they seem easy to put in place but... How does that work ?? ><" I mean I can use them but what does it do, exactly ?
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
Yeah, Aeraportals seem great and all, they seem easy to put in place but... How does that work ?? ><" I mean I can use them but what does it do, exactly ?

They designate large zones of the map and tell the engine: "If the player isn't actually inside this part of the map, take more time than normal to only draw the stuff they can see through the doorway, because in this case the extra processing power is worth it to avoid extra crap."
 

temion

L2: Junior Member
Aug 16, 2008
77
4
Amazing tutorial. Pretty much just doubled the FPS on my current project.