Tremfusion.net

Human bots

From TremFusion

This page is part of the bots branch

Contents

Overview

The current design for human bots is to use a multi-tiered state machine. The following image shows the highest tier:

Human States 1.png

The idea is that the bot has two major modes, in-base and out-base, which subdivide the states. State transitions are, logically, strictly allowed only along the directed lines shown. A new spawn starts the bot in 'Camp' mode, though the spawn weapon will be determined by assessing the current situation (is there a powered armoury and powered telenodes? No. Is there a builder? No. Then spawn as builder. Otherwise spawn as rifle). Spawning as builder begins the bot in Repair, spawning as rifle in Camp.

State Descriptions

Below is a description of each state. Transitions from states are described farther-down

Repair

In this state, the bot attempts to reach every buildable that has damage within the current power grid. It repairs the buildable to full health. Buildables are repaired according to a priority list. It is assumed that, on starting this state, the bot has a ckit.

Heal

In this state the bot locates the nearest medipad and moves to it. It uses the medipad until its health and stamina are recovered.

Shop

In this state the bot purchases equipment. Armor is based on the current stage and credit count, weapon is based on whether or not the bot will enter repair mode, what the rest of the team currently possesses, and credit count. For instance, if the bot is wealthy enough, it won't choose a lucifer over a chaingun if the rest of the team already has enough lucifer cannons. This helps the bot fulfill a support role on the team. Also, accessories purchases such as jetpacks, battery packs and grenades will be based on whether or not the bot will soon enter a rush or escort mode. For a rush, a grenade and battery pack will be taken, if the bot uses an energy weapon. For escort, a jetpack will be taken if the subject of the escort has one, a battery pack if not and the bot is using an energy weapon. Jetpacks will also randomly be selected for camping mode, if the bot also is choosing an appropriate weapon (lgun, rifle, chaingun, md).

Camp

Camp mode indicates that the bot intends to defend the base, though this is certainly not an absolute as it can change to other states easily. Camp mode will cause the bot to patrol an area of the base, locate any enemies and fire on them.

Escort

The bot will escort a given player, maintaining a close distance and firing on any threats. It will do this until the subject dies or it enters the human base. This mode is effective then for guarding builders who are moving the base, assisting lucifer rushers, or simply staying with a rush team.

Rush

The bot will seek out the alien base and attack it alone. It will attack enemy defenses, eggs, or the overmind. Its preference for buildable to attack will be based on the bot's character file, as well as its preference for taking opportunities to attack enemies on the way. It may attack until death or retreat, again based on the bot's character file.

Chase

The bot will continue to chase and attack a single enemy until it is dead, or a pre-determined distance between them exists, or another alien attacks it, or it has reached a pre-determined distance from the base.

Retreat

This is the only mode in which the bot will attempt to return to base. In this mode, the bot will use suppressive fire and carefully make its way back to base

State Transitions

State transitions are only allowed along the lines shown in the above image, and only according to the criteria below. 'Current base' refers to the fact that the bot is aware that it is in a base, and it is aware of the extent of the base, and there

Shop->Repair

If there is a buildable that is damaged and no other player in the current base has a ckit.

Shop->Camp

If the bot is not entering Repair. Also, if there is no powered armoury, or the armoury is unreachable.

Repair->Heal

If there are no more buildables in the current base to repair

Heal->Shop

If health and stamina are full.

= Camp->Heal

If the bot no longer has a medkit and is damaged. Also, there must not be any non-dretch aliens in the base, and the bot must not be transitioning to any out-base states

Camp->Escort

A player has requested escort via chat

Camp->Rush

The bot has enough money to purchase full armor for the stage, and the enemy is determined to be 'rush-able'. Also, the base must have at least one defender in it. Rush-ability is determined by a point system as follows:

Enemy overmind down  +10
Each enemy tyrant -2
Each ally with 1000 credits in cash or equipment +2
Each enemy dragoon -1
Each enemy free build point +0.1
Sudden death +4
Each ally with nothing but rifle -1
Each ally outside of base +1
0 allies in base -10

Camp->Chase

An enemy is in the base with less than half of its maximum hit points.

Escort->Retreat

Player the bot is escorting dies.

Rush->Retreat

Low ammo or health, based on the bot's personality file. Some bots won't retreat for ammo or health, others will. Also, if all of the enemy eggs are down and the Overmind is down.

Chase->Retreat

Enemy being chased dies or there is a personality file-based distance between the bot and the target or there is a personality file-based distance between the bot and the base or the bot is attacked by another alien.

Retreat->Heal

The bot is in a base with a medistation and there are no enemies in the base, or the bot's health/ammo is below a personality file-base threshold.