Gaming
 

Bot play

From OpenArena

Grab BSPC from the official source http://www.qeradiant.com/cgi-bin/trac.cgi/browser/GtkRadiant/setup/win32/bin/bspc.exe?rev=1

To add basic bot support in a map you'll need clusterportals. Similarly to what q3map2 does to split the map in visibility clusters, bspc splits the map in reachability clusters.

Note: for some unknown reason q3map2build has trouble generating proper AAS files, it compiles the AAS but in game the AAS fails to load, leaving a map with no bot play. Nevertherless, if you run BSPC from the command prompt without going trought q3map2build's GUI, the AAS file compiles flawlessly.

Everytime the BSP is recompiled, the AAS file must be recompiled as well, or else bot paths are lost.

Contents

[edit] Basic optimizations

Taken from Cardigan's bot optimization tutorial, (at the end of this page) this is a simple list on how to improve bot navigating all over the map. In the link, you'll have an extended explanation about any item on here.

  • Use brushes texturized in all of their faces with the textures common/weapclip, common/clip and common/botclip (specially the latter one) to specify collisions around geometry. Weapclip means that weaponfire, players and bots won't be able to pass through it. Clip means that players and bots won't pass through it, but weaponfire will do. Botclip means that only bots will not be able to pass through it. Botclip can be used to clip walls with uncommon shapes or things incrusted in them. Clipping helps a lot to the compilation of AAS file, by making bot navigation around the map a lot easier.
  • In deathpits and other hazard zones like lava/slime pits, your best bet is to use common/botdonotenter instead. To make this brush to work even efficiently, is very advised to put at the end of the hazardzone a brush texturized in all its faces with the common/nodrop brush. That will make items and flags to disappear to the bottom of the zone in question. Otherwise, bots would ignore botdonotenter and try to get these items/flags by entering in the hazard/death zone.
  • If you compile your map with BSP -meta switch, (something nowadays recommended) it's a MUST to use BSPC -forcesidesvisible switch in your map. Otherwise, your bots won't go anywhere, but see everything as solid space.
  • If you want a bot to go a certain area (a DOM point in Domination, or the neutral objectives of One Flag CTF and Harvester) and it doesn't follows you, try placing item_botroams in the problematic area, with a testing weight value over 400 (the final value should be under this number for the final version or the nearest ones)
  • Bots won't go to areas where rocketjumps and other special jumps are required. It's better to botclip or botdonotenter them.

[edit] 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. Some considerations to bear in mind:

  • Clusterportals MUST seal completely the sections these divide. You have to be careful with teleporters, sections won't be sealed if there's a teleporter going from one cluster to another, resulting in both clusters merged as one, no matter if the teleport is a one-way one. A solution can be isolating the teleporter (or its surrounding area) from the rest of the map with botclip and placing clusterportal entrances.
  • Clusterportals MUST be walked to get pass on them, they won't work if the only way to get through it is by falling, it doesn't matter if the clusters get divided succesfully.
  • Clusterportals won't work if a trigger_push trajectory is crossing it.
  • Clusterportals' entrances and exits should be identically shaped.
  • Clusterportals should be as axial (squared) as possible. If you're going to place a clusterportal in an arched door, botclip it to make a rectangular passing, and fill that hole with a clusterportal.
  • Clusterportals should be surrounded by solid geometry or clip. (no matter if it's a normal clip, botclip or weapclip)
  • There's no need to use a clusterportal if there's an areaportal on it.
  • Clusterportals MUST be 16px thick. (Or 32 if it's neccesary)
  • Clusterportals should only separate 2 clusters.

[edit] Error messages on BSPC

Taken from Id's documentation about BSPC: (See the section below this one for the link)

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.

  • AAS_CheckArea: area %d face %d is flipped
  • AAS_CheckArea: area %d center is %f %f %f
  • AAS_CheckFaceWindingPlane: face %d winding plane unequal to face plane
  • AAS_CheckFaceWindingPlane: face %d winding reversed
  • area %d face %d flipped: front area %d, back area %d
  • area %d face %d is tiny
  • face %d and %d, same front and back area but flipped planes
  • AAS_SplitFace: tiny back face
  • AAS_SplitFace: tiny back face
  • AAS_SplitArea: front area without faces
  • AAS_SplitArea: back area without faces
  • gsubdiv: area %d has a tiny winding
  • AAS_TestSplitPlane: tried face plane as splitter
  • found %d epsilon faces trying to split area %d
  • AAS_SplitArea: front area without faces
  • AAS_GetFace: face %d had degenerate edge %d-%d
  • AAS_GetFace: face %d was tiny
  • WARNING: huge winding
  • bogus brush after clip
  • split removed brush
  • split not on both sides
  • two tiny brushes
  • possible portal: %d
  • portal %d: area %d
  • WARNING: CM_GridPlane unresolvable
  • WARNING: CM_AddFacetBevels... invalid bevel
  • WARNING: CM_SetBorderInward: mixed plane sides
  • WARNING: bevel plane already used
  • trigger_multiple model = "%s"
  • trigger_teleport model = "%s"
  • found a trigger_push with velocity %f %f %f
  • AAS_TraceBoundingBox: stack overflow
  • AAS_TraceAreas: stack overflow
  • AAS_LinkEntity: stack overflow
  • MergeWindings: degenerate edge on winding %f %f %f
  • Warning: MergeWindings: front to back found twice
  • FindPlaneSeperatingWindings: winding1 non-convex
  • FindPlaneSeperatingWindings: winding2 non-convex

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

  • WARNING! HashVec: point %f %f %f outside valid range. This should never happen!: While storing the AAS file some vertex was found outside the valid map bounds. When this happens some part of the map is likely to have badly aligned brushes or weird shaped curves. Clipping off or rebuilding complex shapes often helps.
  • trigger_push start solid: The trigger_push start point is in solid. Try making the trigger_push brush a bit larger or move it around a bit.
  • trigger_push without target entity %s: Could not find the target entity of the trigger_push with the target field %s.
  • trigger_push without time: trigger_push entity found without "time" field.
  • trigger_multiple not in any jump pad area
  • trigger_push not in any jump pad area: A trigger_push entity was found not to be in any valid jumppad area. (the message states trigger_multiple but it should have been trigger_push) Try making the trigger_push brush a bit larger or move it around a bit.
  • trigger_multiple at %1.0f %1.0f %1.0f without target: A trigger multiple was found at the given coordinates without a "target" field.
  • target_teleporter without target: A target_teleporter entity was found without target field.
  • trigger_teleport at %1.0f %1.0f %1.0f without target: A trigger_teleport entity was found at the given coordinates without "target" field.
  • teleporter without misc_teleporter_dest (%s): The destination of a teleporter with target field %s could not be found.
  • teleporter destination (%s) without origin: A teleporter destination with the target name %s was found without origin field.
  • teleporter destination (%s) in solid: A teleporter destination with the targetname %s was found to be in solid.
  • teleported into slime or lava at dest %s: A player would be pushed into slime or lave at the teleporter destination with the targetname %s.
  • trigger_multiple not in any area: A teleporter trigger was found not to be in any valid area. Try moving the trigger around a bit.
  • func_plat without model: A func_plat entity was found without model field.
  • func_plat with invalid model number: A func_plat entity was found with the model field set to some invalid number.
  • func_bobbing without model: A func_bobbing entity was found without model field.
  • func_bobbing with invalid model number: A func_bobbing entity was found with the model field set to some invalid number.
  • %s in solid at (%1.1f %1.1f %1.1f): An item with classname %s was found to be in solid at the given coordinates.
  • empty aas link heap: Some part of the map has some rather complex clipping. Reduce the geometric complexity or use clip brushes to reduce the clipping complexity.
  • too many entities in BSP file: There are too many entities in the bsp file.
  • error opening %s: Could not create a new AAS file. Hard disk might be full.
  • error writing lump %s: Could not write an AAS lump to file. Hard disk might be full.

[edit] See also

Cardigan's bot optimization tutorial
BSPC explanation by Id Software