I cannot understand Areaportals

I've been working on a map for 2 weeks and the only thing to do in order to release it in beta, is optimization.

However, I do not understand Areaportals. I have watched countless tutorials and read countless guides, but all of them show the usage of area portals on very simple maps, made for the tutorial. My map is very big and open and I can only use Areaportals on 1 room. If I seal another room with area portals I get a weird error when I compile the map (something about portalnum > ..).

Anyway, it makes me really sad because I was incredibly excited when I imagined playing it with friends and other players, but no matter how much I try to understand how to use Areaportals on my map, I simply can't do it. This is the first time this has happened to me on Hammer and I am even thinking of abandonding the project I've spent so much time and effort on.

Not all maps will benefit hugely from areaportals. Maps with a lot of "outdoors" play area use few areaportals, for example. If you post a download link to your map, I'm sure there are several people here on the site who could instruct you as to where areaportals could be best placed.

That said, there might be other problems with your map that will prevent it from running smoothly, areaportals or no. To some extent, maps must be designed with optimization in mind from the very start if any optimization is to take place. It is possible that your map will not be laid out in a way lends itself well to any number of optimization techniques.

Not all maps will benefit hugely from areaportals. Maps with a lot of "outdoors" play area use few areaportals, for example. If you post a download link to your map, I'm sure there are several people here on the site who could instruct you as to where areaportals could be best placed.

That said, there might be other problems with your map that will prevent it from running smoothly, areaportals or no. To some extent, maps must be designed with optimization in mind from the very start if any optimization is to take place. It is possible that your map will not be laid out in a way lends itself well to any number of optimization techniques.

Click to expand...

It is not about where to place them. I know where to place them, it is just that there are always errors. Could I perhaps post the .vmf here?

That error usually means that you have an areaportal leak. An areaportal leak means that an areaportal only opens up to one areaportal... area. Areaportals divide the map up into separate areas, and act as windows into other areas. In order to do this, the compiler has to create very well-defined areas. An areaportal has to open up from one sealed area into another sealed area.

This means that if you have a building in the middle of your map, and you areaportal every door and window and unsealed geometry on it, the inside of the building and the outside of the building are separate areas, but not when you're outside looking past it. Here's an example of that on badwater:

As you can see, they didn't even bother to areaportal beside or on top of the building. When it comes to large, complex, open, outdoor geometry, hintbrushes are generally easier to control than areaportals, and have the added bonus of lowering your compile time when used on such geometry effectively.

Now, if I were to remove a random one of the areaportals, it would leak and give me a portalnum related error.

Here's another example of something badwater did:

As you can see, they skyboxed the roof of that annoying overpass building, put an areaportal in it, and put areaportals in (all one of) its byconnectors.

This and the thing they did where I posted two images at once are basically the only way to areaportal outdoor buildings. Everything basically acts like an independent building or like a wall of areaportals between parts of the map.

What you should do is func_detail like half of what isn't func_detailed already. Especially stuff in the roofs.

Click to expand...

I watched a tutorial that said func_details should be used on complex brushes like cylinders and spheres, didn't know most brushes (except the one that seal areaportals) should be func_detailed. Any other tips? I really appreciate all the help in these forums!

- Never go below the 16 units for you blockout.
- Learn how to use the func_details.
- Do not make a huge skybox surrounding all your map.

Click to expand...

Hey, thanks for taking the time to check the .vmf.
You seem to have used areaportals and skyboxes over the buildings that connect the spawn with middle. However, isnt it going to leak below the ground? It is going to be impossible to seal it since there is a displacement for the ground?
Damn areaportals are a pain in the butt, I hate them.