A simple class that stores all AI related properties.
More...
#include <ai_properties.hpp>
|
static float | UNDEFINED = -99.9f |
| Used to check that all values are defined in the xml file. More...
|
|
|
class | AIBaseController |
|
class | AIBaseLapController |
|
class | SkiddingAI |
|
class | ArenaAI |
|
class | TestAI |
|
A simple class that stores all AI related properties.
It acts as interface between kart_properties and AI (to avoid either passing very many individual variables, or making KartProperties a dependency of the AI). The AIs are friends of this class and so have access to its protected members.
◆ AIProperties()
Constructor.
Sets all properties to the special UNDEFINED value.
◆ checkAllSet()
void AIProperties::checkAllSet |
( |
const std::string & |
filename | ) |
const |
Check if all AI properties are defined, and aborts if some are missing.
- Parameters
-
filename | Name of the file from which the properties are read. Only used for error messages. |
◆ disableSlipstreamUsage()
bool AIProperties::disableSlipstreamUsage |
( |
| ) |
const |
|
inline |
Returns true if this kart should not even get a slipstream bonus.
◆ getItemCollectProbability()
float AIProperties::getItemCollectProbability |
( |
float |
distance | ) |
const |
|
inline |
Returns the probability to collect an item depending on the distance to the first player kart.
◆ getSkiddingProbability()
float AIProperties::getSkiddingProbability |
( |
float |
distance | ) |
const |
|
inline |
Returns the skidding probability dependent on the specified distance to the first player kart.
◆ getSpeedCap()
float AIProperties::getSpeedCap |
( |
float |
distance, |
|
|
int |
ai_position, |
|
|
int |
num_ai |
|
) |
| const |
Returns the fraction of maximum speed the AI should drive at, depending on the distance from the player.
◆ load()
void AIProperties::load |
( |
const XMLNode * |
ai_node | ) |
|
Loads the AI properties from an XML file.
- Parameters
-
ai_node | The XML node containing all AI properties. |
◆ m_bad_item_closeness_2
float AIProperties::m_bad_item_closeness_2 |
|
protected |
If a good item and a bad item are closer than this distance, a good item will be avoided (in order to avoid the bad item).
If the items are further apart, it is assumed that there is enough time to change steering direction.
◆ m_collect_avoid_items
bool AIProperties::m_collect_avoid_items |
|
protected |
Actively collect and avoid items.
◆ m_collect_item_probability
To determine the probability of selecting an item.
◆ m_disable_slipstream_usage
bool AIProperties::m_disable_slipstream_usage |
|
protected |
Used for low level AI to not give them a slipstream bonus.
Otherwise they tend to build 'trains' (AIs driving close behing each other and get slipstream bonus). Only for making the easy AI really easy.
◆ m_false_start_probability
float AIProperties::m_false_start_probability |
|
protected |
Probability of a false start.
Note that Nolok in boss battle will never have a false start.
◆ m_first_speed_cap
To cap maximum speed if the kart is ahead of the player.
◆ m_handle_bomb
bool AIProperties::m_handle_bomb |
|
protected |
If the AI should actively try to pass on a bomb.
◆ m_ident
std::string AIProperties::m_ident |
|
protected |
An identifier like 'easy', 'medium' or 'hard' for this data set.
◆ m_item_usage_skill
int AIProperties::m_item_usage_skill |
|
protected |
Determines the strategies used by the AI for items.
0 is no use, 1 is random use ; 2 to 5 use varying tactics, with 2 having the worst and 5 the best.
◆ m_make_use_of_slipstream
bool AIProperties::m_make_use_of_slipstream |
|
protected |
True if the AI should avtively try to make use of slipstream.
◆ m_max_item_angle
float AIProperties::m_max_item_angle |
|
protected |
Maximum direction change when trying to collect an item.
Items that are more than this away, will not even be considered.
◆ m_max_item_angle_high_speed
float AIProperties::m_max_item_angle_high_speed |
|
protected |
Maximum direction change when trying to collect an item while being on high-speed (i.e.
skidding bonus, nitro, ...). Items that are more than this away, will not even be considered.
◆ m_max_start_delay
float AIProperties::m_max_start_delay |
|
protected |
◆ m_min_start_delay
float AIProperties::m_min_start_delay |
|
protected |
◆ m_nitro_usage
int AIProperties::m_nitro_usage |
|
protected |
How the AI uses nitro.
0 correspond to no use ; 1 to immediate use 2 to 4 to various levels of mastery (the AI tries to accumulate a reserve and to use bursts whose size/spacing varies according to the level).
◆ m_shield_incoming_radius
float AIProperties::m_shield_incoming_radius |
|
protected |
Distance at which a detected projectile triggers a shield.
◆ m_skid_probability
The array of (distance, skid_probability) points.
◆ m_skidding_threshold
float AIProperties::m_skidding_threshold |
|
protected |
TODO: ONLY USE FOR OLD SKIDDING! CAN BE REMOVED once the new skidding works as expected.
The minimum steering angle at which the AI adds skidding. Lower values tend to improve the line the AI is driving. This is used to adjust for different AI levels.
◆ m_straight_length_for_zipper
float AIProperties::m_straight_length_for_zipper |
|
protected |
Minimum length of a straight in order to activate a zipper.
◆ m_time_full_steer
float AIProperties::m_time_full_steer |
|
protected |
Time for AI karts to reach full steer angle (used to reduce shaking of karts).
◆ UNDEFINED
float AIProperties::UNDEFINED = -99.9f |
|
staticprotected |
Used to check that all values are defined in the xml file.
The documentation for this class was generated from the following files: