Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Macros | Enumerations | Functions | Variables
ai.hpp File Reference
#include <limits.h>
#include <string.h>
#include "inexor/network/SharedVar.hpp"
#include "inexor/shared/cube_loops.hpp"
#include "inexor/shared/cube_types.hpp"
#include "inexor/shared/cube_vector.hpp"
#include "inexor/shared/geom.hpp"
#include "inexor/util/legacy_time.hpp"

Go to the source code of this file.

Classes

struct  ai::waypoint
 
struct  ai::avoidset
 
struct  ai::avoidset::obstacle
 
struct  ai::interest
 
struct  ai::aistate
 
struct  ai::aiinfo
 

Namespaces

 ai
 

Macros

#define MAXBOTS   32
 
#define loopavoid(v, d, body)
 

Enumerations

enum  {
  ai::AI_S_WAIT = 0, ai::AI_S_DEFEND, ai::AI_S_PURSUE, ai::AI_S_INTEREST,
  ai::AI_S_MAX
}
 
enum  {
  ai::AI_T_NODE, ai::AI_T_PLAYER, ai::AI_T_AFFINITY, ai::AI_T_ENTITY,
  ai::AI_T_MAX
}
 

Functions

static bool ai::iswaypoint (int n)
 
int ai::closestwaypoint (const vec &pos, float mindist, bool links, fpsent *d=nullptr)
 
void ai::findwaypointswithin (const vec &pos, float mindist, float maxdist, vector< int > &results)
 
void ai::inferwaypoints (fpsent *d, const vec &o, const vec &v, float mindist=ai::CLOSEDIST)
 
bool ai::route (fpsent *d, int node, int goal, vector< int > &route, const avoidset &obstacles, int retries=0)
 
void ai::navigate ()
 
void ai::clearwaypoints (bool full=false)
 
void ai::seedwaypoints ()
 
void ai::loadwaypoints (bool force=false, const char *mname=nullptr)
 
void ai::savewaypoints (bool force=false, const char *mname=nullptr)
 
float ai::viewdist (int x)
 
float ai::viewfieldx (int x)
 
float ai::viewfieldy (int x)
 
bool ai::targetable (fpsent *d, fpsent *e)
 
bool ai::cansee (fpsent *d, vec &x, vec &y, vec &targ)
 
void ai::init (fpsent *d, int at, int ocn, int sk, int bn, int pm, const char *name, const char *team, const char *tag)
 
void ai::update ()
 
void ai::avoid ()
 
void ai::think (fpsent *d, bool run)
 
bool ai::badhealth (fpsent *d)
 
bool ai::checkothers (vector< int > &targets, fpsent *d, int state, int targtype, int target, bool teams, int *members)
 
bool ai::makeroute (fpsent *d, aistate &b, int node, bool changed, int retries)
 
bool ai::makeroute (fpsent *d, aistate &b, const vec &pos, bool changed, int retries)
 
bool ai::randomnode (fpsent *d, aistate &b, const vec &pos, float guard, float wander)
 
bool ai::randomnode (fpsent *d, aistate &b, float guard, float wander)
 
bool ai::violence (fpsent *d, aistate &b, fpsent *e, int pursue)
 
bool ai::patrol (fpsent *d, aistate &b, const vec &pos, float guard, float wander, int walk, bool retry)
 
bool ai::defend (fpsent *d, aistate &b, const vec &pos, float guard, float wander, int walk)
 
void ai::assist (fpsent *d, aistate &b, vector< interest > &interests, bool all, bool force)
 
bool ai::parseinterests (fpsent *d, aistate &b, vector< interest > &interests, bool override, bool ignore)
 
void ai::spawned (fpsent *d)
 
void ai::damaged (fpsent *d, fpsent *e)
 
void ai::killed (fpsent *d, fpsent *e)
 
void ai::itemspawned (int ent)
 
void ai::render ()
 

Variables

const int ai::MAXWAYPOINTS = USHRT_MAX - 2
 
const int ai::MAXWAYPOINTLINKS = 6
 
const int ai::WAYPOINTRADIUS = 16
 
const float ai::MINWPDIST = 4.f
 
const float ai::CLOSEDIST = 32.f
 
const float ai::FARDIST = 128.f
 
const float ai::JUMPMIN = 4.f
 
const float ai::JUMPMAX = 32.f
 
const float ai::SIGHTMIN = 64.f
 
const float ai::SIGHTMAX = 1024.f
 
const float ai::VIEWMIN = 90.f
 
const float ai::VIEWMAX = 180.f
 
vector< waypoint > ai::waypoints
 
SharedVar< int > ai::showwaypoints
 
SharedVar< int > ai::dropwaypoints
 
const int ai::NUMPREVNODES = 6
 

Macro Definition Documentation

#define loopavoid (   v,
  d,
  body 
)
Value:
if(!(v).obstacles.empty()) \
{ \
int cur = 0; \
{ \
const ai::avoidset::obstacle &ob = (v).obstacles[i]; \
int next = cur + ob.numwaypoints; \
if(ob.owner != d) \
{ \
for(; cur < next; cur++) \
{ \
int wp = (v).waypoints[cur]; \
body; \
} \
} \
cur = next; \
} \
}
ivec cur
Definition: octaedit.cpp:167
avoidset obstacles
Definition: ai.cpp:46
vector< waypoint > waypoints
Definition: waypoint.cpp:40
if(NOT DEFINED PROJECT_ARCH) message(FATAL_ERROR"You are generating from the wrong folder! \"Where is the Source
Definition: CMakeLists.txt:2
int d
Definition: octaedit.cpp:1749
Definition: ai.hpp:68
#define loopv(v)
Definition: cube_loops.hpp:21

Referenced by ai::avoidset::find(), and ai::route().

#define MAXBOTS   32