quake2 - func_areaportal

A func_areaportal is a strange entity but does some bad ass things. If you have done any extensive quake editing then you know that the quake engine can see right through a door and draws all the polys beyond that door. This causes the framerate to increase and cause map makers much havoc. Well in quake2, John Carmack has given us a solution to this problem and it's the func_areaportal entity. What it actually does is when used it will make it so the engine cannot see through the door and keeps the framerate low. I could go into a bunch of tech talk explaining exactly what it does but you don't want to hear all of that and I really don't want to type it all so I will simply tell you how to use it.

How to Get the Dang Thing Working

A func_areaportal will only work when it is enclosed within a portal such as a door. It is actually very simple to use. First you make the doors of course. Then you create a brush that is inclosed within the door and completely covers the area of the door so engine can't see through it at any areas. What I usually do is make it just a bit taller and wider then the door just to make sure. Next thing you need to do is turn this brush into a func_areaportal.

Next you need to link the func_areaportal and the door so that when the door is opened the func_areaportal will disappear and when it is closes it will reappear. This is done by giving the func_areaportal a targetname and then targeting the func_areaportal with the door. For example, if the func_areaportal has a targetname of ap1, targetname ap1, then the func_door would have a target of ap1. target ap1. If you don't target the func_areaportal then you will get this weird hall of mirrors effect when the door is opened.

Here are 2 example shot of that i took to show you the effect of using the func_areaportal does. The shots are from the doors tutorial example map with and without using area_portals. I simply turned on r_speeds right when the player enters the level and is standing in front of a hallway with 4 doors in it.

without ap

with ap

As you can see there is a huge difference with that first number which is the number of polys in the current view. This is from a small simple level. Just think of the improvements that could be made on a huge level.

Still having Problems?
A lot of people are still having problems with the func_area portal. If you are one of these people I sugges you read grrandMaMa's func_areaportal Addendum and Joel Caesar's two tutorials he has been kind enough to let us at rust post. The first one can be found here, and the second one is here. He discusses all the problems that you will encounter like the HOM effect and the proper way to place it in the door to avoid all problems.
That's about all there is to func_areaportal. Pretty simple and very useful. I would advise you to use a func_areaportal on every single door you make. If you are having problems then you can download the [example .map] which is the exact same map that that is used for tutorial 12, the doors tutorial. But this time all the doors use func_areaportals. As always if you have any other questions please post them in the discussion board.

Return to Tutorials Page...

Copyright Crap