A
LITTLE BIT ON VIS
When you VIS a map,
it is broken down into a bunch of little areas.
The VIS process then basically tries to determine
which other areas can be seen from every other
area. If an area can't be seen, then the polygons
in the unseen area are not drawn. For example,
polygons on the other side of a wall.
Entities (doors,
curves, detail brushes, and models) are not part
of the VIS process. They are added into the game
at runtime (i.e. when you are playing the game).
What this means is, if you are in a room, looking
at a door, and there is another room on the other
side of the door, the polygons in the other room,
are drawn, even if the door is closed. Obviously
this slows down the game.
AREAPORTALS -
WHAT THEY DO
Areaportals were
created by Id, to tell the game engine when or
when not to draw polygons. When a door is
closed, the Areaportal turns on, and the polygons
on the other side of it are not drawn. When
a door is opened, the Areaportal turns off, and
the game engine draws the polygons on the other
side. The obvious advantage is a speed up in
gameplay. An Areaportal is what I like to
call a runtime VIS blocker.
The first picture
here, is an example of an open door, showing all
the polygons drawn when a door is opened.

Without an
Areaportal in this door, all these polygons beyond
the door, would STILL BE DRAWN even if the door
was closed.
This second
picture, shows how all those extra polygons
disappear when the door is closed, if the door
contains an Areaportal.

If you can see it,
in the upper right hand corner of each picture is
the frame rate. Notice when the door is
open, the FPS drops to 20 FPS. When the door
is closed, we get a respectable 54 FPS. Of
course, those numbers will be different depending
on how many polygons are being drawn.
So that's what an
Areaportal is. I hope I've been able to
explain the concept well enough to you.
DIFFERENT THAN
Q3
Areaportals are
handled a little bit differently in Q3 than they
were in Q2. Q2 used to have an Areaportal
entity called func_areaportal, which is no longer
present in the game. The entity used to be
targeted by the door it belonged to. Now it
is simply a brush, which is activated/deactivated
by the door entity it is contained within.
Most of the basic rules from Q2 still apply, but
getting them working is much faster and easier in
Q3.
CONSTRUCTION
Create a brush and size it to cover your doorway.
It should completely cover the door opening.
It also needs to go beyond curves. Turning
curves off in the Q3Radiant view menu will help a
great deal. Next, you need to make it thin, at
least thinner than your door.
After sizing the
Areaportal brush, I typically make it 1-2 grid
units thick. It should fit within your doors
(single brush or multibrush-teamed doors) and you
should not be able to see it from any angle when
the doors are closed. I've been told that in
some Id maps, you can see these, but that was a
problem in Q2, so I recommend that you keep them
from being seen. Also, if an Areaportal is not
inside a door, you will get the error message,
"Areaportal cannot exist in world."
Finally, load the common texture set, and apply
the area_portal texture, a medium sized pink
square, with AP on it. You should apply this
to all sides of the brush.
That's all there is to it. The door (or a
multiple brush teamed door) that touches the AP
brush, should automatically trigger the Areaportal--no
more pointing doors at entities, etc.
CAVEATS
As with Q2, the Q3 Areaportal has some caveats.
Areaportals cannot touch more than one area once,
just like in Q2, though the errors/warnings
"Areaportal touches >2 areas" or
"Areaportal touches < 2 areas" don't
get printed out. All that happens is the
Areaportal doesn't work.
A simple way to check for the validity of
Areaportals:
1. Pretend your map is a real place.
2. Imagine filling the room on one side of
the AP with water or a vaporous gas.
If your map can fill up ALL THE WAY, and the
water/vapor can touch the OTHER side of the
Areaportal, then it won't work. Only solid
brushes and Areaportals will block this imaginary
water/gas--Detail brushes, models, curves, and
other entities won't.
If you have other doors, you'll probably need to
make them Areaportal doors also.
If you have any further questions on APs and Q3,
please try the forums at the various Q3 sites
before emailing me. Unless of course you
think this tutorial needs to be
"updated."
Areaportals in
Quake 3
by Joel 'DeathMongrel' Caesar
jcaesar@mediaone.net
Copyright 2000 Joel Caesar. Used with
permission.