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