Tutorial: Bot Optimization
Urban Terror Mod (Quake 3)
by: moc_mr_fitz
last updated Nov 12/01


[moc_mr_fitz HOME]
links | contact

Introduction
Ever notice your terrain map or map with a large open area bogs down incredibly when you play with bots - even though your r_speeds are low and your fps high? This tutorial is for Quake 3 mappers who want bots to run faster - that is - use LESS CPU on their maps.  This tutorial is meant to be a more visual companion to a somewhat more detailed text-only tutorial on bot optimization at the Team Huh Quake 3 site.  While this tutorial should be useful to all Quake 3 mappers (mods included) wanting further details on bot optimization, it focuses on the issue of optimizing maps with at least one large open area (including terrain) in particular.  The mapfile for this tutorial can be found here

Concepts


Step 1 - square off everything: botclip OR playerclip OR fullclip
Some of the most significant gains in making bots run smother is to clip as much of your map as possible, especially in large open areas.  That is, brush planes are the source for creating areas in bspc - thus you want to "trick" bspc into thinking the map is smoother (less complex) than it actually is visually in-game.   In the case of objects inside the map, you cannot simply put clip in front of an object, the clip should surround the object.  Some good rules of thumb are:

figure 1  figure 2

Step 2 - manually create area clusters: clusterportals
There is much to know about clusterportals and the rules for using them.  You should go here and read the "step two" there carefully.  They are placed somewhat like areaportals but the good news is that clusterportals do NOT break up brushes in the vis calculations like say a hint brush portal.  You have to seal off part of the map with your clusterportal brush - e.g. all the windows and doors in a building (even if they have glass already) to seal off the building.  The full list of rules for applying clusterportals is here but some key ones are:


figure 3

Thus, place clusterportal brushes in your map to seal off areas according to the above rules.  Clipping and placing clusterportals in doorways, windows, and hallway entrances may be all you need to do - a relatively simple step to add to the speed of you map!  If you have large open areas though this may not be enough -  read step 3.

Step 3 breaking up large area clusters - combining botclip and clusterportals
Maps with large open areas, like terrain, make for additional challenges - but these challenges are realively easy to resolve with some creative brushwork.  Essentially you create a grid of large clusterportal brushes between botclip "posts/girders".  The basic idea is shown in figure 4 with cluster 1 separated from cluster 2 by a box of clusterportal brushes which meet at botclip posts/girders - note that all these brushes go from "floor" to "ceiling" sealing off the clusters entirely.  Since the botclip posts are relatively small, gameplay is not effected for the bots, they simply walk and shoot around the posts/girders.


figure 4

Consider an example where you simply need to split up a large open area that creates a very large single cluster, into two relatively even sized clusters.  It is actually much simpler to bisect (crosscut) the cluster with a single clusterportal than to put a box in the middle.  I have created a simple map with an undulating patchmesh floor - this creates a lot of areas fast even without any other brushes in the map.  We will cut the map in half with a clusterportal as in figures 5 and 6.  Just to be safe, place some botclip posts on the sides similar to figure 4, but have them butt up against the side sky brushes in this case (would "flush" be a better word?).  Also notice I have created a "false ceiling" with botclip.  While you may want a tall skybox for visual elements and so people don't leave the map in spectator mode you should put a false ceiling in to cut down the size of the areas and clusters (remember they are 3-dimensional).  The botclip on the floor is placed between two patch meshes and over laps them by 8 units each - thus bots will appear to walk on air here but this is a relatively narrow and thin brush and the effect will not be noticeable when playing the bots.


figure 5


figure 6

Step 4 checking your manual clusterportalization: bspc.log (in /Quake III Arena/)
There are at least three things you will want to check:

  1. Are there areas in the map that appear solid to bots in game that should not (this is bad)?
  2. Did your clusterportals actually work?
  3. How much did your working clusterportals reduce bot CPU usage?
There are a couple of ways to check each.  Again, read the tutorial here for more details but the basics are:
figure 7

figure 8 Before inserting the clusterportal in figures 5 and 6:
...cluster 1 has 281 reachability areas
   281 total reachability areas
237726 AAS memory/CPU usage (the lower the better)
AAS data optimized.
writing C:\Games\Quake III Arena\baseq3\maps\clusterportal2.aas...
note: 281reachability areas is not a large cluster worth splitting in real life, this is just for demontration purposes

After inserting the clusterportal in figures 5 and 6:
...cluster 1 has 123 reachability areas
cluster 2 has 136 reachability areas
   259 total reachability areas
109422 AAS memory/CPU usage (the lower the better)
AAS data optimized.
writing C:\Games\Quake III Arena\baseq3\maps\clusterportal.aas...

Notice that:

REMEMBER
Clusterportals can be tempermental in that, no matter how well they are constructed bspc may choose to ignore them - if this is the case - try a different configuration.
 

Contact - please report any errors or omissions
[email protected]


Urban Terror sites - with thirdparty maps (6th floor for other UT mapping tutorials)


 
 
 
 
 
 
 
 
 
 

Just a counter, click at your discretion


 

A Counter

Hosted by www.Geocities.ws

1