| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
#define CTF |
| 35 |
|
| 36 |
#define MAX_ITEMS 256 |
| 37 |
|
| 38 |
#define BFL_STRAFERIGHT 1 //strafe to the right |
| 39 |
#define BFL_ATTACKED 2 //bot has attacked last ai frame |
| 40 |
#define BFL_ATTACKJUMPED 4 //bot jumped during attack last frame |
| 41 |
#define BFL_AIMATENEMY 8 //bot aimed at the enemy this frame |
| 42 |
#define BFL_AVOIDRIGHT 16 //avoid obstacles by going to the right |
| 43 |
#define BFL_IDEALVIEWSET 32 //bot has ideal view angles set |
| 44 |
#define BFL_FIGHTSUICIDAL 64 //bot is in a suicidal fight |
| 45 |
|
| 46 |
#define LTG_TEAMHELP 1 //help a team mate |
| 47 |
#define LTG_TEAMACCOMPANY 2 //accompany a team mate |
| 48 |
#define LTG_DEFENDKEYAREA 3 //defend a key area |
| 49 |
#define LTG_GETFLAG 4 //get the enemy flag |
| 50 |
#define LTG_RUSHBASE 5 //rush to the base |
| 51 |
#define LTG_RETURNFLAG 6 //return the flag |
| 52 |
#define LTG_CAMP 7 //camp somewhere |
| 53 |
#define LTG_CAMPORDER 8 //ordered to camp somewhere |
| 54 |
#define LTG_PATROL 9 //patrol |
| 55 |
#define LTG_GETITEM 10 //get an item |
| 56 |
#define LTG_KILL 11 //kill someone |
| 57 |
#define LTG_HARVEST 12 //harvest skulls |
| 58 |
#define LTG_ATTACKENEMYBASE 13 //attack the enemy base |
| 59 |
#define LTG_MAKELOVE_UNDER 14 |
| 60 |
#define LTG_MAKELOVE_ONTOP 15 |
| 61 |
|
| 62 |
#define TEAM_HELP_TIME 60 //1 minute teamplay help time |
| 63 |
#define TEAM_ACCOMPANY_TIME 600 //10 minutes teamplay accompany time |
| 64 |
#define TEAM_DEFENDKEYAREA_TIME 600 //10 minutes ctf defend base time |
| 65 |
#define TEAM_CAMP_TIME 600 //10 minutes camping time |
| 66 |
#define TEAM_PATROL_TIME 600 //10 minutes patrolling time |
| 67 |
#define TEAM_LEAD_TIME 600 //10 minutes taking the lead |
| 68 |
#define TEAM_GETITEM_TIME 60 //1 minute |
| 69 |
#define TEAM_KILL_SOMEONE 180 //3 minute to kill someone |
| 70 |
#define TEAM_ATTACKENEMYBASE_TIME 600 //10 minutes |
| 71 |
#define TEAM_HARVEST_TIME 120 //2 minutes |
| 72 |
#define CTF_GETFLAG_TIME 600 //10 minutes ctf get flag time |
| 73 |
#define CTF_RUSHBASE_TIME 120 //2 minutes ctf rush base time |
| 74 |
#define CTF_RETURNFLAG_TIME 180 //3 minutes to return the flag |
| 75 |
#define CTF_ROAM_TIME 60 //1 minute ctf roam time |
| 76 |
|
| 77 |
#define PATROL_LOOP 1 |
| 78 |
#define PATROL_REVERSE 2 |
| 79 |
#define PATROL_BACK 4 |
| 80 |
|
| 81 |
#define TEAMTP_DEFENDER 1 |
| 82 |
#define TEAMTP_ATTACKER 2 |
| 83 |
|
| 84 |
#define CTFS_AGRESSIVE 1 |
| 85 |
|
| 86 |
#define PRESENCE_NONE 1 |
| 87 |
#define PRESENCE_NORMAL 2 |
| 88 |
#define PRESENCE_CROUCH 4 |
| 89 |
|
| 90 |
#define MAX_PROXMINES 64 |
| 91 |
|
| 92 |
|
| 93 |
typedef struct bot_waypoint_s |
| 94 |
{ |
| 95 |
int inuse; |
| 96 |
char name[32]; |
| 97 |
bot_goal_t goal; |
| 98 |
struct bot_waypoint_s *next, *prev; |
| 99 |
} bot_waypoint_t; |
| 100 |
|
| 101 |
#define MAX_ACTIVATESTACK 8 |
| 102 |
#define MAX_ACTIVATEAREAS 32 |
| 103 |
|
| 104 |
typedef struct bot_activategoal_s |
| 105 |
{ |
| 106 |
int inuse; |
| 107 |
bot_goal_t goal; |
| 108 |
float time; |
| 109 |
float start_time; |
| 110 |
float justused_time; |
| 111 |
int shoot; |
| 112 |
int weapon; |
| 113 |
vec3_t target; |
| 114 |
vec3_t origin; |
| 115 |
int areas[MAX_ACTIVATEAREAS]; |
| 116 |
int numareas; |
| 117 |
int areasdisabled; |
| 118 |
struct bot_activategoal_s *next; |
| 119 |
} bot_activategoal_t; |
| 120 |
|
| 121 |
|
| 122 |
typedef struct bot_state_s |
| 123 |
{ |
| 124 |
int inuse; |
| 125 |
int botthink_residual; |
| 126 |
int client; |
| 127 |
int entitynum; |
| 128 |
playerState_t cur_ps; |
| 129 |
int last_eFlags; |
| 130 |
usercmd_t lastucmd; |
| 131 |
int entityeventTime[MAX_GENTITIES]; |
| 132 |
|
| 133 |
bot_settings_t settings; |
| 134 |
int (*ainode)(struct bot_state_s *bs); |
| 135 |
float thinktime; |
| 136 |
vec3_t origin; |
| 137 |
vec3_t velocity; |
| 138 |
int presencetype; |
| 139 |
vec3_t eye; |
| 140 |
int areanum; |
| 141 |
int inventory[MAX_ITEMS]; |
| 142 |
int tfl; |
| 143 |
int flags; |
| 144 |
int respawn_wait; |
| 145 |
int lasthealth; |
| 146 |
int lastkilledplayer; |
| 147 |
int lastkilledby; |
| 148 |
int botdeathtype; |
| 149 |
int enemydeathtype; |
| 150 |
int botsuicide; |
| 151 |
int enemysuicide; |
| 152 |
int setupcount; |
| 153 |
int map_restart; |
| 154 |
int entergamechat; |
| 155 |
int num_deaths; |
| 156 |
int num_kills; |
| 157 |
int revenge_enemy; |
| 158 |
int revenge_kills; |
| 159 |
int lastframe_health; |
| 160 |
int lasthitcount; |
| 161 |
int chatto; |
| 162 |
float walker; |
| 163 |
float ltime; |
| 164 |
float entergame_time; |
| 165 |
float ltg_time; |
| 166 |
float nbg_time; |
| 167 |
float respawn_time; |
| 168 |
float respawnchat_time; |
| 169 |
float chase_time; |
| 170 |
float enemyvisible_time; |
| 171 |
float check_time; |
| 172 |
float stand_time; |
| 173 |
float lastchat_time; |
| 174 |
float kamikaze_time; |
| 175 |
float invulnerability_time; |
| 176 |
float standfindenemy_time; |
| 177 |
float attackstrafe_time; |
| 178 |
float attackcrouch_time; |
| 179 |
float attackchase_time; |
| 180 |
float attackjump_time; |
| 181 |
float enemysight_time; |
| 182 |
float enemydeath_time; |
| 183 |
float enemyposition_time; |
| 184 |
float defendaway_time; |
| 185 |
float defendaway_range; |
| 186 |
float rushbaseaway_time; |
| 187 |
float attackaway_time; |
| 188 |
float harvestaway_time; |
| 189 |
float ctfroam_time; |
| 190 |
float killedenemy_time; |
| 191 |
float arrive_time; |
| 192 |
float lastair_time; |
| 193 |
float teleport_time; |
| 194 |
float camp_time; |
| 195 |
float weaponchange_time; |
| 196 |
float firethrottlewait_time; |
| 197 |
float firethrottleshoot_time; |
| 198 |
float notblocked_time; |
| 199 |
float blockedbyavoidspot_time; |
| 200 |
float predictobstacles_time; |
| 201 |
int predictobstacles_goalareanum; |
| 202 |
vec3_t aimtarget; |
| 203 |
vec3_t enemyvelocity; |
| 204 |
vec3_t enemyorigin; |
| 205 |
|
| 206 |
int kamikazebody; |
| 207 |
int proxmines[MAX_PROXMINES]; |
| 208 |
int numproxmines; |
| 209 |
|
| 210 |
int character; |
| 211 |
int ms; |
| 212 |
int gs; |
| 213 |
int cs; |
| 214 |
int ws; |
| 215 |
|
| 216 |
int enemy; |
| 217 |
int lastenemyareanum; |
| 218 |
vec3_t lastenemyorigin; |
| 219 |
int weaponnum; |
| 220 |
vec3_t viewangles; |
| 221 |
vec3_t ideal_viewangles; |
| 222 |
vec3_t viewanglespeed; |
| 223 |
|
| 224 |
int ltgtype; |
| 225 |
|
| 226 |
int teammate; |
| 227 |
int decisionmaker; |
| 228 |
int ordered; |
| 229 |
float order_time; |
| 230 |
int owndecision_time; |
| 231 |
bot_goal_t teamgoal; |
| 232 |
bot_goal_t altroutegoal; |
| 233 |
float reachedaltroutegoal_time; |
| 234 |
float teammessage_time; |
| 235 |
float teamgoal_time; |
| 236 |
float teammatevisible_time; |
| 237 |
int teamtaskpreference; |
| 238 |
|
| 239 |
int lastgoal_decisionmaker; |
| 240 |
int lastgoal_ltgtype; |
| 241 |
int lastgoal_teammate; |
| 242 |
bot_goal_t lastgoal_teamgoal; |
| 243 |
|
| 244 |
int lead_teammate; |
| 245 |
bot_goal_t lead_teamgoal; |
| 246 |
float lead_time; |
| 247 |
float leadvisible_time; |
| 248 |
float leadmessage_time; |
| 249 |
float leadbackup_time; |
| 250 |
|
| 251 |
char teamleader[MAX_NETNAME]; |
| 252 |
float askteamleader_time; |
| 253 |
float becometeamleader_time; |
| 254 |
float teamgiveorders_time; |
| 255 |
float lastflagcapture_time; |
| 256 |
int numteammates; |
| 257 |
int redflagstatus; |
| 258 |
int blueflagstatus; |
| 259 |
int neutralflagstatus; |
| 260 |
int flagstatuschanged; |
| 261 |
int forceorders; |
| 262 |
int flagcarrier; |
| 263 |
int ctfstrategy; |
| 264 |
char subteam[32]; |
| 265 |
float formation_dist; |
| 266 |
|
| 267 |
bot_activategoal_t *activatestack; |
| 268 |
bot_activategoal_t activategoalheap[MAX_ACTIVATESTACK]; |
| 269 |
|
| 270 |
bot_waypoint_t *checkpoints; |
| 271 |
bot_waypoint_t *patrolpoints; |
| 272 |
bot_waypoint_t *curpatrolpoint; |
| 273 |
int patrolflags; |
| 274 |
} bot_state_t; |
| 275 |
|
| 276 |
|
| 277 |
void BotResetState(bot_state_t *bs); |
| 278 |
|
| 279 |
int NumBots(void); |
| 280 |
|
| 281 |
void BotEntityInfo(int entnum, aas_entityinfo_t *info); |
| 282 |
|
| 283 |
extern float floattime; |
| 284 |
#define FloatTime() floattime |
| 285 |
|
| 286 |
|
| 287 |
void QDECL BotAI_Print(int type, char *fmt, ...) Q_PRINTF_FUNC(2, 3); |
| 288 |
void QDECL QDECL BotAI_BotInitialChat( bot_state_t *bs, char *type, ... ); |
| 289 |
void BotAI_Trace(bsp_trace_t *bsptrace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int passent, int contentmask); |
| 290 |
int BotAI_GetClientState( int clientNum, playerState_t *state ); |
| 291 |
int BotAI_GetEntityState( int entityNum, entityState_t *state ); |
| 292 |
int BotAI_GetSnapshotEntity( int clientNum, int sequence, entityState_t *state ); |
| 293 |
int BotTeamLeader(bot_state_t *bs); |