|
| EndController (AbstractKart *kart, Controller *prev_controller) |
|
| ~EndController () |
| The destructor deletes the shared TrackInfo objects if no more EndController instances are around.
|
|
virtual void | update (int ticks) |
| Updates the ai base controller each time step.
|
|
virtual void | reset () |
|
virtual bool | action (PlayerAction action, int value, bool dry_run=false) |
| The end controller must forward 'fire' presses to the race gui.
|
|
virtual void | newLap (int lap) |
| Callback when a new lap is triggered.
|
|
virtual bool | canGetAchievements () const |
| Only local players can get achievements.
|
|
virtual bool | isPlayerController () const |
| Returns if the original controller of the kart was a player controller.
|
|
virtual bool | isLocalPlayerController () const |
| Returns if the original controller of the kart was a local player controller.
|
|
core::stringw | getName (bool include_handicap_string=true) const |
| Returns the name of the previous controller (which has the right player name associated).
|
|
| AIBaseLapController (AbstractKart *kart) |
| This is the base class for all AIs.
|
|
virtual void | reset () |
|
| AIBaseController (AbstractKart *kart) |
|
virtual void | reset () OVERRIDE |
|
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.
|
|
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.
|
|
virtual bool | isLocalPlayerController () const OVERRIDE |
| This function checks if this is a local player.
|
|
virtual bool | action (PlayerAction action, int value, bool dry_run=false) OVERRIDE |
| Default: ignore actions.
|
|
virtual void | skidBonusTriggered () OVERRIDE |
|
virtual bool | saveState (BareNetworkString *buffer) const OVERRIDE |
|
virtual void | rewindTo (BareNetworkString *buffer) OVERRIDE |
|
void | setNetworkAI (bool val) |
|
virtual void | update (int ticks) OVERRIDE |
|
| Controller (AbstractKart *kart) |
| Constructor, saves the kart pointer and a pointer to the KartControl of the kart.
|
|
virtual void | reset ()=0 |
|
virtual void | update (int ticks)=0 |
|
virtual void | handleZipper (bool play_sound)=0 |
|
virtual void | collectedItem (const ItemState &item, float previous_energy=0)=0 |
|
virtual void | crashed (const AbstractKart *k)=0 |
|
virtual void | crashed (const Material *m)=0 |
|
virtual void | setPosition (int p)=0 |
|
virtual bool | isLocalPlayerController () const =0 |
| This function checks if this is a local player.
|
|
virtual bool | isPlayerController () const =0 |
| This function checks if this player is not an AI, i.e.
|
|
virtual bool | disableSlipstreamBonus () const =0 |
|
virtual bool | saveState (BareNetworkString *buffer) const =0 |
|
virtual void | rewindTo (BareNetworkString *buffer)=0 |
|
virtual void | rumble (float strength_low, float strength_high, uint16_t duration) |
|
virtual void | setControllerName (const std::string &name) |
| Sets the controller name for this controller.
|
|
const std::string & | getControllerName () const |
| Returns the name of this controller.
|
|
virtual bool | action (PlayerAction action, int value, bool dry_run=false)=0 |
| Default: ignore actions.
|
|
virtual void | newLap (int lap)=0 |
| Callback whenever a new lap is triggered.
|
|
virtual void | skidBonusTriggered ()=0 |
|
virtual void | finishedRace (float time)=0 |
| Called whan this controller's kart finishes the last lap.
|
|
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.
|
|
AbstractKart * | getKart () const |
| Returns the kart controlled by this controller.
|
|
|
static void | enableDebug () |
|
static void | setTestAI (int n) |
|
static int | getTestAI () |
|
virtual void | update (int ticks) |
| Updates the ai base controller each time step.
|
|
virtual unsigned int | getNextSector (unsigned int index) |
| Returns the next sector of the given sector index.
|
|
virtual void | newLap (int lap) |
| Triggers a recomputation of the path to use, so that the AI does not always use the same way.
|
|
float | steerToAngle (const unsigned int sector, const float angle) |
| This function steers towards a given angle.
|
|
void | computePath () |
| Computes a path for the AI to follow.
|
|
virtual void | raceFinished () |
| Nothing special to do when the race is finished.
|
|
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.
|
|
float | steerToPoint (const Vec3 &point) |
| Computes the steering angle to reach a certain point.
|
|
float | normalizeAngle (float angle) |
| Normalises an angle to be between -pi and _ pi.
|
|
bool | isStuck () const |
| This can be called to detect if the kart is stuck (i.e.
|
|
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.
|
|
virtual void | setSteering (float angle, float dt) |
| Converts the steering angle to a lr steering in the range of -1 to 1.
|
|
virtual bool | canSkid (float steer_fraction)=0 |
| Return true if AI can skid now.
|
|
int | m_track_node |
| The current node the kart is on.
|
|
LinearWorld * | m_world |
| Keep a pointer to world.
|
|
std::vector< int > | m_successor_index |
| Which of the successors of a node was selected by the AI.
|
|
std::vector< int > | m_next_node_index |
| For each node in the graph this list contains the chosen next node.
|
|
std::vector< std::vector< int > > | m_all_look_aheads |
| For each graph node this list contains a list of the next X graph nodes.
|
|
bool | m_enabled_network_ai |
|
float | m_kart_length |
| Length of the kart, storing it here saves many function calls.
|
|
float | m_kart_width |
| Cache width of kart.
|
|
Track * | m_track |
| Keep a pointer to the track to reduce calls.
|
|
const AIProperties * | m_ai_properties |
| A pointer to the AI properties for this kart.
|
|
AbstractKart * | m_kart |
| Pointer to the kart that is controlled by this controller.
|
|
KartControl * | m_controls |
| A pointer to the main controller, from which the kart takes it commands.
|
|
std::string | m_controller_name |
| The name of the controller, mainly used for debugging purposes.
|
|
static bool | m_ai_debug = false |
|
static int | m_test_ai = 0 |
| Stores the '–test-ai=n' command line parameter: It indicates which fraction of the AIs are going to be the test AI: 1 means only to use the TestAI, 2 means every second AI will be test etc.
|
|