A simple class that stores all AI related properties.
More...
#include <ai_properties.hpp>
|
| | AIProperties (RaceManager::Difficulty difficulty) |
| | Constructor. More...
|
| |
| void | load (const XMLNode *skid_node) |
| | Loads the AI properties from an XML file. More...
|
| |
| void | checkAllSet (const std::string &filename) const |
| | Check if all AI properties are defined, and aborts if some are missing. More...
|
| |
|
float | getSkiddingProbability (float distance) const |
| | Returns the skidding probability dependent on the specified distance to the first player kart.
|
| |
|
float | 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.
|
| |
|
float | getItemCollectProbability (float distance) const |
| | Returns the probability to collect an item depending on the distance to the first player kart.
|
| |
|
bool | disableSlipstreamUsage () const |
| | Returns true if this kart should not even get a slipstream bonus.
|
| |
|
|
static float | UNDEFINED = -99.9f |
| | Used to check that all values are defined in the xml file.
|
| |
|
|
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. |
◆ 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_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_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_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_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_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.
The documentation for this class was generated from the following files: