openarena
OpenArena's Mapping manual
ProloguePre-mapping stage (Map gameplay)Choosing an editorYour first mapBrush manipulation (2D/3D clipping)Curve manipulationTexturesIntroduction to EntitiesLighting (Advanced lighting)Weapon/Item placementTriggers and movers (Dynamic features)ShadersTerrains and liquidsMapmodelsSoundsGametype supportOptimization and Troubleshooting (Hint brushesBot playTroubleshooting)Final touchesCompilation & packaging
Glossary of termsAdvanced featuresModelling a mapEditor differencesDefault assets (Textures/Models/Sounds)GPL

While a compiled map (.bsp file) allows human players to play, an additional element is necessary, to be able to add bots to the map: an .aas file. Bots try to mimic human players, but they have limitations mappers should consider.

Reasons to care for botplay

There are many reasons to care for bot play.

First, you may make your map so humans can play, but it's very unlikely for your map to end in every real server map rotation, as servers have the tendency to restrict the allowed gametypes and maps to very few of each; this is something called Complacent Gaming Syndrome.

And even if your map gets included into official OA releases or popular mappacks, good botplay is also mandatory there: consider players waiting for some other human to join the server: they may play with bots in the meanwhile. Also, not even OA official maps are safe from the above.

Plus, a map with bot support enables offline play, so players can play the map even if they can't get online.

Also, getting rid of the current AI system or changing it with a different system such as waypoints falls outside of the scope of OpenArena, as each map should always have its own AAS file for compatibility reasons.

All in all, there's no reason for your maps to lack bot support.

BSPC

Now let's take a look at what BSPC is, how it works and where to get it.

Partially taken from the BSPC readme[1], the BSPC tool is used to create the AAS (Area Awareness System) files from BSP files.

The process of AAS file creation is basically the same as the process used by the VIS stage: the map is subdivided in many small nodes called "areas" instead of "leaf nodes", and every area is a visibility section from where other areas can be seen. Areas are then regroupped into bigger zones called Clusters.

There are a few differences, though: the only brushes taken in account for the calculation of the areas are the solid, clip, liquid, clusterportal and donotenter ones. This means that structural, detail, patches and areaportals will be taken in account, but hints are not. Clip brushes include clip, botclip, weaponclip and full_clip. Clipping is important for BSPC, as it allows the simplification of the map without modifying the world's geometry. Likewise, clusterportals act as areaportals in the regard that a bot may see an area or not.

The latest "official" version of BSPC (created by Mr. Elusive, the creator of the AAS system) is 2.1. BSPC comes bundled with many editors, mainly GTKRadiant, but for editors such as NetRadiant or older versions of *Radiant, however, a newer BSPC must be taken from somewhere else. There are various BSPC "forks" around the net.

A few examples of BSPC usage:

bspc -bsp2aas -forcesidesvisible yourmap.bsp

The command above creates the .aas file for your map.

bspc -grapplereach -forcesidesvisible -optimize -threads 4 -bsp2aas yourmap.bsp

This command also calculates reachabilities for the grappling hook, optimizes the aas filesize and uses four threads to make compiling faster.
Please read the considerations below, which also include explanations for those parameters.

For your comfort, you can place the command into a batch file/shell script.

See Mapping manual/Compiling and packaging#BSPC for a list of BSPC parameters.

Clip brushes: bot clip, player clip and weapon clip

The first and most basic optimization is to clip your map. Clipping helps a lot to the compilation of AAS file, by making bot navigation around the map a lot easier without the need to change the world's geometry.[2]

Use brushes texturized in all of their faces with the invisible texture common/weapclip, common/clip or common/botclip to specify collisions around geometry.[3]

These three are the most commonly used "clip" brushes. Some other variants are available, e.g. to emit "metalsteps" sounds instead of standard footsteps sounds while walking on them. You can even create your own variants of these shaders -e.g. "textures/my_own_map/clip_flesh" shader- if needed.

Note: "clipping" term may also refer to a way to manipulate brushes in general: see Mapping manual/2D and 3D clipping for more infos about that.

Forcing paths with DoNotEnter

As botclip blocks the bot from accessing a determined area, in deathpits and other hazard zones like lava/slime pits you should use brushes texturized with common/donotenter ("bot do not enter") instead. Donotenter acts as a "hint" to not enter a certain area, opposite to botclip which "physically forbides" them to go to a certain area.

DoNotEnter does not risk to show bots walking mid-air, as botclip does in case the top of the brush is accessible.

DoNotEnter can also be used to control bot navigation along corridors and around corners to prevent wayward access when the use of botclip is not possible or impractical. Encasing areas in donotenter means that we can direct or force navigation without physically restricting it with invisible walls of botclip.[8]

However do not exceed with their usage if not necessary, considering a "donotenter" creates an extra "area" that bot logic has to consider.[9]

The importance of the NoDrop brush

Alongside to the above, place at the bottom of the hazardzone a brush texturized in all its faces with the common/nodrop brush. This makes items and flags to disappear at the zone in question. Otherwise, bots would ignore botdonotenter and try to get these items/flags by entering in the hazard/death zone.

This is not only important for bots, but also for humans: think about recovering a flag which is dropped in a lava pit or in space void... "Nodrop" allows to prevent such problems.

Bot play entities

There are two botplay-dedicated entities supported in the game: info_camp and item_botroam

info_camp

This atttracts bots which have a camping preference in their A.I. characteristics. It should be placed at least 32 units away from any brush surface.[10]

Keys

item_botroam

An invisible entity that attracts a bot to it. Used to move bots to parts of a map that might otherwise not be used.[11]

Keys

Notes about these entities

Clusterportals

If your map is big enough (for instance, lots of levels and Z-axis action) or if it has a lot of complex geometry, try using brushes with common/clusterportal in all of their faces to split the map into different "clusters". Optimization through these invisible and non-solid brushes may allow to prevent bot-related hitches (bot stutter). Some considerations to bear in mind[2]:

As a rule of thumb, it's better to try to keep every cluster under 500 areas.[12] Also, careful clipping usage may allow to get fewer areas.

While in-game, /bot_testclusters 1 tells you the number of the cluster you are in[13]. /Bot_testclusters works only if the map has got its .aas file, and does not work while spectating.

Space maps

This is a very touchy issue, so it deserves its own section.[2]

In a large space map with lots of jump-pads, placing clusterportals can be a very daunting task, as most of the map is crossed with trigger_push trajectories and teleporters, there are no obvious door-type structures which seal off any area, and there are usually vertical access points to almost every single part of the map. If the map is simple enough, you can get away with not adding clusterportals. But the problem arises with more complex architecture.

The only way to get clusterportals working properly in space is to split the map into approximately equal sized sections using huge botclip walls, 16 units thick, which go all the way across the skybox and seal completely the areas they divide. Then, use the clipper tool to make rectangular 'windows' in these walls where the bots will need to go through them, and filling these windows with clusterportals.

Like said above, you should be aware of trigger_push trajectories, and surround teleporters with botclip brushes and clusterportal entrances in order to avoid any kind of inconveniences.

Botplay in extremely complex maps

The following method was suggested by CZGhost on the LvlWorld forums, and is based on the method Simon "SimonOC" O'Callaghan used for his map "Pyramid of the Magician".[14][15] The idea is to make a simplified version of your map for bots. This version should be averagely the same size as the original map.

  1. The map should contain all the original spawnpoints in their original locations (in all 3 axes) and all original items in their original locations (in all 3 axes). That's the must for the map work correctly.
  2. Clip the terrain properly to prevent bots' legs sink down to the terrain mesh. If the terrain is subtly divided into some sloppy hills and averagely flat surfaces, then you can simplify the terrain mesh in those averagely same plains (hills slopes and the flat surface). Make sure to follow the actual average profile of the terrain.
  3. Remove the models, patches and detail brushes that don't alter the gameplay or the collision model of the map. However, keep the textures that modify the volume & surface parameters (i.e. water textures for water, lava textures for lava, slime textures for slime, wall textures for walls, floor textures for floors; it's important to use the same shader parameters for the same surfaces in the original map) except for visual and audible appeareance.
  4. Visibility calculating and ligthmap generation is irrelevant for this map and may be skipped. You can use a simple test Q3Map2 BSP only command, it compiles the whole map in "boxed" mode and without lightmap, which makes the map "fullbright" - that doesn't matter as we won't play this simplified map.
  5. When the simplified map compiled, you can actually compile the AAS for the simplified map. If the compiler throws error for you, try to simplify the map more. But keep in mind to keep the collision model of the map averagely the same as the original one has. Some minor alters do not matter much as long as it won't look much weird in the game.
  6. When the AAS successfully compiled, you just need to append it to the original map. Rename generated AAS file to the original map filename (let's say your original map is named quebec.bsp - then new name for the AAS will be quebec.aas) - that makes the AAS file corrupted and not working. Do not worry. That's only the half of the progress.
  7. Start new Q3map2 command - fixaas. Link to the original map file and launch. This will repair the AAS file and corrupt it again. But it now points to the original map instead of the simplified. To actually make the AAS work again, you need to use BSPC -reach command for the original map. That will finally make the AAS working as it relinks the AAS file with the original map and repairs the reachability.

Considerations

Error messages on BSPC

Taken from Id's documentation about BSPC[1]:

Level designers should not worry too much about the following messages and/or warnings. The things reported are non fatal and won't cause any major problems. Some of the messages are just debug left overs.

When one of the following messages, errors or warnings is found then there is often something to be fixed.

Notes

  1. 1.0 1.1 BSPC readme
  2. 2.0 2.1 2.2 Bot Optimization Guide by Cardigan
  3. Bots do prefer simple, axial geometry. Enclosing strange shapes into simpler and XYZ oriented "clipped" brushes makes bots life more easy.
  4. Example of usage: you may include a "mapmodel" .md3 3D model in your map, for example a statue. That 3D model will be "incorporeal", unless you add some clipping: you may want to enclose it into a single "player clip" or "bot clip" box, and to place some smaller "weapon clip" brushes a bit closer around the statue (roughly following its shape). That way, players and shots will seem to be blocked by the statue. See also Mapping manual/Mapmodels.
  5. "Player clip" is also often used in big brushes to create an "invisible ceiling" lower than actual sky, to prevent spectators from reaching too much high places which would show some glitches due to viewing parts of the map which should not be viewed from above.
  6. Simon "sock" O'Callaghan @ Map-Center Discord channel
  7. Former Epic Games's level designer Warren Marshall @ Map-Center Discord channel
  8. The BotDonotEnter brush at Kat's Bits
  9. "Do Not Enter" Areas in GTK Radiant Bot Navigation Appendix
  10. GTKR Manual, Appendix B4
  11. GTKR Manual, Appendix B5
  12. Clusters with too many areas may sometimes cause the game to require too much time to determine where a certain bot will go next, hence causing a short "freeze": splitting that huge cluster into smaller clusters should fix the problem.
  13. You can compare it with the output of bspc command -in bspc.log- to find out which are the clusters with too many areas, and that may need to be further divided.
  14. The 10 mapping commandments @ LvLWorld Forums
  15. Pyramid of the Magician, Bot Page @ SimonOC.com
  16. Bot navigation files: how high bots would jump, and much more.
  17. With gametype objectives, it's advisable to perfectly align their "origin" point with the ground.
  18. If you seal a corridor for a certain gametype, bots will never try to pass through that corridor also in all other gametypes; if you set a bridge, a box or a ledge for certain gametypes only, bots may try to step over it also when it does not appear, goofy falling down repeatedly. Also usage with trigger brushses, such as teleporters or accelerator pads, may cause problems to bots, while usage with func_door and func_button should work well enough: please check actual bots behavior anyway. You can order a team-mate of yours bot to follow you, in team-based modes, to see how it behaves in such places. Usage with nonsolid decorations should be safer. Gametype key is often used with standard entities such as items to pickup, however try do to not make excessive use of it.
  19. If an AAS file has not already been optimized, it's possible to use "-aasopt" mode to optimize it later... however, there is no reason for not optimizing at creation time. Unless you are still developing the map and you wish to use one of the few debugging features of the game which do not work with optimized aas.

External links

See also

<< Previous (Hint brushes) Mapping manual (Troubleshooting) Next >>