cube_bot-readme.txt 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. Official 'Cube with Bots' readme.
  2. Current version: 0.32
  3. AUTHOR:
  4. Rick Helmus
  5. E-Mail: rickhelmus@gmail.com
  6. MSN: rick_helmus8@hotmail.com
  7. ICQ: 224332897
  8. AIM: rickakame
  9. CONTENT
  10. 1. Features
  11. 2. Installing & Uninstalling
  12. 2.1 Installing
  13. 2.2 Uninstalling
  14. 3. Starting a game
  15. 4. Bot settings
  16. 4.1 Bot names & teams
  17. 4.2 Bot skills
  18. 4.3 Bot configuration file
  19. 5. Bot commands & CVARS
  20. 5.1 How to execute a command
  21. 5.2 List of all server side commands
  22. 5.3 List of all client side commands
  23. 5.4 How to change a bot CVAR
  24. 5.5 List of all bot CVARS
  25. 5.6 List of all waypoint commands
  26. 6. Waypoints
  27. 6.1 What are waypoints?
  28. 6.2 When should I make my own waypoints?
  29. 6.3 List of all waypoint commands
  30. 6.4 How to use & Tips
  31. 7. Dedicated servers
  32. 8. Source code
  33. 9. Credits
  34. 10. Questions, suggestions, comments etc
  35. 1. FEATURES:
  36. See the file 'changelog.txt' in your cube/bot folder.
  37. 2. INSTALLATION & UNSTALLATION
  38. 2.1 Installing
  39. Extract all the files to your cube folder.
  40. Don't worry it won't overwrite any cube specific files.
  41. Note: Since the file structure changed a bit, it might be handy to uninstall previous cube bot versions first.
  42. 2.2 Uninstalling
  43. If you want for some reason uninstall the bots you have to delete these files:
  44. - The bot folder,
  45. - bin/cubebot.exe
  46. - 'cube_bot_linux',
  47. - 'cube_bot_fbsd',
  48. - 'cube_bot_win.bat',
  49. - 'cube_bot_linux-ded',
  50. - 'cube_bot_fbsd-ded',
  51. - 'cube_bot_win-ded.bat'
  52. - This file
  53. 3. STARTING A GAME
  54. Run either cube_bot_win.bat (for windows users), cube_bot_fbsd(for FreeBSD users) or cube_bot_lin (for linux users).
  55. For linux/unix users: if you have problems with running cube, you might want to 'chmod it'.
  56. Type this in a console in your cube directory:
  57. chmod +x ./cube_bot_lin
  58. To add a bot you can simply open the main menu(esc) and open the bot menu, from there
  59. you can add a bot in a team or change the default bot skill.
  60. You can also use the addbot command(see section 6) to add a bot.
  61. Bots work for every singleplayer and multiplayer mode. In singleplayer they will help you to fight monsters and finish a level.
  62. In multiplayer they try to kill you instead ;-)
  63. For dedicated servers see section 7.
  64. 4. BOT SETTINGS
  65. 4.1 Bot names and teams
  66. When you add a bot and don't specifiy a name, the bot will pick a name from the file
  67. 'bot_names.txt' in the folder cube/bot. This is a plain text file, you can modify existing names
  68. and add up to 150 names. Note that names in cube can't contain more than 16 characters.
  69. When you add a bot and don't specify his team, it will pick one from the file 'bot_teams.txt'
  70. found in the cube/bot folder. This file can contain 20 different team names with a maximal
  71. length of 5 characters.
  72. 4.2 Bot skills
  73. There are 5 skills for the bots. The skill for a bot can be specified from the menu or via the console(see section 6).
  74. Each skill can be modified by editing the file 'bot_skills.txt' found in the bot folder.
  75. 4.3 Bot configuration file
  76. 5. BOT COMMANDS
  77. 5.1 How to execute a bot command
  78. There are 2 ways to execute a (bot)command:
  79. - Hit the chat key(default t) and type /<commandhere>
  80. - Hit the console key(default ~) and type the command.
  81. 5.2 List of all server side bot commands
  82. Server side commands(works if your the host, otherwise people have to vote for it):
  83. addbot <teamname> <skill> <botname>
  84. Adds a bot in the current game. Command arguments:
  85. <teamname>: Specifies the team for the bot, when you leave it blank or
  86. use "random" as team the bot will choose a team from the file
  87. 'bot/bot_teams.txt'.
  88. <skill>: The skill of the bot; can be best, good, medium, worse, bad, default or random.
  89. When blank or "default" is used as skill, the bot will use skill good. When "random" is used,
  90. the bot will use a random skill.
  91. <name>: The name for this bot. When blank the bot will pick a name from the
  92. file 'bot/bot_names.txt'
  93. Examples:
  94. To add a bot with a random team, default skill(good) and a random name:
  95. addbot
  96. To add a bot in team red, default skill with the name Joe:
  97. addbot red default Joe
  98. addnbot <count> <teamname> <skill>
  99. Adds multiple bots to the game. Command arguments:
  100. <count>: Number of bots to add.
  101. <teamname>: Specifies the team for the bots, when you leave it blank or
  102. use "random" as team the bot will choose a team from the file
  103. 'bot/bot_teams.txt'.
  104. <skill>: The skill of the bot; can be best, good, medium, worse, bad, default or random.
  105. When blank or "default" is used as skill, the bot will use skill good. When "random" is used,
  106. the bot will use a random skill.
  107. kickbot <botname>
  108. Will kick the bot with the name <botname> from the server.
  109. Example: To kick bot Joe from the server:
  110. kickbot Joe
  111. kickallbots
  112. Will kick all bots from the server
  113. botskill <botname> <skill>
  114. Will change the skill of the bot with the name <botname> to <skill>.
  115. <skill> can be best, good, medium, worse or bad.
  116. Example:
  117. To change the skill of the bot Joe to best:
  118. botskill Joe best
  119. botskillall <skill>
  120. Will change the bot skill and the default skill to <skill>.
  121. <skill> can be best, good, medium, worse or bad.
  122. 5.3 List of all client side commands(Works if you're a host or joined a server):
  123. drawbeamtobots
  124. Will draw some particles(same as the rifle) to all bots. This more used for
  125. debugging to see where the bots are :-)
  126. togglegrap
  127. Will toggle the focus of the mouse in game. Normally you can use your mouse to look around,
  128. when you type this command your mouse cursor is visible and can be used as normally. This is only
  129. usefull when you run cube windowed ofcourse.
  130. togglebotview <botname>
  131. When used you will see what the bot with the name <botname> sees. Type it again
  132. (with or without name) to return to the game(you will respawn).
  133. 5.4 How to change a bot cvar
  134. This works like bot commands: First open the console (with the chat key or the console key),
  135. then just type the variabele name and put the desired value after it.
  136. 5.5 List of all bot CVARS (Server side variabels, host only)
  137. botsshoot 1|0
  138. Enables or disables bot shooting. 1 is enabled, 0 is disabled. Default is 1.
  139. idlebots 1|0
  140. When enabled, all bots are idle(they won't 'think'). 1 is enabled, 0 is disabled. Default is 0.
  141. maxbots 0-50
  142. Specifies how many bots can be in a game. Ranges from 0 to 50, default is 7.
  143. Note that there cannot be more bots than maxclients-1(so atleast one human can be in the game).
  144. allowaddbotvotes 1|0
  145. When enabled, clients are able to add bots through voting. 1 is enabled, 0 is disabled. Default is 1.
  146. allowbotskillvotes 1|0
  147. When enabled, clients are able to change the bots skill through voting. 1 is enabled, 0 is disabled.
  148. Default is 1.
  149. allowkickbotvotes 1|0
  150. When enabled, clients are able to kick bots through voting. 1 is enabled, 0 is disabled.
  151. Default is 1.
  152. monstersperbot 1-25
  153. Specifies how with how much the total monster count should be increased in DMSP mode. This number also depends on the skill:
  154. nr of monsters = monster skill x monstersperbot cvar.
  155. So for example, if monstersperbot is 7(default) and the monster skill is 8, the total monster count will be 7x8=56.
  156. monsterspawnmillis 1-2000
  157. Specifies the delay in milliseconds for when new monsters should be added in DMSP mode. The default is 1000(=1 second).
  158. Decrease this value if you want a monster war :) You should use it with caution though, since many monsters at the same time will
  159. be very CPU intensive.
  160. Note: The formula for the number of new monsters per spawn is: 1 + 1/3 of the number of bots ingame.
  161. So for example, if monsterspawnmillis is 1000 and there are 3 bots ingame, there will be
  162. 1 + 1 (1/3 of 3 = 1) = 2 monsters that will spawn every second.
  163. 6. WAYPOINTS
  164. 6.1 What are waypoints?
  165. Waypoints are used by bots to help them navigate through a map. A waypoint
  166. is simply a spot in a map, by connecting them with other waypoints bots know how to
  167. move from waypoint to waypoint. Note that waypoints can be connected 1 way or 2 way,
  168. if a waypoint is connected 1 way this means that waypoint A can be connected with B, but
  169. B is NOT connected to A.
  170. The waypoints are stored in the directory bot/waypoints in your cube directory.
  171. When waypoint viewing is enabled(see the 'wpvisible' command below) you can view all the waypoints
  172. in the current map. Jump waypoints are red lines, the nearest normal waypoint
  173. is a green line and all the others are blue lines. Connections between waypoints are
  174. white lines. If a waypoint has a yaw(see the 'setwpyaw' command below) a short red line from the waypoint
  175. in the direction taken from the yaw will be drawed.
  176. 6.2 When should I make my own waypoints?
  177. If a map is loaded and no waypoints exist for this map, it will be flooded with waypoints(Automatically waypointed).
  178. For most of the multiplayer maps this is enough(except complex maps like '32') but for SP(Single Player) maps
  179. its better to make your own waypoints. This because these maps are generally more complex and there are one or more goals.
  180. However the following SP maps are already waypointed by me or can be played without custom made waypoints:
  181. - cruel01 & cruel02
  182. - kksp1
  183. - nsp2
  184. - wsg1 & wsg2 & wsg3
  185. - mpsp4
  186. 6.3 Waypoint commands
  187. addwp
  188. Adds a waypoint at the place where you are, all nearby waypoints will be connected with it.
  189. delwp
  190. Deletes the nearest waypoint.
  191. wpsave
  192. Saves the waypoints to a file.
  193. wpload
  194. Loads waypoints from a file, only handy when you want to undo your changes.(Waypoints will
  195. be loaded automaticly when a map is started).
  196. wpclear
  197. Will clear all waypoints from the map. You usually want to use this to clear all automaticly generated
  198. waypoints when you start making your own waypoints.
  199. wpvisble 1|0
  200. When enabled(1) you can view all the waypoint in the current map, 0 will
  201. disable this. (Waypoints will be automaticly visible when you use any
  202. waypoint command). Jump waypoints are red lines, the nearest normal waypoint
  203. is a green line and others are blue lines. Connections between waypoints are
  204. white lines.
  205. autowp 1|0
  206. Enables(1) or disables(0) autowaypointing. When enabled you will drop waypoints while
  207. you walk around in the map.
  208. wpinfo 1|0
  209. If enabled(1)(disabled=0) you can view info(such as waypoint property flags, trigger numbers, yaw etc) from
  210. a nearby waypoint.
  211. addtelewps
  212. Adds waypoints on all teleporters and their destination in the current map and connects
  213. the waypoints at a teleporter with the waypoint at its destination.
  214. addtriggerwps
  215. Adds waypoints at all triggers(such as carrots and switches) in the current map.
  216. setwptriggernr <nr>
  217. Assigns a number to the nearest waypoint. This is only used for trigger waypoints, so that the bots go to triggers in the
  218. right order. If you don't do this bots will search for every trigger, even when they are not reachable yet.
  219. setwpyaw
  220. Sets the yaw of this waypoint. If a bot reaches a waypoint with a given yaw, it equalize his yaw with the one from
  221. the waypoint. This is usefull for very narrow spaces or jump waypoints.
  222. The yaw is taken from the yaw of the player.
  223. addpath1way1
  224. Selects first waypoint to connect with another waypoint.
  225. addpath1way2
  226. Will connect the waypoint you selected with the command 'addpath1way1' with the
  227. nearest waypoint.
  228. addpath2way1, addpath2way2
  229. Same as above, though it will connect both waypoints
  230. with each other(that is there is a connection between the one
  231. you select with 'addpath2way1' and the nearest waypoint AND there
  232. is a connection between the nearest waypoint and the one you
  233. selected with 'addpath1way1').
  234. delpath1way1, delpath1way2, delpath2way1, delpath2way2
  235. Same as above, but will remove connections between waypoints.
  236. setjumpwp
  237. Makes the nearest waypoint a "jump waypoint" this simply means that a bot will
  238. jump when it reaches this waypoint(usefull when the bot has to jump over an obstacle
  239. for example).
  240. unsetjumpwp
  241. Removes the jump flag from the nearest waypoint.
  242. startflood
  243. Starts flooding the map with waypoints. This is normally done when the game starts and no waypoints exist for the current map.
  244. 6.4 How to use & Tips
  245. 6.4.1 Simple howto
  246. Lets say you want to make waypoints for map 'foo'. This map is a singleplayer map you found on Quadropolis(http://cube.snieb.com/).
  247. Here are some simple steps to waypoint the map:
  248. - Start the game(see section 3) and load the map. Since its a singleplayer map it may be better to load it in
  249. multiplayer mode, so you won't get killed during waypointing ;)
  250. - Now since the map is automaticly waypointed, the best thing todo is to clear these waypoints first.
  251. Simply type 'wpclear' in the console to remove them.
  252. - Map foo has several teleporters, therefore its handy to put some waypoints on them and their destination. Luckely there is a
  253. command which does that and will even connect the waypoint on the teleporter with the waypoint on the teleport-destination.
  254. Simply type 'addtelewps' in the console to add them.
  255. - Like most maps, foo has several triggers to open doors, unlock monsters etc. The command 'addtriggerwps' will put waypoints on all
  256. the triggers for you.
  257. - Now you can actually start waypointing. On simple, not complex places you can type 'autowp 1' so it will drop
  258. waypoints (within a certain radius) where you walk and connect them(2 way) with each other. However on more complex places
  259. (for example a place where you have to climb up) its better to place them manually with the command 'addwp'.
  260. - After thats its a good thing to givbe the 'trigger waypoints' a number. Bots will go to the trigger with the
  261. lowest number(except 0) first, then go to the next one and the next one etc etc. First type 'wpinfo 1' so you can see which
  262. waypoints are trigger waypoints and which not. Now go to the trigger waypoint which should be triggered first and type
  263. 'setwptriggernr 1'. Then go to the next trigger waypoint and type 'setwptriggernr 2' and continue like that untill you're done.
  264. Note: If the order doesn't matter(very rare) you can skip this step.
  265. - When you're done type 'wpsave' to save the waypoints, reload the map and add some bots to check if they can finish the map by
  266. their selves :-)
  267. 6.4.2 Waypoint tips
  268. - If you start with new waypoints, its mostly better to type 'wpclear' in the console to remove the waypoints which where automaticly
  269. generated. If, however, you just want to make some minor modifications you can leave them.
  270. - When you waypint a singleplayer map, its better to load the map in multiplayer mode so you the monsters won't annoy you.
  271. - On narrow spaces its better to manually waypoint with 'addwp' and disable autowaypointing('autowp 0').
  272. - Always check if every waypoint is connected with the right waypoints. Waypoints can be connected with to
  273. much waypoints or not connected at all. The following commands can be used to solve this: addpath1way1, addpath1way2, addpath2way1,
  274. addpath2way2, delpath1way1, delpath1way2, delpath2way1 and delpath2way2.
  275. - If a bot should jump somewhere you can set the jump flag with the command 'setjumpwp'. Its handy to set the direction to where
  276. the bot should jump to with the command 'setwpyaw'.
  277. 7. DEDICATED SERVERS
  278. As of release 0.3 there is dedicated support! :) Though the standalone server binary is less light than the one
  279. for cube. It also needs some additional directories/files:
  280. - The bot folder
  281. - The packages folder, however it only needs the map files so you can remove all the sounds and textures.
  282. - Server script file
  283. If you want to configure bot cvars, add a few bots on startup etc. You should edit the bot.cfg file in the bot folder.
  284. Explanation can be found in the file itself.
  285. You can start a server by executing on of the following scripts:
  286. cube_bot_linux-ded (linux)
  287. or
  288. cube_bot_fbsd-server (FreeBSD)
  289. or
  290. cube_bot_win-ded.bat (Windows)
  291. 8. SOURCE CODE
  292. You can find the modified source in the "bot/bot_src" directory. Atleast 90% off all the changes are
  293. marked by me with comments(mostly something like 'added by Rick').
  294. 9. CREDITS
  295. Wouter van Oortmerssen aka Aardappel and all the other people
  296. that made cube as what it is now(see the cube readme).
  297. Pierre-Marie Baty (PMB): for most of the current navigation code and other misc. code.
  298. Check out his RACC bot for half-life at racc.bots-united.com
  299. Botman : 'The father of all half-life bots'. He created the HPB bot(hpb-bot.bots-united.com) which
  300. is the base for almost all half-life bots. A lot of ideas are inspired by him.
  301. arghvark : Fix for ATI based gfx cards on linux.
  302. Internet Nightmare : Optimizing waypoint file reading/writing
  303. People at bots-united forums and cube forums: For feedback, suggestions, reporting bugs
  304. and bot names :)
  305. 10. Questions, suggestions, comments etc
  306. Feel free to send them to me :) (check top of file for contact info)
  307. You can also visit the forums: http://forums.bots-united.com/forumdisplay.php?f=77