00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #define MOVE_WALK 1
00035 #define MOVE_CROUCH 2
00036 #define MOVE_JUMP 4
00037 #define MOVE_GRAPPLE 8
00038 #define MOVE_ROCKETJUMP 16
00039 #define MOVE_BFGJUMP 32
00040
00041 #define MFL_BARRIERJUMP 1 //bot is performing a barrier jump
00042 #define MFL_ONGROUND 2 //bot is in the ground
00043 #define MFL_SWIMMING 4 //bot is swimming
00044 #define MFL_AGAINSTLADDER 8 //bot is against a ladder
00045 #define MFL_WATERJUMP 16 //bot is waterjumping
00046 #define MFL_TELEPORTED 32 //bot is being teleported
00047 #define MFL_GRAPPLEPULL 64 //bot is being pulled by the grapple
00048 #define MFL_ACTIVEGRAPPLE 128 //bot is using the grapple hook
00049 #define MFL_GRAPPLERESET 256 //bot has reset the grapple
00050 #define MFL_WALK 512 //bot should walk slowly
00051
00052 #define MOVERESULT_MOVEMENTVIEW 1 //bot uses view for movement
00053 #define MOVERESULT_SWIMVIEW 2 //bot uses view for swimming
00054 #define MOVERESULT_WAITING 4 //bot is waiting for something
00055 #define MOVERESULT_MOVEMENTVIEWSET 8 //bot has set the view in movement code
00056 #define MOVERESULT_MOVEMENTWEAPON 16 //bot uses weapon for movement
00057 #define MOVERESULT_ONTOPOFOBSTACLE 32 //bot is ontop of obstacle
00058 #define MOVERESULT_ONTOPOF_FUNCBOB 64 //bot is ontop of a func_bobbing
00059 #define MOVERESULT_ONTOPOF_ELEVATOR 128 //bot is ontop of an elevator (func_plat)
00060 #define MOVERESULT_BLOCKEDBYAVOIDSPOT 256 //bot is blocked by an avoid spot
00061
00062 #define MAX_AVOIDREACH 1
00063 #define MAX_AVOIDSPOTS 32
00064
00065 #define AVOID_CLEAR 0 //clear all avoid spots
00066 #define AVOID_ALWAYS 1 //avoid always
00067 #define AVOID_DONTBLOCK 2 //never totally block
00068
00069 #define RESULTTYPE_ELEVATORUP 1 //elevator is up
00070 #define RESULTTYPE_WAITFORFUNCBOBBING 2 //waiting for func bobbing to arrive
00071 #define RESULTTYPE_BADGRAPPLEPATH 4 //grapple path is obstructed
00072 #define RESULTTYPE_INSOLIDAREA 8 //stuck in solid area, this is bad
00073
00074
00075
00076 typedef struct bot_initmove_s
00077 {
00078 vec3_t origin;
00079 vec3_t velocity;
00080 vec3_t viewoffset;
00081 int entitynum;
00082 int client;
00083 float thinktime;
00084 int presencetype;
00085 vec3_t viewangles;
00086 int or_moveflags;
00087 } bot_initmove_t;
00088
00089
00090 typedef struct bot_moveresult_s
00091 {
00092 int failure;
00093 int type;
00094 int blocked;
00095 int blockentity;
00096 int traveltype;
00097 int flags;
00098 int weapon;
00099 vec3_t movedir;
00100 vec3_t ideal_viewangles;
00101 } bot_moveresult_t;
00102
00103
00104
00105 typedef struct bot_avoidspot_s
00106 {
00107 vec3_t origin;
00108 float radius;
00109 int type;
00110 } bot_avoidspot_t;
00111
00112
00113 void BotResetMoveState(int movestate);
00114
00115 void BotMoveToGoal(bot_moveresult_t *result, int movestate, bot_goal_t *goal, int travelflags);
00116
00117 int BotMoveInDirection(int movestate, vec3_t dir, float speed, int type);
00118
00119 void BotResetAvoidReach(int movestate);
00120
00121 void BotResetLastAvoidReach(int movestate);
00122
00123 int BotReachabilityArea(vec3_t origin, int client);
00124
00125 int BotMovementViewTarget(int movestate, bot_goal_t *goal, int travelflags, float lookahead, vec3_t target);
00126
00127 int BotPredictVisiblePosition(vec3_t origin, int areanum, bot_goal_t *goal, int travelflags, vec3_t target);
00128
00129 int BotAllocMoveState(void);
00130
00131 void BotFreeMoveState(int handle);
00132
00133 void BotInitMoveState(int handle, bot_initmove_t *initmove);
00134
00135 void BotAddAvoidSpot(int movestate, vec3_t origin, float radius, int type);
00136
00137 void BotSetBrushModelTypes(void);
00138
00139 int BotSetupMoveAI(void);
00140
00141 void BotShutdownMoveAI(void);
00142