|
|
| BattleAI (AbstractKart *kart) |
| |
|
| ArenaAI (AbstractKart *kart) |
| |
| virtual void | update (int ticks) OVERRIDE |
| | This is the main entry point for the AI. More...
|
| |
|
virtual void | reset () OVERRIDE |
| | Resets the AI when a race is restarted.
|
| |
| virtual void | newLap (int lap) OVERRIDE |
| | Callback whenever a new lap is triggered. More...
|
| |
|
| AIBaseController (AbstractKart *kart) |
| |
|
virtual bool | disableSlipstreamBonus () const OVERRIDE |
| | Certain AI levels will not receive a slipstream bonus in order to be not as hard.
|
| |
| virtual void | crashed (const Material *m) OVERRIDE |
| | This is called when the kart crashed with the terrain. More...
|
| |
|
virtual void | crashed (const AbstractKart *k) OVERRIDE |
| |
|
virtual void | handleZipper (bool play_sound) OVERRIDE |
| |
|
virtual void | finishedRace (float time) OVERRIDE |
| | Called whan this controller's kart finishes the last lap.
|
| |
|
virtual void | collectedItem (const ItemState &item, float previous_energy=0) OVERRIDE |
| |
|
virtual void | setPosition (int p) OVERRIDE |
| |
| virtual bool | isPlayerController () const OVERRIDE |
| | This function checks if this player is not an AI, i.e. More...
|
| |
| virtual bool | isLocalPlayerController () const OVERRIDE |
| | This function checks if this is a local player. More...
|
| |
| virtual bool | action (PlayerAction action, int value, bool dry_run=false) OVERRIDE |
| | Default: ignore actions. More...
|
| |
|
virtual void | skidBonusTriggered () OVERRIDE |
| |
|
virtual bool | saveState (BareNetworkString *buffer) const OVERRIDE |
| |
|
virtual void | rewindTo (BareNetworkString *buffer) OVERRIDE |
| |
|
void | setNetworkAI (bool val) |
| |
|
| Controller (AbstractKart *kart) |
| | Constructor, saves the kart pointer and a pointer to the KartControl of the kart.
|
| |
|
virtual void | rumble (float strength_low, float strength_high, uint16_t duration) |
| |
|
const std::string & | getControllerName () const |
| | Returns the name of this controller.
|
| |
|
virtual KartControl * | getControls () |
| | Get a pointer on the kart controls.
|
| |
|
void | setControls (KartControl *kc) |
| |
|
virtual bool | canGetAchievements () const |
| | Only local players can get achievements.
|
| |
| virtual core::stringw | getName (bool include_handicap_string=true) const |
| | Display name of the controller. More...
|
| |
|
AbstractKart * | getKart () const |
| | Returns the kart controlled by this controller.
|
| |
|
| virtual void | findClosestKart (bool consider_difficulty, bool find_sta) OVERRIDE |
| | Find the closest kart around this AI, if consider_difficulty is true, AI will try to follow human players more or less depends on difficulty. More...
|
| |
|
virtual int | getCurrentNode () const OVERRIDE |
| | Return the current ArenaNode the AI located on.
|
| |
| void | tryCollectItem (Vec3 *aim_point, int *target_node) const |
| | Try to collect item in arena, if no suitable item is found, like they are swapped, it will follow closest kart instead. More...
|
| |
| void | setControllerName (const std::string &name) OVERRIDE |
| | In debug mode when the user specified –ai-debug on the command line set the name of the controller as on-screen text, so that the different AI controllers can be distinguished. More...
|
| |
| float | steerToPoint (const Vec3 &point) |
| | Computes the steering angle to reach a certain point. More...
|
| |
| float | normalizeAngle (float angle) |
| | Normalises an angle to be between -pi and _ pi. More...
|
| |
| bool | isStuck () const |
| | This can be called to detect if the kart is stuck (i.e. More...
|
| |
| void | determineTurnRadius (const Vec3 &end, Vec3 *center, float *radius) const |
| | Determine the center point and radius of a circle given two points on the circle and the tangent at the first point. More...
|
| |
| virtual void | setSteering (float angle, float dt) |
| | Converts the steering angle to a lr steering in the range of -1 to 1. More...
|
| |
| void BattleAI::findTarget |
( |
| ) |
|
|
privatevirtual |
Find a suitable target to follow, it will find the closest kart first, it's used as fallback if no item is found.
It takes the current difficulty into account, also collect life from SpareTireAI depends on current difficulty if actually they are spawned:
- Novice and intermediate - collect them only AI has 1 life only.
- Expert and supertux - collect them if AI dones't have 3 lives.
Implements ArenaAI.
Reimplemented in SpareTireAI.