Difference between revisions of "Bots:Adding bots to your map"

From Custom Map Makers Wiki
Jump to: navigation, search
(Shaping bot navigation)
 
(4 intermediate revisions by one other user not shown)
Line 8: Line 8:
 
  bspc -bsp2aas YOURMAPNAME.bsp -forcesidesvisible -optimize
 
  bspc -bsp2aas YOURMAPNAME.bsp -forcesidesvisible -optimize
  
There are other options / switches avaiable which might or might not help performance.
+
There are other options / switches available which might or might not help performance.
  
 
*reach    <filter.bsp>                = compute reachability & clusters
 
*reach    <filter.bsp>                = compute reachability & clusters
Line 50: Line 50:
  
 
==Using entities to attract bots==
 
==Using entities to attract bots==
 +
 +
There are very few entities that will attract bots in a significant way.
 +
 +
===item_botroam===
 +
item_botroam was traditionally used to attract bots to a specific part of a map, the entity has been described as being "bot candy".
 +
 +
Personal test with this entity have shown very little effect. Instead use the '''player_info_start''' entity, these do attract bots and they will visit these if they have nothing else to do.
 +
 +
Entity keys:
 +
 +
weight:    non-zero floating point value, most often in the range 0 to 400. (Higher values are allowed but keep in mind that the bot should also be attracted to normal items.  Don't make the weight value too high.
 +
notfree :  when set to 1, entity will not spawn in "Free for all" and "Tournament" modes.
 +
notteam :  when set to 1, entity will not spawn in "Teamplay" and "CTF" modes.
 +
notsingle : when set to 1, entity will not spawn in Single Player mode (bot play mode).
 +
 +
===info_camp===
 +
This entity can be placed and weighted (add the key weight to the entity) highly to attract chicken and raven bots. These have a high tendency to camp. You should use values of 300 or greater to have any real effect.
 +
 +
Entity keys:
 +
 +
range  : number of units that the bot can move away from camp entity while camping on it.
 +
weight  : number that is compared against the weight assigned to all the other camp spots in the map to determine if a bot chooses to camp there. The value is normalized against all other weight values.
 +
 +
  
 
[[Category:Bots]]
 
[[Category:Bots]]

Latest revision as of 17:05, 19 August 2011

Making the .aas file

In order to add bots to your map you will need a tool called bspc. In some versions of Radiant this tool is included with the installation. If not you'll need to download a version suitable for your operating system.

Please note: You should ALWAYS add the surface sounds before creating a .aas file.

The bspc tool is invoked from the command line, generally from the same folder as the .bsp of your map. A minimal bot build would use the following command line.

bspc -bsp2aas YOURMAPNAME.bsp -forcesidesvisible -optimize

There are other options / switches available which might or might not help performance.

  • reach <filter.bsp> = compute reachability & clusters
  • cluster <filter.aas> = compute clusters
  • aasopt <filter.aas> = optimize aas file
  • aasinfo <filter.aas> = show AAS file info
  • output <output path> = set output path
  • threads <X> = set number of threads to X
  • cfg <filename> = use this cfg file
  • optimize = enable optimization
  • noverbose = disable verbose output
  • breadthfirst = breadth first bsp building
  • nobrushmerge = don't merge brushes
  • noliquids = don't write liquids to map
  • freetree = free the bsp tree
  • nocsg = disables brush chopping
  • forcesidesvisible = force all sides to be visible
  • grapplereach = calculate grapple reachabilities

Of these, grapplereach is probably the only other switch worth trying for Urban Terror bots.

After running bspc you should find a .aas file with the same name as your map in same folder as your .bsp. This file will need to be copied to the maps folder of your pk3

Common problems

Using bot clip

Bot clip is a shader available in the common shaders set. It's purpose it to provide a solid wall which the bots cannot pass or enter.

The clip is invisible to everything except bots.

Bot clip should be used to prevent bots from falling off walls or taking routes that you do not wish them to go.

An example of this would be a swimming pool, bots are generally attracted to dropped weapons and will quite happily dive into a pool of water to pick up a grenade. Unfortunately they might not be able to get out of the water.

Block all sides of the swimming pool with bot clip.

Shaping bot navigation

In order to improve the bots navigation, especially around complex brush work, create a smooth path using 2 bot clipped walls.

Using this method you can create a clean easy to navigate pathway through your map using bot clip walls.

Using entities to attract bots

There are very few entities that will attract bots in a significant way.

item_botroam

item_botroam was traditionally used to attract bots to a specific part of a map, the entity has been described as being "bot candy".

Personal test with this entity have shown very little effect. Instead use the player_info_start entity, these do attract bots and they will visit these if they have nothing else to do.

Entity keys:

weight:     non-zero floating point value, most often in the range 0 to 400. (Higher values are allowed but keep in mind that the bot should also be attracted to normal items.  Don't make the weight value too high.
notfree :   when set to 1, entity will not spawn in "Free for all" and "Tournament" modes.
notteam :   when set to 1, entity will not spawn in "Teamplay" and "CTF" modes.
notsingle : when set to 1, entity will not spawn in Single Player mode (bot play mode).

info_camp

This entity can be placed and weighted (add the key weight to the entity) highly to attract chicken and raven bots. These have a high tendency to camp. You should use values of 300 or greater to have any real effect.

Entity keys:

range   : number of units that the bot can move away from camp entity while camping on it.
weight  : number that is compared against the weight assigned to all the other camp spots in the map to determine if a bot chooses to camp there. The value is normalized against all other weight values.