Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Xconq::AI Namespace Reference


Classes

struct  OpRole
 Operational Role. More...

struct  AI_Side
 Per-side master AI structure. More...


Enumerations

enum  OpRole_Type { OR_NONE = 0, OR_SHUTTLE, OR_CONSTRUCTOR, OR_Total }
 Types of Operational Roles. More...

enum  OpRole_Outcome { ORO_INVALID = 0, ORO_FAILED, ORO_OK, ORO_HANDLED_TACTICAL }
 Operational Role Outcomes. More...

enum  TacticalConcern { TC_NONE = 0, TC_DANGER_IMMEDIATE, TC_Total }
 Enumeration of tactical concerns. More...


Functions

void create_side_ai (Side *side)
 Create/init master AI structure associated with a side.

AI_Sideget_side_ai (Side *side)
 Return master AI structure associated with a side.

void allocate_oproles (Side *side, int nodesnum)
 Allocate a new block of oproles in pool.

OpRoleacquire_oprole (Side *side, int id, OpRole_Type type)
 Acquire oprole.

void release_oprole (OpRole *oprole)
 Release oprole.

OpRolefind_oprole (Side *side, int id)
 Find oprole associated with a particular unit ID.

int choose_utype_to_construct (OpRole *oprole, int *uscore)
 Choose utype to construct, and optionally return its relative worth.

Unitchoose_unit_to_build_upon (OpRole *oprole, int *uscore)
Unitchoose_unit_to_repair (OpRole *oprole, int *uscore)
Unitchoose_transport_to_construct_in (int u2, Side *side, UnitView *uvtspt, int upchain)
 Choose transport to construct given utype in.

Taskgenerate_construction_task (Unit *unit, int u2)
 Generate an appropriate construction task given constructor and utype.

int choose_construction_or_repair (OpRole *oprole)
 Choose a construction task to perform.

OpRole_Outcome handle_constructor_oprole (OpRole *oprole)
 Handle constructor operational role.

void handle_oprole (OpRole *oprole)
 Evaluate an operational role.

void handle_oproles (Side *side)
 Evaluate all operational roles on a side.

int n_plan_to_construct_at (Side *side, int x, int y, short *p_utypes)
 How many friendly units plan to construct at given location?

int resource_contention_with_any (int u, int x, int y, Side *side)
 Would any units be in contention with an utype at a given location?

int choose_best_hit_method (int hitmethod, int fhm, int ahm, int dhm, int ftm, int atm, int dtm)
 Given various combat stats, which hit method is preferred?

int choose_best_hit_method (Unit *unit, UnitView *uview)
 Which hit method should given unit use to hit given uview?

int guess_best_hit_method_used_by (Unit *unit, UnitView *uview)
 Which hit method should given uview use to hit given unit?

int choose_best_capture_method (int capmethod, int fcm, int acm, int dccm, int ftm, int atm, int dctm)
 Given various combat stats, which capture method is preferred?

int choose_best_capture_method (Unit *unit, UnitView *uview)
 Which capture method should given unit use to capture given uview?

int guess_best_capture_method_used_by (Unit *unit, UnitView *uview)
 Which capture method should given uview use ti hit given unit?

int turns_to_defeat_best_ratio (Unit *unit, UnitView *uview)
int seems_safe_against (Unit *unit, UnitView *uview)
 Does given unit seem safe from given uview?

int is_frightened_by (Unit *unit, UnitView *uview)
 Is given unit deathly afraid of given uview?

int is_harassed_by (Unit *unit, UnitView *uview)
 Is given unit possibly being harassed by given uview?

int choose_flee_direction (Unit *unit, int feardirs[NUMDIRS+1], int hardirs[NUMDIRS+1])
 Choose best direction, if any, to flee from fears.

TacticalConcern handle_immediate_danger (Unit *unit)
 Handle immediate danger to given unit.

TacticalConcern handle_tactical_situation (Unit *unit)
 Handle tactical situation of given unit.


Enumeration Type Documentation

enum Xconq::AI::OpRole_Outcome
 

Operational Role Outcomes.

Enumeration values:
ORO_INVALID  Oprole was invalid.
ORO_FAILED  Oprole executed with failures.
ORO_OK  Oprole executed without failures.
ORO_HANDLED_TACTICAL  Oprole executed a tactical handler.

enum Xconq::AI::OpRole_Type
 

Types of Operational Roles.

Enumeration values:
OR_NONE  No operational role.
OR_SHUTTLE  Operate as a shuttle for other units.
OR_CONSTRUCTOR  Operate as a constructor for other units.
OR_Total 

enum Xconq::AI::TacticalConcern
 

Enumeration of tactical concerns.

Enumeration values:
TC_NONE  No tactical concern.
TC_DANGER_IMMEDIATE  Immediate danger.
TC_Total  Total number of tactical concern types.


Function Documentation

OpRole * Xconq::AI::acquire_oprole Side side,
int  id,
OpRole_Type  type
 

Acquire oprole.

void Xconq::AI::allocate_oproles Side side,
int  nodesnum = OR_BLK_SZ
 

Allocate a new block of oproles in pool.

int Xconq::AI::choose_best_capture_method Unit unit,
UnitView uview
 

Which capture method should given unit use to capture given uview?

int Xconq::AI::choose_best_capture_method int  capmethod,
int  fcm,
int  acm,
int  dccm,
int  ftm,
int  atm,
int  dctm
 

Given various combat stats, which capture method is preferred?

int Xconq::AI::choose_best_hit_method Unit unit,
UnitView uview
 

Which hit method should given unit use to hit given uview?

int Xconq::AI::choose_best_hit_method int  hitmethod,
int  fhm,
int  ahm,
int  dhm,
int  ftm,
int  atm,
int  dtm
 

Given various combat stats, which hit method is preferred?

int Xconq::AI::choose_construction_or_repair OpRole *  oprole  ) 
 

Choose a construction task to perform.

int Xconq::AI::choose_flee_direction Unit unit,
int  feardirs[NUMDIRS+1],
int  hardirs[NUMDIRS+1]
 

Choose best direction, if any, to flee from fears.

Unit * Xconq::AI::choose_transport_to_construct_in int  u2,
Side side,
UnitView uview,
int  upchain = FALSE
 

Choose transport to construct given utype in.

Unit* choose_unit_to_build_upon OpRole *  oprole,
int *  uscore
 

Unit* choose_unit_to_repair OpRole *  oprole,
int *  uscore
 

int Xconq::AI::choose_utype_to_construct OpRole *  oprole,
int *  uscore
 

Choose utype to construct, and optionally return its relative worth.

Handling of Operational Roles *

void Xconq::AI::create_side_ai Side side  ) 
 

Create/init master AI structure associated with a side.

OpRole * Xconq::AI::find_oprole Side side,
int  id
 

Find oprole associated with a particular unit ID.

Task * Xconq::AI::generate_construction_task Unit unit,
int  u2
 

Generate an appropriate construction task given constructor and utype.

AI_Side * Xconq::AI::get_side_ai Side side  ) 
 

Return master AI structure associated with a side.

int Xconq::AI::guess_best_capture_method_used_by Unit unit,
UnitView uview
 

Which capture method should given uview use ti hit given unit?

int Xconq::AI::guess_best_hit_method_used_by Unit unit,
UnitView uview
 

Which hit method should given uview use to hit given unit?

OpRole_Outcome Xconq::AI::handle_constructor_oprole OpRole *  oprole  ) 
 

Handle constructor operational role.

TacticalConcern Xconq::AI::handle_immediate_danger Unit unit  ) 
 

Handle immediate danger to given unit.

Immediate danger is considered to be danger to the unit itself, or one of its occupants. Danger can imply either frightful endangerment or simple endangerment (harassment). Frightful endangerment means that the unit or one of its occs can be quickly destroyed with no real hope of survival. Harassment means that unit or one of its occs can be destroyed, but has a fairly decent fighting chance against the harasser.

void Xconq::AI::handle_oprole OpRole *  oprole  ) 
 

Evaluate an operational role.

void Xconq::AI::handle_oproles Side side  ) 
 

Evaluate all operational roles on a side.

TacticalConcern Xconq::AI::handle_tactical_situation Unit unit  ) 
 

Handle tactical situation of given unit.

Todo:
Implement handling of occ danger.

Implement handling of targets of opportunity.

int Xconq::AI::is_frightened_by Unit unit,
UnitView uview
 

Is given unit deathly afraid of given uview?

int Xconq::AI::is_harassed_by Unit unit,
UnitView uview
 

Is given unit possibly being harassed by given uview?

int Xconq::AI::n_plan_to_construct_at Side side,
int  x,
int  y,
short *  p_utypes = NULL
 

How many friendly units plan to construct at given location?

void Xconq::AI::release_oprole OpRole *  oprole  ) 
 

Release oprole.

int Xconq::AI::resource_contention_with_any int  u,
int  x,
int  y,
Side side
 

Would any units be in contention with an utype at a given location?

int Xconq::AI::seems_safe_against Unit unit,
UnitView uview
 

Does given unit seem safe from given uview?

int turns_to_defeat_best_ratio Unit unit,
UnitView uview
 


Generated on Sat Sep 17 10:31:28 2005 for XconqKernel by doxygen 1.3.6