...grave bot... a Half-Life engine AI


Grave Bot is based off of the HPB Bot template 4 merged with some HPB Bot 4.0 code. So, nearly everything supported by the HPB is also supported by Grave Bot. However, Grave Bot has many enhancements which go beyond the HPB Bot. Most of these changes are shared between all of the supported mods (HLDM/Crabbed and S&I for now).

- Updating waypoint structure, the new structure can store a singe nearby entity for the waypoint to reference. This is used in goal finding so the bot may location appropriate goals.
- All weapon properties can be modified in game by console commands. These properties include priority, firing distances, firing rates, ammo consumption, etc.
- Movement which is not dependent on the bot's view angle. A bot can look and attack an enemy while moving in an entirely different direction than the bot is facing.
- Rules of engagement that control when a bot should engage an enemy. Factors for these rules are the enemy health, the bot health, the enemy weapon, and the bot weapon. If a bot has 17 health but a Gauss, while its enemy has 63 health and a pistol, the bot may decide to engage the enemy because it has such a powerful weapon compared to the dinky pistol. On the other hand, the bot being attacked will most likely not engage due to the enemy bot's powerful weapon.
- When engaging an enemy, the bot will generally track that enemy even if the enemy gets out of its sight.
- Bots will stop engaging an enemy if the rules of engagement return a false. In our example above, the Gauss bot would flee if the pistol bot found an Egon.
- Bots will pick up nearby items if they merit being picked up (it won't go for ammo for weapon X if weapon X has full ammo). However, this doesn't distract the bot from its main goal, after picking up the item it'll resume its pathfinding.
- When engaging an enemy at close distances, bots will attempt to circle strafe (or at least strafe) left and right.
- When engaging, if an enemy gets too close, the bot will back away.
- If a bot has the longjump (for mods that support it), they'll use it to perform quick maneuvers during combat in an attempt to confuse their enemy.
- Projectile leading for weapons that are not instant-hit.

Half-Life Deathmatch

- Goal priorities change depending on location, health, armor, etc.
- The bot finds the closest goal to itself, regardless of it's type, as long as it meets specified requirements. For example, the bot first finds the closest health goal as long as it doesn't have full health and stores that location as its goal. Next it finds the closest armor goal as long as it doesn't have full armor, but only stores the goal if it is closer than the health goal. Next is the weapon goal, where it finds the closest weapon it doesn't currently possess and stores it if it's previously stored goal isn't closer (armor or health). The ammo goal is found last, and is only stored if there are no other goals to go to. If a bot has full health, armor, all (obtainable) weapons, and full ammo, it will wander the level randomly. Note: There is a chance, when concerning health, that the bot will disregard closer goals and go for health regardless. This chance is based off the amount of health a bot has left. At 25 or less health, a bot will always try to find more health.
- Bots will attack snarks.

Science and Industry

- Bots try to divide the team up into two major roles, attack and defend, and switch roles when necessary to best benefit the team.
- Attacking bots try to steal scientists which aren't already being 'targeted' by another bot.
- Attacking bots will pickup scientists dropped by their allies.
- Defending bots will patrol areas near scientists and attempt to avoid other defending bots so the defense is not concentrated in one particular area.
- Defending bots will defend scientists dropped by the enemy.
- Bots have a basic understanding of what technology has been researched and will collect correct amounts of health, armor, weaponry, and ammo.


See grave_bot_commands.txt (this file is included with the bot)