GameBanana Icon GB Article

Practical guide on areaportals placement

Hello world. We are one of the oldest mod sites on the Interwebs. Sign up and maximize your browsing experience.

  • Subscribe: Get notified of new submissions like this.
  • Say Thanks: Show your appreciation by sending will2k points.
  • Post: Give will2k your thoughts on this Article.
  • Watch: Get notified when this Article is updated.
Mascot

Join the community!

Become a Bananite

Already a Bananite? Login

Practical guide on areaportals placement

This article is a continuation of the series that I started two months ago with the practical guide on hints placement (hints about hints).

Just as with the previous one, this article is not a tutorial or a wiki on areaportals but rather a practical guide on how I proceed with areaportals in a systematic way and the prime locations to place these areaportals. For the rest of the article, I will assume that you are familiar with the working of the Source engine and you have an understanding of areaportals, visleaves and overall optimization. If it is not the case, then it is highly advisable to start on the Valve developer Wiki page (areaportal wiki) and (optimization), as well as read my comprehensive Source optimization paper (Man vs Engine) for an in-depth explanation of areaportals and optimization in general.

Areaportals are one of the most effective and deadly weapons in your optimization arsenal and should be used extensively when your map is large and detailed. As the name implies, an areaportal is an “area” where a “portal” can be placed by the portal gun in Portal and Portal 2. It is also…deep silence, blank stare…it seems that my producers are telling me this is not true. We’ll have to stop this broadcast due to technical difficulties.

Twisted jokes aside, just imagine the areaportal as a powerful gate that separates two areas in your map and cuts visibility between them. And since Source engine architecture is all about visleaves, areaportals are the natural remedy to separate and cull the contents of these leaves.

I usually proceed with areaportals in a systematic way by searching for five major locations that are prime candidates for placing areaportals effectively to help cut visibility and increase frame rate.

Doors/Windows

This is the first place that you should be looking for to place your areaportals. Due to the nature of the BSP and visleaves, doors and windows are gateways between different areas and between indoors and outdoors, therefore placing areaportals at these openings is the natural thing to do (and Source will be really happy when you do so).



Notice in the above screenshot how the two windows and two doors openings are nicely “choked” by areaportals. It is worth reminding you that areaportals should only be placed between regular world brushes that are taken into account for visibility calculation during VVIS phase; therefore func_detail, func_brush, displacement and prop_static should not count when you are attempting to place the areaportal.

Here’s another screenshot of the same place without the decoration. Notice how the areaportals are resting between world brushes once we hide all the details from the previous screenshot.



Hallway ends

After doors and windows, hallway ends are the second pattern that I look at to add areaportals. In the most basic form, you just need to add one areaportal to each end of the hallway; areaportals can range from 1 to 8 units in thickness depending on the surrounding world brushes where the areaportal will be tucked.



This is the most basic of hallways consisting of a small passage between two areas.



Hallways are not always this simple and straight and can be of different shapes and sizes but the same concept applies: make sure that both ends are fitted with an areaportal.



Here’s a case where the hallway is not straight and forms a 90° curve in its middle; notice that the 2 areaportals on its end are there just as if it was a simple hallway. If your hallway contains some extensive and expensive detailing, then it would be a good idea to add a third areaportal right at the curve as denoted by the green dots in the above screenshot. This areaportal, coupled with a corner hint, will make sure that little to nothing gets rendered from the one side of the corner while the player is at the other side. In my case, I have not added this 3rd areaportal because my hallway is rather simple and does not warrant an additional areaportal (adding it will be an “overkill”, and unlike Unreal Tournament deathmatch’s “Overkill” praised by the announcer, an overkill in optimization will start to negatively impact the overall performance due to the cost of the areaportal itself).

In the below screenshot, the hallway is rather long and thus warrants an areaportal to be placed in its middle to further delimit areas and reduce visibility.



Many folks make the mistake of not adding areaportals on all hallway ends and miss the opportunity to tightly seal and cull their areas from an optimization standpoint. Always get in the habit of scouting for all of these ends/openings and making sure that each one is neatly “areaportaled”.



To make sure you don’t miss these ends, examine each area of your map, one at a time, and tally the openings leading to it then make sure that each one has an areaportal. Once done, proceed to the next room/area and repeat. In the above screenshot, you can see how each hallway end/opening labeled from 1 to 5 is “decorated” with an areaportal to completely “seal” this room.

Horizontal

Just like horizontal hints, horizontal areaportals do exist and can prove beneficial in many situations, although they might not be needed in every map.

One of the scenarios for horizontal areaportals is when there is a relatively large area surrounded by solid walls (regular world brushes), and this area connects to surrounding areas from above those walls. The screenshot is coming right away as I can see you scratching your head trying to figure out how this area looks like.



You can see the horizontal areaportal denoted by the green arrow resting on top of the area below; you can also see the three openings (blue arrows) above the walls that connect the area to adjacent ones (notice the openings also have areaportals).

Another scenario for horizontal areaportals is the “industrial warehouse setup”.

While this scenario applies to mostly all warehouse buildings, it is mostly seen in industrial themed maps because of the way these warehouses are built. The warehouse will be mostly made of four walls (regular brushes) and a slanted roof (func_detail) with various decorations; the horizontal areaportal will be exactly at the top of the four walls not taking the detail roof into account.



The green arrow indicates the horizontal areaportal while the red lines show where the slanted roof is supposed to be. (Notice all the doors in the warehouse are nicely “areaportaled”).

While it is always better to add a horizontal areaportal to an area with four walls, it is possible to add such setup to an area with two or three walls, or even one wall (it is possible also to have the four walls replaced by four areaportals; it will work fine but the visibility culling will be less than that with at least one solid wall in the setup).



The trick here is to add the horizontal areaportal (green arrow) like you would normally do then add vertical areaportals as needed (red arrow) to compensate for the lack of solid walls (regular world brush) that can support the areaportal.

Street end

As I mentioned in my paper “Man vs Engine”, streets in Source are nothing more than large hallways. You guessed it: an areaportal at the street’s end will be needed.



Notice how the three areaportals labeled 1, 2 and 3 are placed at the end of each street. You might want to add a small vertical skybox brush (red arrow location), as thick as the areaportal itself, to better support its placement (if you don’t want to add this small brush then you need to extend the areaportal further up until it reaches the horizontal skybox brush).

Whenever you have street intersection (large city map or small town theme), think of applying the above setup for your areaportals for optimal results (an areaportal at the street’s end making a 90° angle, more or less, with the next street’s areaportal).

Large areas

We have come to the last area I look for to place areaportals in my systematic approach. Bear in mind that this kind of areaportals might not be needed in all maps but can prove helpful in specific cases of large areas with unbroken line of sight.



In the screenshot above, after hiding all details, we are left with a large wide-open area with not so many solid structures to apply areaportals as seen in the previous examples. However, we can still use a nice feature of areaportals called “view frustum culling” (refer to my paper Man vs Engine, Paragraph III.8 for a full explanation).

In this case, we add a big areaportal going from floor level to skybox level to act as a separator for this large area. Using this setup, the player standing in the lower right corner of the screenshot will have details in the upper right corner of the area culled because of the areaportal effect.



This is another example where the large areaportal separates two wide areas that have direct line of sight. To the left of the areaportal is “mid” area (labeled on screenshot) while CT spawn and surrounding area is to its right. You can see that hallway/street end areaportals are not feasible due to the open nature of the areas, and horizontal areaportals would be a hassle to setup and would only work on lower levels (up to building height). Adding this simple large areaportal will ensure that details on both sides are properly culled regardless of the player’s position on both sides of the areaportal.

Final portal

Areaportals are the most effective and powerful tools in your optimization bag of tricks. Coupled with proper hinting, they help enormously to cut visibility, avoid over-rendering and increase frame rate.

Sure they need a bit more practice than hints because of their leak effect if not used properly, but once mastered, they will become your trusty ally in your optimization battle.

I hope that this article has given you enough practical guidance and info to jumpstart your knowledge on proper areaportals placement.

Will2k

August 25, 2014

Posts

  • 1
  • 2
  • 3y
    will2k avatar
    will2k avatar Offline
    Super Moderator Joined 6y
    29,619 points Ranked 146th
    30 medals 2 legendary 7 rare
    • 1st Place - Tutorials Contest Medal icon
    • 500 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    • 100 posts awarded Exemplary Feedback Medal icon
    • 200 posts awarded Exemplary Feedback Medal icon
    • Achieved Super Moderator clearance Medal icon
    will2k avatar
    will2k
    Map Critic
  • 3y
    will2k avatar
    will2k avatar Offline
    Super Moderator Joined 6y
    29,619 points Ranked 146th
    30 medals 2 legendary 7 rare
    • 1st Place - Tutorials Contest Medal icon
    • 500 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    • 100 posts awarded Exemplary Feedback Medal icon
    • 200 posts awarded Exemplary Feedback Medal icon
    • Achieved Super Moderator clearance Medal icon
    will2k avatar
    will2k
    Map Critic
    Thanks everyone for the comments.

    The 3rd article covering occluders is ready and will be published very soon; stay tuned.
    cosa dici! avatar
    Mantra
    cosa dici!
  • 3y
    Clener74 avatar
    Clener74 avatar Turned off.
    Pyro-Zone Flag Affiliation: Pyro-Zone
    Member Joined 5y
    55,750 points Ranked 66th
    28 medals 6 rare
    • 50 posts awarded Exemplary Feedback Medal icon
    • 100 posts awarded Exemplary Feedback Medal icon
    • 200 posts awarded Exemplary Feedback Medal icon
    • Returned 1000 times Medal icon
    • Reached 50 subscribers Medal icon
    • 8-14 Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    Clener74 avatar
    Clener74
    Pyro-Zone Flag
    Pyro-Zone
    Bug Journalist
    > **Posted by SteelKat**
    >
    > Optimization is the key to smoother maps. :)

    A new discovery, indeed.

    Because cooking is the key to making good food, heh.
    • Funny x 1
    • Win x 1
    I ain't giving you a dollar. avatar
    Mantra
    I ain't giving you a dollar.
  • 3y
    NoMeerKat avatar
    NoMeerKat Offline
    Member Joined 11y
    489 points Ranked 8602nd
    18 medals 2 rare
    • 6 years a member Medal icon
    • Submitted 50 Maps Medal icon
    • Mapper of the Month, April 2014 Medal icon
    • GameBanana/CEVO CSGO Mapping Contest 2014 Entrant Medal icon
    • 1-5 Entries! GameBanana’s Christmas Giveaway 2014 Medal icon
    • Winter Warfare Entrant Medal icon
    Very interesting article. Optimization is the key to smoother maps. :)
    Banned
  • 3y
    will2k avatar
    will2k avatar Offline
    Super Moderator Joined 6y
    29,619 points Ranked 146th
    30 medals 2 legendary 7 rare
    • 1st Place - Tutorials Contest Medal icon
    • 500 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    • 100 posts awarded Exemplary Feedback Medal icon
    • 200 posts awarded Exemplary Feedback Medal icon
    • Achieved Super Moderator clearance Medal icon
    will2k avatar
    will2k
    Map Critic
    > **Posted by Crystalina**
    >
    > Very very good entry.
    >
    > :)

    Thank you, appreciate the kind words :)
    cosa dici! avatar
    Mantra
    cosa dici!
  • 3y
    Crystalina avatar
    Crystalina avatar Offline
    Member Joined 4y
    Very very good entry.

    :)
    Lost in the darkness ♥
  • 3y
    will2k avatar
    will2k avatar Offline
    Super Moderator Joined 6y
    29,619 points Ranked 146th
    30 medals 2 legendary 7 rare
    • 1st Place - Tutorials Contest Medal icon
    • 500 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    • 100 posts awarded Exemplary Feedback Medal icon
    • 200 posts awarded Exemplary Feedback Medal icon
    • Achieved Super Moderator clearance Medal icon
    will2k avatar
    will2k
    Map Critic
    > **Posted by Sweeny**
    >
    > Does it effect the performance if i put to many area portals down?

    Proper fps testing will let you know when adding further areaportals starts degrading the performance of the map.

    Please refer to my detailed post below where I explained this issue in details.

    Good luck
    cosa dici! avatar
    Mantra
    cosa dici!
  • 3y
    Sweeny avatar
    Sweeny Offline
    Member Joined 4y
    3,096 points Ranked 1452nd
    16 medals 2 rare
    • 3rd Place - Sci-Fi Skinning Contest Medal icon
    • Reached 50 subscribers Medal icon
    • GameBanana Around the Globe Contest Entrant Medal icon
    • 1-5 Entries! GameBanana’s Christmas Giveaway 2014 Medal icon
    • 5th Place - Halloween Skinning Contest 2014 Medal icon
    • Became a Studio Leader Medal icon
    Does it effect the performance if i put to many area portals down?
    Official Party Dragon avatar
    Mantra
    Official Party Dragon
  • 3y
    will2k avatar
    will2k avatar Offline
    Super Moderator Joined 6y
    29,619 points Ranked 146th
    30 medals 2 legendary 7 rare
    • 1st Place - Tutorials Contest Medal icon
    • 500 posts awarded Exemplary Feedback Medal icon
    • 50 posts awarded Exemplary Feedback Medal icon
    • 100 posts awarded Exemplary Feedback Medal icon
    • 200 posts awarded Exemplary Feedback Medal icon
    • Achieved Super Moderator clearance Medal icon
    will2k avatar
    will2k
    Map Critic
    > **Posted by Akshit**
    >
    > You rock will!

    Thanks :)
    cosa dici! avatar
    Mantra
    cosa dici!
  • 3y
    Akshit Saklani avatar
    Member Joined 5y
    18,163 points Ranked 235th
    44 medals 2 legendary 5 rare
    • 15+ Entries! GameBanana’s Christmas Giveaway 2015 Medal icon
    • 15+ Entries! GameBanana’s Christmas Giveaway 2016 Medal icon
    • GameBanana’s Christmas Giveaway 2015 Day Seven Winner! Medal icon
    • GameBanana’s Christmas Giveaway 2015 Day Thirteen Winner! Medal icon
    • 25 posts awarded Exemplary Feedback Medal icon
    • Returned 1000 times Medal icon
    You rock will!
    Fall 7 times, stand up 8! avatar
    Mantra
    Fall 7 times, stand up 8!
  • 1
  • 2

Share

Shareable Image:
Share banner
HTML embed code:
BB embed code:
Markdown embed code:

More embeddable images

Bookmark and Share

Submitter

will2k avatar
will2k avatar Offline
Super Moderator Joined 6y
29,619 points Ranked 146th
30 medals 2 legendary 7 rare
  • 1st Place - Tutorials Contest Medal icon
  • 500 posts awarded Exemplary Feedback Medal icon
  • 50 posts awarded Exemplary Feedback Medal icon
  • 100 posts awarded Exemplary Feedback Medal icon
  • 200 posts awarded Exemplary Feedback Medal icon
  • Achieved Super Moderator clearance Medal icon

will2k avatar
will2k
Send a Private Message to the submitter

Category

Stats

Posts
19
Views
6,451
Date Added
3y
Date Modified
10mo