Open Source Platform
for interconnected virtual worlds

Setting up bots

From RexWiki

Contents

Bot Example

  • Find RexBots_example.xml file from server folder.
  • Rename the file to RexBots.xml.
  • Example bots should be now present in your world.

Bot configuration file - RexBots.xml

The bot configuration file is an xml file and it is separated into two parts. First part contains bot definitions and the second part contains path definitions which the bots can use to walk around the world.

Bot definitions

<bot> tag is used to define a new bot. Each bot must have exactly one bot definition. Descriptions of tags:

  • <first_name> first name of the bot, need not be unique
  • <last_name> last name of the bot, need not be unique
  • <storage_address> bot appearance will be fetched from this avatar storage address
  • <disable_walk> if true, the bot may not walk
  • <movement_mod> multiplier for the bot movement speed
  • <admin_mode> if true, the bot will follow simple chat commands
  • <path> navigation path the bot should use
    • name name of the path navigation mesh to use
    • start_node index of the node the bot should start at
    • random if true, the bot will move randomly from node to node
    • reverse if true, the both moves the path in reverse
    • mode which mode of transport to use for the whole path 'fly' or 'walk'
    • allow_u used with 'random' attribute. if false, the bot will never turn around but always moves along the path
    • timeout the bot will automatically teleport to the next node in the path after timeout period (in seconds) has passed. The timeout is reset after the bot passes a node in the path. This is to prevent the bot from getting stuck.

Path definitions

<navi_mesh> tag is used to define new navigation path. Each path should have unique name. Each path consist of nodes and edges connecting the nodes. Nodes are 3D positions in the world in the form of "x,y,z". You can use the viewer to get these positions. Travel to the position with your avatar and open the map screen. The coordinates are shown on the map screen. Edges are paths between nodes that the bot can travel. You can have several edges leaving one node and specify 'random' attribute to have the bot randomly select one. Following attributes are available:

  • name unique name for the path
  • default_mode default mode to use for all the edges in the path, 'fly' or 'walk'

Defining node:

  • <mesh_node> define new node in the path
    • p position in the world for the node
  • <mesh_edge> define new edge in the path
    • e1 starting node for the edge
    • e2 ending node for the edge
    • mode travel mode the bot should use when on this edge, either 'fly' or 'walk'

Bot scripting

It is also possible to control bots from Python script, see Controlling bots from Python script.