Ads keep us online. Without them, we wouldn't exist. We don't have paywalls or sell mods - we never will. But every month we have large bills and running ads is our only way to cover them. Please consider unblocking us. Thank you from GameBanana <3

Using Tools Textures: Part 4 - A Tutorial for Source Engine.

Tools Texture Use: Part 4

             
Tutorial Quick Nav
1.0 - Brief Intro
2.0 - Areaportals Effect
3.0 - Proper Uses
  3.1 - Intro
  3.2 - Valve Map Examples
4.0 - Getting Started
5.0 - General Areaportals
  5.1 - Brief Situation Intro
  5.2 - Sealing Your Entrances
  5.3 - Leaks - They happen
6.0 - Areaportal Windows
  6.1 - Brief Situation Intro
  6.2 - Sealing Your Windows
7.0 - Final Words/Warnings

Brief Intro

Areaportals are among the best and greatest of optimization techniques in source mapping, quite simply the strongest and most effective form of breaking your level into many different sub-levels that can be rendered individually with absolute control by yourself where and when this slicing will occur, hint brush's can do this same effect yes, but they are just that, hints for the engine to consider but it may not know the intention in which you placed it there. That is where areaportals come into use, no matter what they will be used as you set them, the engine cannot ignore anything done or set with your areaportals. That fact alone makes them useful in several different situations. For those familiar with hint brush's and vis leafs and what they all are in both the compilation process and final bsp product of a map, much of this will be the same with a few new twists and options thrown in, Be warned, this is a very touchy tool to work with, if not handled correctly you will do more harm than good, at best a failed compile / leak, at worst...well, we won't go there just yet. Much like hint brush's and vis leaf effects areaportals are also a client sided effect, where each user will have a different view on whats rendered and whats hidden, so if one person enters an area and the rest of the areas are off to him, doesn't mean another player in another area will have their current spot turn off too. While the visual effect itself is client sided, the server still controls them. The I/O triggered open/close states of areaportals enabled on all clients, so a closed/open areaportal in this case will be the same to all users. So their use must be chosen carefully otherwise you could wind up in a situation where you have an areaportal brush close and remove a section of the map that shouldn't be removed in another persons perspective if you've placed it very poorly in the open. Thats why they must be used correctly to avoid these errors. Its much easier to design levels with all your optimization in mind first rather than as an afterthought as you will find that brushwork you thought turned out so well then becomes your worst nightmare, now don’t get me wrong its still very possible to optimize levels after the fact, its just more time-consuming and tedious to do in most cases. Nothing wrong with making a section messy and fixing it up afterwords, just make sure you do go back and fix it. While I do suggest that any mapper interested in getting the best performance out of their creations read this tutorial, I still however, encourage you to look over some other basic optimization tutorials on hint brush's / vis leaf editing or some of my previous tools textures to start getting a feel for how delicate some of these systems can be. Especially if this is going to be your first jump into proper optimization, don't want to bite off more than one can chew here as you will just end up destroying your level. So please browse through the tutorial section here and read and understand the simple vvis process and hint/skip work before trying these out.

Areaportals Effect

The effect that can be gained by areaportals themselves are among the best if not top tool in which to optimize any level. What the areaportal texture itself can do can be compared to that of the cordon tool some of you may have experience with in the past. That hammer tool comes in handy for level designers in the beginning stages of their maps when they want to see sections of a map built quickly without having to process the rest of the map. It “Cordons” off the area you want, the same with areaportals, they enclose each area you would like to be its own separate section of the map to be rendered on its own with no external parts of it visible/processed, excluding a 3d skybox of course. And just like the cordon tool the areaportal brush will become the texture of the skybox you have selected in correct scaling and placement. Keep that little note in mind at all times as you don’t want something to be hidden by your sky when it makes no sense to be if using triggered areaportals in an open section of the map. In the screenshot provided you can see that there is nothing but a simple hallway with alternating colours on the floor, Now where the caution strip is in the screenshot, thats the area where we have placed our triggered areaportal to seal off that part of the level. So we step into the area that triggers the areaportal to turn on and viola: The level has been cut in half completely, no models, brushes, decals, overlays etc. That no longer exists in the level and doesn't have to be processed anymore. Now a player on each side only sees their respective half, objects, bullets, props etc can pass through areaportals and be effected by objects on the other side as if it was not there because areaportals are just a visual effect to help computer performance and not a solid wall, the server still knows where everything is and you can walk through an areaportal just fine, it will simply hide the other half of the room for you. Just note, bots and NPC's do not take closed or open areaportals into consideration on whether they can see you or not, server says that your in their line of sight they will shoot regardless of your view towards them being disabled by a closed areaportal or completely opaque areaportal\_window. HL2 campaign has a few moments like that for those who notice them anyways :P Open areaportals have a benefit as well, most think of an open areaportal as a disabled one from experience with other tools, such as the occluder. Where when they are on they block what they are meant to and when off they don't do a single thing. Well, for areaportals this is not true. Both in the open and closed states they perform a function. Multiplayer games have the best use of open areaportals with closed/toggled ones used only on doors. The reason behind open areaportals being the main use is due to the aforementioned error that you could wind up with with toggled ones used in situations they shouldn't be. When in the open state they don't block off everything from that and beyond it as with the closed state, but rather block what you don't see through the areaportal itself. Think of it as a filter, removing all the visleafs that are to all the other sides of it leaving on the leafs that you can see through the areaportal being the ones rendered. Now while you could potentially achieve the same effect with some hint/skip work, but why take all that extra work to make every possible angle on all entrances/exits when you would probably just make a huge mess of the visleafs anyways. Heres a comparison of the normal rendering done with just basic visleafs and then below it one with an areaportal to filter your view. *Any connected visleafs are rendered in the other room.
*Only visleafs within the perspective through the open areaportal are rendered. So now you can understand just how much this single tool can improve your level designs in terms of performance and speed. You can manually specify what you want the player to be able to see, unlike normal hint brush’s which can have several if not all leafs visible if it sees fit, even if you do not think it will act that way, 90% of the time normal vvis fails at understanding just how your level should be broken up and what should be visible at what time. It happens, no system is perfect, so we have our tools to use to improve this. Lets get to it shall we?

Proper Uses

Intro

Like any tool in real-life and in hammer, they must be used only when it is appropriate in which to do so, Can't use a sledgehammer everywhere even though it would be fun now can we? So we're just going to go over what you should and shouldn't be doing with areaportal entities in your levels. Now I may be using some terms that you don't understand but I will try my best to explain some concepts, using dictionary definitions if I have to. You should try to build maps with each combat area in mind beforehand with access between them via paths, ie for a DE style map, there are generally around 7 different areas that make up the map, 2 spawns, 2 bombsites, 2 staging areas for those sites and Mid of course. These are your main zones for players to fight against one another, so we should limit what they see and interact with to just this single zone so that they get the best performance out of their own computers. So areaportals come in to divide the map into their each respective sections resulting in these main areas. But they should ONLY be used to define these zones in such a way that you have not overly complicated the system in which it functions, overuse of areaportals in a small space can create worse performance for the clients computer than if you didn't have them at all. Its all about smart placement, not spammed.

Valve Map Examples

CS_Militia
This map uses areaportals mainly on all the entrances to the house containing the hostages, all the windows and doors have areaportals on them to make the interior completely unknown to a player outside the map. Now without the areaportals sealing the map where the doors are, the players computer would actually be rendering whats behind those doors because props and entities do not effect vvis and therefore are considered as objects you can see though. So an areaportal is the perfect tool to fix that problem. Every areaportal used on a door has a setting built in to select the door entity itself so it will control the areaportals current state by its actions, freeing you up from having to set up some I/O system with trigger brushes to enable/disable it on its own or to have the door send commands to the areaportal manually. This quick and simple setting is one that should almost always be used whenever possible. Less work in programming and more work on the actual creation of the level.
Now there are two types of areaportals, the standard and the window version. Militia has both of course. Wherever there are windows, areaportals are most likely used. Such as with the back and front of the house. Every possible view/accessible way into this cabin has been sealed by either a standard areaportal or the window variation, in any case it provides the best optimization that you can't get from just normal hint and skip work alone. They only make up about half the optimization that a map should have done to it. Now while this is a powerful tool and you probably still wonder why its not used everywhere, well, overuse in itself would just complicate things and lead to errors, so you see why areaportals were used only on the house itself and not the outdoor areas around it. Separating the map into the two basic areas, Indoor and Outdoor :P. This vmf is provided with source SDK by default and you will find it within your sdk's mapsrc folder. So if you want to look at it in more detail/understanding its there for you to fool around in. CS_Assault
The first and formost example of an areaportal for cs_assault is of course the two doors entering into the warehouse from the side. These are 2/3 of the only areaportals in the map that change state from closed to open. They are just standard areaportals that have been set to open/close depending on the state of the door they are used with. Door opens, areaportal opens. That simple.
Now these doors do not cause leaks in the map because also placed within the warehouse are open areaportals to define the space thats getting removed from the other sides of the doors, which encompasses the entire inside including vent system. Which is a good thing :P because we don't want to be able to see all that when from our view the only thing thats in front of us is a brick wall and a door. As you can see on the screenshot on the left here, there is an areaportal to seal the warehouse as just mentioned, and also a rather odd thing one might think is that they also added one into the small shack thats just outside the back area of the warehouse. This is just yet another open areaportal for nothing more than filtering out the models and details inside the shack when from other angles and not directly looking inside it. Small performance boost for an area where snipers need their best to spot quick movement. So the use of it doesn't really drain that much from processing the removal of the models and geometry thats there. Small area in a rather bland place, no harm done.
Contrary to what even I thought, the hostage room within the warehouse is actually broken into two areas for performance, the first being that just after the doors and around to the frame into the second pair of hosties. The areaportal on the double doors is the last of the three areaportals that changes states from open to closed based on door state. The second areaportal in this room is just a normal always open areaportal as seen throughout the rest of the map. Its use here is simple, remove all the extra detail that they had thrown into the room, the TV, cabinets, chair, trash etc that could put a drain on a pc the second the double doors would open, giving the player a sort of stutter effect upon opening them where frames just drop at the sudden addition off all that. So again, the small addition of a single area to filter out these details allows you to give small rooms details that you probably couldn't do to it hampering the gameplay experience.
The vent system has 3 areaportals within it. One at the top where the ladder down into them is, another at the entrance into the main area as seen in the screenshot on the right and also another at the grating that comes down just in front of the hostage rooms. All of them again are just to help filter out the extra detail and props that are all around the room the vents are suspended in. Now, because of how visleafs work, just by seeing out of them would make all connected visleafs within a rather large area begin to render. That would be bad, so using the open areaportals to filter out all unneeded leafs other than those from the players perspective and through the areaportals performance is increased drastically than if they were not there at all. That brings the total separate areas within the warehouse to 4. The main warehouse floor, initial hostage room, back hostage room, and lastly the vent system just mentioned. No real need to add in anymore, say in the stairwell from main floor to catwalks because an occluder along that wall does well enough for performance and another areaportal there would be a bit wasteful on processing because of the current number in the area.
Thats all the areas within the warehouse, now onto the more interesting aspect of Assault, the outdoor optimization. Areaportals in outdoor environments can help a great deal, much as they have been in the creation of this map. There are a total of 4 areas separated from one another outside of the warehouse. Theres CT spawn, the underpass area beside it, back corner of the train overpass and then the area surrounding the warehouse itself. The way that the two larger areaportal brushes are used in the screenshot to divide the level up is among their best uses. The optimization of outdoor detailed areas. Because its got some rather large and open spaces the visleafs as well would be fairly long and take up a lot of area as well, so when you see a part of it your computer would render everything within it, even if it went from one side of the map to the other that you cannot see. So the areaportal breaks this up and then limits the leafs that are seen as you go around the corner to those only needed at those points rather than the entire section at once. CS_Compound
Theres not a whole lot of areaportal use in this level because its a fairly large and empty one when compared with many others. So examples here are basic and simple ideas. Now the only two places that are considered areas for compound are the hostage room and the white building closer to CT spawn, other than that the rest is left to be done by hint/skip work and visleafs. The hostage room itself has been designated its own single area as already stated, both via the door with areaportal attached to it as well as the holes in the roof to seal the area. There isn't a lot of detail in the room, but there are hostages and some trash props etc. But since knowing and seeing whats inside doesn't matter till you either go into the room via the door or look through the top roof. Really wouldn't hurt performance if the visleaf inside was rendered when looking at the door but again, just little things to help even the worst of computers.
The other area within the map has 3 areaportal brushes in use, even though in the screenshot you can only see 2, but the third portal is on the other doorway on the outdoor part of the building facing CT spawn. So there is the incredibly tiny space for one area between the two doors into the building, then the main interior of this one containing a few large models and also quite a variety of smaller trash and detail ones. Now if you were wondering why they didn't use more than those just mentioned, and like assault it is an outdoor area, but unlike assault, it doesn't need areaportals to optimize the space. Compound only needed them in the few areas that had more detail than the rest of the map, there is little to no detail given to the outside playing field or the skybox details as there was in assault. it had complicated brushwork, textures and props all around as the buildings, walls, skybox details. Compound has very little of this so none were included. DE_Prodigy
Prodigy is another well detailed map from valve, underplayed due to gameplay imbalance but still a good map nonetheless. With all the style there is to the map, the use of areaportals is minimal, like compound. The only places that they are used is to seal off all of the vent system into their own section so that only pieces of either the rest of the level or the vent system are rendered from either side rather than entire sections of a room you don't need to. Even though not a whole lot of areaportal use in this level, showing the selections for where to make areas themselves is still a good point to make and keep in mind at all times. Valve could have added in more areas to the map, but each room is relatively small anyways and doesn't cover a whole lot of ground, so vvis and hint/skip work does keep performance running smoothly in any case. The only large rooms are the hall from T spawn to bombsite and the T spawn itself, the first is rather narrow and basic brushwork with several models used, but still nothing too draining on resources, T spawn just has several larger models in use but little details elsewhere, that and it doesn't need any performance increase because it doesn't see any play during the game other than the initial start of a round.

Getting Started

For the duration of explaining and showing how to go about creating/fixing/checking areaportals I will be using a relatively completed Map In Progress available for download from here, DE_Inner-City by . It has several good aspects to it that make it perfect, one, to show off how to seal areas and what needs to be done, and two, a good testing ground for you to do the same thing if you wish while or even after reading this tutorial. Don't be afraid to rate it while your there either, or complete the map itself for that matter. Section exists for that purpose. Anyways, back on track. Here is an simple overview of the entire map. I've made different sections highlighted with various colours to show off how I would be breaking this level up into its different areas. You could do it even further to have all intersections separated but that could add up just too many areaportals to provide benefit. These are some of the ones I'm going to be making during this tutorial, you may have chosen different groups/divisions and thats perfectly fine, I may even have missed some I could have done but for the moment just the basics will be fine for this tutorial and also has to do with that the map is not complete so sections are missing as a result :P

General Areaportals

Brief Situation Intro

For those that haven't downloaded and taken a look at the map already, the completed sections of the map in terms of structure are the snipers nest on the upper left corner of the overview, the street and underpass below that, the offices and elevator building, the warehouse section and side entrances, and lastly the sewer system and the few roads connecting everything. As the map is for the moment, as most new mappers do constantly and the experienced ones use only in initial creation and testing of maps, the entire level is inside one giant box. This is hell on vvis to process and then as a result, for us to create and use areaportals in. But it takes no time at all to redo the skybox and have it hug all the walls around the routes for the map so it can then be broken into its smaller chunks by ourselves. Now thats a rather quick and dirty fix I've done as personally have no intention of finishing/polishing the map, just using it for the examples. But you can see the benefit from making the skybox conform to that of the level itself rather than resorting to the giant box method. So now that the level is in proper form to begin work, lets start with the most complete area of the level, The snipers nest.

Sealing Your Entrances

Doors When you move around in the map the snipers nest has a total of three possible ways to see in and out of the building. The main door, upper sniper nest itself and then also farther down the side of the building is another opening onto the street. These all need to be sealed and set up with areaportals. Starting with the main entranceway, first going to start by adding in an actual door rather than leave it left wide open, just so a closed areaportal can be used in this case to help performance, the player doesn't need to be able to render the interior when looking at the door, just went they actually intend to go inside by opening it. Most doorframes should be func\_detail, since they pop out from the wall obviously, rather than make more visleafs than needed they are set to func\_detail, these ones aren't so its a simple matter to do that right now. Once thats done the door itself thats set within the frame needs to have some settings done to it for the areaportal to be toggled by its open/closed states. First and only really required setting is we need to give it a name, keep names unique and simple if possible. Going to use just sn\_d1 for the tutorial.
Now onto the areaportal creation, since the door frame is a func\_detailed object that means the areaportal brush that we are creating within the door needs to also stretch and meet with the normal world geometry. Just making it the same size as the door would cause a leak in the end since there would be a gap around the door where the func\_detailed frame was. The areaportal brush has to be inside the door rather than the same size or extending beyond the front or back, as it will remove the door when in its closed state, and we want to hide the effect. So with the areaportal brush thinner and coving the opening of both the door and the frame as well, time to give it the settings we need. Theres just the 4 settings available for the standard areaportal: Name, Name of Linked Door, Initial State and Portal Version. Portal version never needs to be touched or changed as its something for valve when making new things, not really for public use. The only settings however we will be using for this particular areaportal is setting the linked door and its initial state. So using the name we chose in the first part we add that into its linked door setting, and also set its initial state to closed as the door starts closed naturally. Should end up with the same thing as seen in the image on the above right. General Entryways
The destroyed hole in the wall on the second floor has the cut of brushes all around it set to func\_detail to help vvis. Always try to keep in mind that areaportals need to seal normal world geometry, func\_details don't seal anything. So we're going to create another areaportal brush that fills in the entire space of the hole. Now because this isn't a doorway, the areaportal brush should just be left flush with the existing size of the wall its being used on. Areaportals can overlap both normal geometry and func\_details. But its best to keep them as restricted as possible to the area they are needed in rather than needlessly extend their boundaries and effect where its not needed. Now tie the brush to func\_areaportal and check to make sure its initial state is set to open, not closed. Thats all that needs to be done, so for the moment should have something similar if not exactly like the image on the right.
Now its time to seal the last entrance for that area, the street level opening. This one is a bit different, its not a simple section or hole in the wall but rather a corner cut out of the building. So that requires either one of two options to be done. The easy way and just set the areaportal a bit farther in the building and seal off the stairway at the bottom, or the other option and create an angled areaportal from both edges of the cut out corner. Myself I'm going to do the latter as the destroyed building could potentially have a lot of detail within that room with props, decals etc from the destruction. The idea may have entered into your head to have two areaportals just connect at the corner along each wall, but that would cause an error of a different kind. Areaportals can only be made out of one brush and two areaportals can't be touching along any edge. Now unlike the previous destroyed section, this one isn't made out of func\_detailed brushes, but displacements, which also don't get counted in the vvis process or seal the map from the void etc. So using the edges of the only world based brushes as the sides of our new areaportal we get one shaped as seen in the screenshot on the right. You can make that shape either with the cutting tool or just vertex manipulation to line them up. Now that we've sealed this area on all possible ways in and out of the rooms, time to do a compile and see if its worked. Recommended for a BSP only compile, no vis or rad at this point as we only want to see if our area is as sealed as we think it is. If you get errors in console, skip down to the Leaks section and follow those guidelines.
Right away I can tell you that if you've been following this tutorial and using th source map provided, your map will have an error from the start. Using the autovisgroups on the right panel, tick of the func_detail option near the bottom. You will see the stairs have now been hidden as seen on the right and the skybox, or void, is visible behind them. Depends on how or if you fixed the single box shaped skybox for the map. So a small fix needs to be added, just a nodraw brush placed behind the stairs to seal each gap on each flight there is in sniper nest area. Once thats done, attempt another BSP only compile, if there are no areaportal errors then you have just successfully created a working and functional area within the level. If your still getting them, follow the guidelines in the leak section. Once working, time to load it up and see how it all works in-game. *Use of the r\_drawportals console command to view portals in-game. From the above screenshot you can see how the inside area no longer renders the outside geometry through the door, or how it filters out the visleafs when looking out either the sniper nest or street connection area to only those within the perspective of the player, increasing how much more resources we have to process all the details and perform smoothly in game with high frame counts.

Leaks - They Happen

Because the areaportal acts like a cordoning tool in-game, each area that you seal off with this entity can leak independently of each other, that’s not so good, but the reason why is pretty clear. Since each of these areas are now considered their own levels when active, if there is a way that it can get outside of itself in any way, then just like a normal map, it will leak and a compile will fail or cause other errors. Now when loading the pointfile, you may be confused to see a red line going from inside your map to inside your map, that’s due to the areaportals again, you need to take a good look at the situation in which you used these entities and make sure that every entrance was sealed completely with the areaportal entity. When in doubt, just compile BSP only, then load the pointfile, seal the gap in the area as shown, repeat as many times as necessary. There cannot be any gaps, just like a normal map that will allow something to get outside of these areas. Precision is something you will get used to. Now you might as well optimize the use of these areaportals as well, in some cases you can use a single brush based entity and stretch it to cover two separate entrances, ie if you had two corridors separated by a wall between that led to a central room, might as well just have one brush go across both entrance ways so you don’t waste another 4 brush’s when you don’t need too. Areaportals are allowed to be inside normal map geometry, just don’t go overboard as trying to fix any leaks afterwards with that work gets messy to the point of a brick going through your monitor. Try to keep the brushwork clean and easy to work with so optimization becomes easier to do. If you have any func\_detail entities in your map in any large quantity, those also may be the cause of a leak, you cannot rely on them to seal something from the void that is the rest of your map, the whole point you tied them to func\_detail was so that they would not be normal geometry and would be ignored by the vvis process completely and speed up the compilation process. Double check your geometry in the area of the leak for any of these entities. Use the auto visgroups tab to toggle on and off this group for quicker analysis of the area. Most of the time this is the issue and its quickly fixed by moving it back to world and selecting the more fine brush detail on the group and only tying those to func\_detail. Entire walls generally shouldn't be detail brushes, but only the tiny smaller ones on its surface that are not needed to block visibility in any way.

Areaportal Windows

Brief Situation Intro

For the windows section of this tutorial I'm going to be using the Office space area of de\_inner-city as it has several spots we are going to turn into portal windows as well as some outside of it as well.
From the above screenshot, currently there are no windows there, just the spaces for them, so just a simple copy of the ones below into their place works for us as seen on the right. Just one issue though, the texture is not transparent, and we want to be able to see out and into the building and have areaportals to make this perform as best they can. While areaportal windows do have a translucency limit property you can edit to set how transparent it is up close, that doesn't always look so good because then also the framework and other parts of the window texture which shouldn't be transparent are. So just by using a variant of that same texture we can keep the style of the window and also get the transparent feeling as well for when up close. Quite a few valve textures by default have solid and transparent window textures, feel free to browse around for others. Now this fact of same style textures both transparent and not is also very handy for another reason. Areaportals have a setting to select the "Rendered Window" texture to fade in/out of depending on distance from the window. This is used for the open and closed states of the areaportals as they are dynamically controlled via distance as also set in its properties.
So getting down to business here on actually building them, we need to add in the brushes to become our func\_areaportal\_window entities. But just before doing that, tie all the current windows to func\_brush. Now once thats done,do a simple cheat and copy/paste the existing windows right back in again, move those copied brushes back to world geometry. Hide the func\_brushs via autovisgroups menu and check off brush bases entities. Apply the toolsareaportal texture to all the copied windows, and then selecting each brush on its own and tying them to the func\_areaportal\_window, we have what can now be seen on the right thumbnail. Very very important that you do each brush on its own. Areaportals can only be made of a single brush, you cannot tie multiple brushes to either a standard areaportal or a window areaportal. Compile errors will occur. However areaportals that all lie along the same plane will be merged together ingame, so while we have our separate areaportals in hammer, once you run the game and check them with r\_drawportals 1 you will see that its just a single long rectangular portal. But since your just learning to make them still a good idea to make them with separate brushes as a habit.
But that in itself is not enough, still have some more work to do. We need to add in the correct/best settings for these windows still, by default they don't behave very nicely. So hide them for the moment in their own custom group as the autovisgroup for areaportals doesn't count windows into that same group sadly, maybe valve will fix that one day but for now make due with custom groups. Now bring back the func\_brush entities and select and name each one with a unique name, I just did win1 win2 etc down the line. Then bring back the areaportal windows we made earlier and then match each areaportals rendered window setting to the name of the one its covering. Testing out ingame the render distances we have what you see on the right. The fact that they are almost transparent when close up doesn't help us at all, so we need to fix that as well. You could just edit the translucency limit properties and set it to 1, but theres also the fact that when far away when the areaportals are completely closed the room disappears and because the texture is transparent we see the skybox through the windows. This is where the two variant textures come into play for those that want to fix this somewhat unique problem.
First thing we are going to do is select all our areaportal windows. Go to its Translucency limit property and set it to 0. Don't change anything else, we are going to keep our rendered window names intact. Thats all we have to do for the areaportals so hide them again for the moment. Select all the textured window brushes, copy them and paste another set far away from the wall so we can work with them. While you still have them selected, apply the other texture thats completely solid as seen on the windows on the floor below. These ones here are going to be our rendered windows now. So select the original textured windows that have the transparent texture on them and open the properties. Select the name section and delete it or change them to func\_detail. Now the solid windows need to be placed back into the wall overlapping the existing transparent ones. Add in the areaportals and when compiled we will now have the effect seen on the right rather than the broken one shown above it. Now the windows match perfectly with the rest of the building when seen from a distance and also they still look like normal windows when close up too. Best of both worlds. Quite a bit of work but makes all the difference in the world.

Sealing Your Windows

Slapping areaportal\_windows just on any window won't work. You still need to seal the rest of the area just as you did with the general areaportals section of this tutorial. These are just an extension of them with more settings. Always use the cordon tool to do simple bsp only compiles of your newly created areas to test them for leaks, during this tutorial I encountered dozens just from missing geometry to func\_detailed objects. Also, keep in mind that window frames, just like doors, tend to be sticking out or being sunk into the existing wall geometry and are most likely func\_detail as well. Therefore the areaportal window needs to encompass those gaps to correctly seal the area. Easiest way to construct areaportals either in the general format or window format is to use the autovis groups and hide everything not needed, brush entities, point entities, detail entities etc and just leave only the bare structure of your map intact.

Final Words/Warnings

While areaportals are very powerful and seem like can be used everywhere and will improve your map drastically, they also exact a certain cost to resources when there are more than one on the screen at a time, so while they are great to have in maps, limit them to where you need them rather than having them everywhere as the performance increase may be minimal at that point. If your not sure if your getting a performance boost out of an area then disable it and compile it without them, if it runs better/worse act accordingly. A simple warning about water. If you have an areaportal thats cutting off a section of a water brush and crosses the surface from above to below, you need to split the areaportal brush into two separate areaportal entities that meet right at the surface of the water. Now just to reiterate some general rules/properties for areaportals:
  • They must only be made from 1 brush
  • Areaportals must be tied to func\_areaportal or func\_areaportal\_window
  • Areaportals must be completly textured with the tools/toolsareaportal texture ONLY.
  • They cannot have displacements contained within their volume
  • Areaportals must be tied to func\_areaportal or func\_areaportalwindow as the brush with just the texture does nothing.
  • Server events/controlled entities are not effected by portals. ie, Bots shoot through closed portals
  • Areaportals along the same plane will merge together ingame
  • Areas can leak independently
  • Areaportals are non-solid
  • Areaportals cannot cross the surface of a water brush
  • Open Areaportals filter out rendered visleafs based on perspective seen through the open portal
  • Closed Areaportals remove all visleafs beyond the portal from being rendered
  • 1-10 of 31
    1
    Pages
    Go to page:
    • Donny avatar
      Donny Joined 15y ago
      Offline
      3,053 points Ranked 5,526th
      13 medals 1 rare
      • 6 years a member Medal icon
      • Became a Studio Leader Medal icon
      • Became a Club Leader Medal icon
      • Reached 1,000 Points Medal icon
      • Reached 2,500 Points Medal icon
      • 1 post awarded Exemplary Feedback Medal icon
      13y
      Your pictures don't work anymore.
      <3 avatar
      Mantra
      <3
      URL to post:
    • Runaway of CSF avatar
      Runaway of CSF Joined 15y ago
      Offline
      361 points Ranked 66,783rd
      14y
      I have an open area portal that acts like it's closed, by not showing ANYTHING behind it. It is in a doorway that is open and the compiler has no problem because the inside of this building is sealed. Just take a look at the picture http://img190.imageshack.us/img190/438/cast2352320003.jpg I have cut a visleaf behind it so that it will show all of the next visleaf. This area portal needs to be open because the ways into the building are going combat zones. I need to not draw the inside of the building, untill you enter the building, but this pop is not working and not acceptable. Area portal windows don't work either...even with the distance thingy on them.
      God is great, so great. Just a
      URL to post:
    • Logan Dougall avatar
      Logan Dougall username pic Joined 17y ago
      Former Admin
      Offline
      Half Life Storm Flag Affiliation: Half Life Storm
      24,830 points Ranked 308th
      47 medals 3 legendary 13 rare
      • Achieved Admin clearance Medal icon
      • 200 posts awarded Exemplary Feedback Medal icon
      • 10 years a member Medal icon
      • 50 posts awarded Exemplary Feedback Medal icon
      • 100 posts awarded Exemplary Feedback Medal icon
      • 150 posts awarded Exemplary Feedback Medal icon
      Logan Dougall avatar
      Logan Dougall
      Half Life Storm Flag
      Affiliation
      Half Life Storm
      Former Admin
      14y
      Posted by CC_Fight Hey Im having trouble optimizing my map and Im having trouble putting areaportals in :/ idk where I should put them. I tried a couple diff. ways but it didnt seem to do anything to help. Heres an overview pic. the pink is the paths and the red is T and blue CT. pic If its hard to see, I can send u the BSP if you have some time :)
      If you want to place it in my dropbox I can run around the map and take some screenshots of spots to add some areaportals in. Looks simple enough to add some to, just hard to tell what it looks like ingame due to nodraw'd surfaces.
      Structural Designer / Dad :)
      URL to post:
    • -Fight- avatar
      -Fight- Joined 15y ago
      Offline
      6,077 points Ranked 1,826th
      14y
      Hey Im having trouble optimizing my map and Im having trouble putting areaportals in :/ idk where I should put them. I tried a couple diff. ways but it didnt seem to do anything to help. Heres an overview pic. the pink is the paths and the red is T and blue CT. pic If its hard to see, I can send u the BSP if you have some time :)
      And... here...we.........go!
      URL to post:
    • ivar avatar
      ivar Joined 16y ago
      Offline
      2,307 points Ranked 22,937th
      14y
      Fantastic tutorial.
       avatar
      URL to post:
    • Fearlezz avatar
      Fearlezz Joined 15y ago
      Offline
      14y
      Great job, although is a lot to read and it would take some time to read through all of it so you get a 9.5. But this is great, thanks alot.
      Mappin' for life avatar
      Mantra
      Mappin' for life
      URL to post:
    • .Lynx avatar
      .Lynx Joined 15y ago
      Offline
      452 points Ranked 61,091st
      8 medals 1 legendary 1 rare
      • 10 years a member Medal icon
      • 6 years a member Medal icon
      • 1 post awarded Exemplary Feedback Medal icon
      • One month a member Medal icon
      • 6 months a member Medal icon
      • 1 year a member Medal icon
      14y
      Pros: Explains the law of tool textures, has proberly tooken a few days maybe weeks to complete, great use of HTML Awesome quick Navagation Cons: No Cons Improvements: If you was to highlight or change the colour of the important words it would of made this tutorial 11/10 :D Notes: good job. looking for more mapping tutorials
      http://www.fpsbanana.com/clubs avatar
      Mantra
      http://www.fpsbanana.com/clubs
      URL to post:
    • Whisky avatar
      Whisky Joined 16y ago
      Offline
      1,881 points Ranked 24,207th
      14y
      Well i compiled it in fast mode, and it compiled within 10 mins! and it's working perfectly now! thanks for your help m8 :) Gj on explaining the area portal
      God's seen campy bean. avatar
      Mantra
      God's seen campy bean.
      URL to post:
    • Logan Dougall avatar
      Logan Dougall username pic Joined 17y ago
      Former Admin
      Offline
      Half Life Storm Flag Affiliation: Half Life Storm
      24,830 points Ranked 308th
      47 medals 3 legendary 13 rare
      • Achieved Admin clearance Medal icon
      • 200 posts awarded Exemplary Feedback Medal icon
      • 10 years a member Medal icon
      • 50 posts awarded Exemplary Feedback Medal icon
      • 100 posts awarded Exemplary Feedback Medal icon
      • 150 posts awarded Exemplary Feedback Medal icon
      Logan Dougall avatar
      Logan Dougall
      Half Life Storm Flag
      Affiliation
      Half Life Storm
      Former Admin
      14y
      Posted by Whisky
      Posted by Lost
      Posted by Whisky I have this map i'm making its an inside area with pillars all in the correct positions nothing is off by units, but the visleaf takes so damn long to compile, i once let my pc compile and it just crashed after 2 and a half hours! should i use area portals between pillars? and yes its a square room with 5 pillars in lenght and 5 pillars wide what can i do?
      Pillars are usually tied to func_detail since they don't really block visibility. Using areaportals in such numbers for that area would probably create a worse problem for performance. Just tie them to func detail and your compile shouldn't take more than 10 minutes.
      problem, they are displacements -.-
      Displacements are not counted in the vvis process and won't seal leaks so thats not the issue then, theres something else then thats making your compile longer.
      Structural Designer / Dad :)
      URL to post:
    • Whisky avatar
      Whisky Joined 16y ago
      Offline
      1,881 points Ranked 24,207th
      14y
      Posted by Lost
      Posted by Whisky I have this map i'm making its an inside area with pillars all in the correct positions nothing is off by units, but the visleaf takes so damn long to compile, i once let my pc compile and it just crashed after 2 and a half hours! should i use area portals between pillars? and yes its a square room with 5 pillars in lenght and 5 pillars wide what can i do?
      Pillars are usually tied to func_detail since they don't really block visibility. Using areaportals in such numbers for that area would probably create a worse problem for performance. Just tie them to func detail and your compile shouldn't take more than 10 minutes.
      problem, they are displacements -.-
      God's seen campy bean. avatar
      Mantra
      God's seen campy bean.
      URL to post: