#include <botai.h>
Public Types | |
enum | TBotMovingDir { EMoveForward, EMoveBackwards, EMoveLeft, EMoveRight } |
Bot moving directions. More... | |
Public Member Functions | |
CBotAI () | |
Default constructor. | |
virtual | ~CBotAI () |
Destructor. | |
virtual void | think ()=0 |
Pure virtual think method. | |
virtual void | init (int &aSpeed, int &aArmour, int &aAiming) |
Initializing method to configure attributes of the bot. | |
void | resetAction () |
Reset action to EActionNone . | |
void | move (TBotMovingDir aDir) |
Move bot to the given direction. | |
void | shoot (float aDir) |
Shoot to the given direction with the current weapon. | |
void | bunker () |
Bunker/unbunker bot. | |
void | pickWeapon () |
Pick up a weapon. | |
void | dropWeapon () |
Drop a weapon. | |
int | action () |
Getter for action. | |
bool | checkAction () |
Check validity of the action. | |
Data Fields | |
CTileMap * | mTileMap |
Map of the surrounding world. | |
list< CVisibleBotInfo * > | mBots |
List of all visible bots. | |
list< CVisibleWeaponInfo * > | aWeapons |
List of all visible weapons. | |
list< CVisibleBulletInfo * > | mBullets |
List of all visible bullets. | |
list< float > | mSourcesOfNoise |
List of sources causing noise. | |
CBotInfo | mData |
Information about this bot. |
Bots are controlled using think() method once in every frame. Action flags are used to define bot movement and other actions (see TBotAction).
Robot specifications. The purpose of this document is to specify abilities and disabilities of the robots and define basic rules of controlling them. Robots are acting in simplified tile based environment. Tile is a rectangular block with a constant size, namely 100 units/side. Block can be either wall, obstacle or an emty block. The robot is equipped with quite inadvanced mobilizing utilities, and it can only move in four directions (forward, backwards, left or right). Moving speed is constant, 25 units/round forward and 10 units/round to other directions. In order to change direction, the robot is able to turn 18 degrees/round. For input the robot uses a radar cabable of scanning an sector of 90 degrees with infinite radius. The radar can scan areas behind an obstacle, while unveiling it's existence, but not thorough walls. Besides the radar, the robot has multiple sound sensors that are used with an accurate timer to get the direction to the source of the sound. With a robotic arm the robot can aim within an 40 degree span and can be used to launch a weapon. It can be controlled simultaneously with the servo motors used for movement, but while moving shooting is not as accurate as while standing still. The accurancy can be further improved with a bunker mode, which stabilises the arm and shields the essentials 25% better. Switching between bunker mode and movement mode takes 4 rounds. The arm can also pick up a weapon found lying somewhere, requiring 2 rounds of staying still.
|
Bot moving directions. Direction can be only one of these.
|
|
Getter for action.
|
|
Bunker/unbunker bot.
Action duration 4 rounds. If |
|
Check validity of the action.
Only one of
|
|
Drop a weapon.
Action duration 2 rounds. If |
|
Initializing method to configure attributes of the bot. Bot speed, armour and aiming can be adjusted with different power, from 50% up to 150%. However, total power is scaled to be 300%. All attributes are 100% by default.
|
|
Move bot to the given direction.
If
|
|
Pick up a weapon.
Action duration 2 rounds. If |
|
Shoot to the given direction with the current weapon.
If
|
|
Pure virtual think method. All bots must be provided with AI by implementing this method. |
|
List of all visible bullets. Bullets are usually fast, but may be detected and dodged. |
|
List of sources causing noise. Only angle of incidence can be detected. |
|
Map of the surrounding world. Bot is placed in the middle of the map (tile 0, 0). |