diff --git a/dlls/game/ai_chat.h b/dlls/game/ai_chat.h index 0a38a0b..3dfb503 100644 --- a/dlls/game/ai_chat.h +++ b/dlls/game/ai_chat.h @@ -1,45 +1,45 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// - -/***************************************************************************** - * name: ai_chat.h - * - * desc: Quake3 bot AI - * - * $Archive: /Code/DLLs/game/ai_chat.h $ - * $Author: Jwaters $ - * $Revision: 1 $ - * $Modtime: 7/25/02 11:48a $ - * $Date: 7/30/02 1:10p $ - * - *****************************************************************************/ - -// -int BotChat_EnterGame(bot_state_t *bs); -// -int BotChat_ExitGame(bot_state_t *bs); -// -int BotChat_StartLevel(bot_state_t *bs); -// -int BotChat_EndLevel(bot_state_t *bs); -// -int BotChat_HitTalking(bot_state_t *bs); -// -int BotChat_HitNoDeath(bot_state_t *bs); -// -int BotChat_HitNoKill(bot_state_t *bs); -// -int BotChat_Death(bot_state_t *bs); -// -int BotChat_Kill(bot_state_t *bs); -// -int BotChat_EnemySuicide(bot_state_t *bs); -// -int BotChat_Random(bot_state_t *bs); -// time the selected chat takes to type in -float BotChatTime(bot_state_t *bs); -// returns true if the bot can chat at the current position -int BotValidChatPosition(bot_state_t *bs); -// test the initial bot chats -void BotChatTest(bot_state_t *bs); - +// Copyright (C) 1999-2000 Id Software, Inc. +// + +/***************************************************************************** + * name: ai_chat.h + * + * desc: Quake3 bot AI + * + * $Archive: /Code/DLLs/game/ai_chat.h $ + * $Author: Jwaters $ + * $Revision: 1 $ + * $Modtime: 7/25/02 11:48a $ + * $Date: 7/30/02 1:10p $ + * + *****************************************************************************/ + +// +int BotChat_EnterGame(bot_state_t* bs); +// +int BotChat_ExitGame(bot_state_t* bs); +// +int BotChat_StartLevel(bot_state_t* bs); +// +int BotChat_EndLevel(bot_state_t* bs); +// +int BotChat_HitTalking(bot_state_t* bs); +// +int BotChat_HitNoDeath(bot_state_t* bs); +// +int BotChat_HitNoKill(bot_state_t* bs); +// +int BotChat_Death(bot_state_t* bs); +// +int BotChat_Kill(bot_state_t* bs); +// +int BotChat_EnemySuicide(bot_state_t* bs); +// +int BotChat_Random(bot_state_t* bs); +// time the selected chat takes to type in +float BotChatTime(bot_state_t* bs); +// returns true if the bot can chat at the current position +int BotValidChatPosition(bot_state_t* bs); +// test the initial bot chats +void BotChatTest(bot_state_t* bs); + diff --git a/dlls/game/ai_cmd.h b/dlls/game/ai_cmd.h index 47909ba..784e4e5 100644 --- a/dlls/game/ai_cmd.h +++ b/dlls/game/ai_cmd.h @@ -1,21 +1,21 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// - -/***************************************************************************** - * name: ai_cmd.h - * - * desc: Quake3 bot AI - * - * $Archive: /Code/DLLs/game/ai_cmd.h $ - * $Author: Jwaters $ - * $Revision: 1 $ - * $Modtime: 7/25/02 11:48a $ - * $Date: 7/30/02 1:10p $ - * - *****************************************************************************/ - -extern int notleader[MAX_CLIENTS]; - -int BotMatchMessage(bot_state_t *bs, char *message); -void BotPrintTeamGoal(bot_state_t *bs); - +// Copyright (C) 1999-2000 Id Software, Inc. +// + +/***************************************************************************** + * name: ai_cmd.h + * + * desc: Quake3 bot AI + * + * $Archive: /Code/DLLs/game/ai_cmd.h $ + * $Author: Jwaters $ + * $Revision: 1 $ + * $Modtime: 7/25/02 11:48a $ + * $Date: 7/30/02 1:10p $ + * + *****************************************************************************/ + +extern int notleader[MAX_CLIENTS]; + +int BotMatchMessage(bot_state_t* bs, char* message); +void BotPrintTeamGoal(bot_state_t* bs); + diff --git a/dlls/game/ai_dmnet.h b/dlls/game/ai_dmnet.h index b0def9e..9ed4f5a 100644 --- a/dlls/game/ai_dmnet.h +++ b/dlls/game/ai_dmnet.h @@ -1,44 +1,44 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// - -/***************************************************************************** - * name: ai_dmnet.h - * - * desc: Quake3 bot AI - * - * $Archive: /Code/DLLs/game/ai_dmnet.h $ - * $Author: Jwaters $ - * $Revision: 1 $ - * $Modtime: 7/25/02 11:48a $ - * $Date: 7/30/02 1:10p $ - * - *****************************************************************************/ - -#define MAX_NODESWITCHES 50 - -void AIEnter_Intermission(bot_state_t *bs, const char *s); -void AIEnter_Observer(bot_state_t *bs, const char *s); -void AIEnter_Respawn(bot_state_t *bs, const char *s); -void AIEnter_Stand(bot_state_t *bs, const char *s); -void AIEnter_Seek_ActivateEntity(bot_state_t *bs, const char *s); -void AIEnter_Seek_NBG(bot_state_t *bs, const char *s); -void AIEnter_Seek_LTG(bot_state_t *bs, const char *s); -void AIEnter_Battle_Fight(bot_state_t *bs, const char *s); -void AIEnter_Battle_Chase(bot_state_t *bs, const char *s); -void AIEnter_Battle_Retreat(bot_state_t *bs, const char *s); -void AIEnter_Battle_NBG(bot_state_t *bs, const char *s); -int AINode_Intermission(bot_state_t *bs); -int AINode_Observer(bot_state_t *bs); -int AINode_Respawn(bot_state_t *bs); -int AINode_Stand(bot_state_t *bs); -int AINode_Seek_ActivateEntity(bot_state_t *bs); -int AINode_Seek_NBG(bot_state_t *bs); -int AINode_Seek_LTG(bot_state_t *bs); -int AINode_Battle_Fight(bot_state_t *bs); -int AINode_Battle_Chase(bot_state_t *bs); -int AINode_Battle_Retreat(bot_state_t *bs); -int AINode_Battle_NBG(bot_state_t *bs); - -void BotResetNodeSwitches(void); -void BotDumpNodeSwitches(bot_state_t *bs); - +// Copyright (C) 1999-2000 Id Software, Inc. +// + +/***************************************************************************** + * name: ai_dmnet.h + * + * desc: Quake3 bot AI + * + * $Archive: /Code/DLLs/game/ai_dmnet.h $ + * $Author: Jwaters $ + * $Revision: 1 $ + * $Modtime: 7/25/02 11:48a $ + * $Date: 7/30/02 1:10p $ + * + *****************************************************************************/ + +#define MAX_NODESWITCHES 50 + +void AIEnter_Intermission(bot_state_t* bs, const char* s); +void AIEnter_Observer(bot_state_t* bs, const char* s); +void AIEnter_Respawn(bot_state_t* bs, const char* s); +void AIEnter_Stand(bot_state_t* bs, const char* s); +void AIEnter_Seek_ActivateEntity(bot_state_t* bs, const char* s); +void AIEnter_Seek_NBG(bot_state_t* bs, const char* s); +void AIEnter_Seek_LTG(bot_state_t* bs, const char* s); +void AIEnter_Battle_Fight(bot_state_t* bs, const char* s); +void AIEnter_Battle_Chase(bot_state_t* bs, const char* s); +void AIEnter_Battle_Retreat(bot_state_t* bs, const char* s); +void AIEnter_Battle_NBG(bot_state_t* bs, const char* s); +int AINode_Intermission(bot_state_t* bs); +int AINode_Observer(bot_state_t* bs); +int AINode_Respawn(bot_state_t* bs); +int AINode_Stand(bot_state_t* bs); +int AINode_Seek_ActivateEntity(bot_state_t* bs); +int AINode_Seek_NBG(bot_state_t* bs); +int AINode_Seek_LTG(bot_state_t* bs); +int AINode_Battle_Fight(bot_state_t* bs); +int AINode_Battle_Chase(bot_state_t* bs); +int AINode_Battle_Retreat(bot_state_t* bs); +int AINode_Battle_NBG(bot_state_t* bs); + +void BotResetNodeSwitches(void); +void BotDumpNodeSwitches(bot_state_t* bs); + diff --git a/dlls/game/ai_dmq3.h b/dlls/game/ai_dmq3.h index a1042a6..5997ea3 100644 --- a/dlls/game/ai_dmq3.h +++ b/dlls/game/ai_dmq3.h @@ -1,191 +1,191 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// - -/***************************************************************************** - * name: ai_dmq3.h - * - * desc: Quake3 bot AI - * - * $Archive: /Code/DLLs/game/ai_dmq3.h $ - * $Author: Jwaters $ - * $Revision: 2 $ - * $Modtime: 8/25/02 1:03p $ - * $Date: 8/25/02 6:26p $ - * - *****************************************************************************/ - -//setup the deathmatch AI -void BotSetupDeathmatchAI(void); -//shutdown the deathmatch AI -void BotShutdownDeathmatchAI(void); -//let the bot live within it's deathmatch AI net -void BotDeathmatchAI(bot_state_t *bs, float thinktime); -//free waypoints -void BotFreeWaypoints(bot_waypoint_t *wp); -//choose a weapon -void BotChooseWeapon(bot_state_t *bs); -//setup movement stuff -void BotSetupForMovement(bot_state_t *bs); -//update the inventory -void BotUpdateInventory(bot_state_t *bs); -//update the inventory during battle -void BotUpdateBattleInventory(bot_state_t *bs, int enemy); -//use holdable items during battle -void BotBattleUseItems(bot_state_t *bs); -//return true if the bot is dead -qboolean BotIsDead(bot_state_t *bs); -//returns true if the bot is in observer mode -qboolean BotIsObserver(bot_state_t *bs); -//returns true if the bot is in the intermission -qboolean BotIntermission(bot_state_t *bs); -//returns true if the bot is in lava or slime -qboolean BotInLavaOrSlime(bot_state_t *bs); -//returns true if the entity is dead -qboolean EntityIsDead(aas_entityinfo_t *entinfo); -//returns true if the entity is invisible -qboolean EntityIsInvisible(aas_entityinfo_t *entinfo); -//returns true if the entity is shooting -qboolean EntityIsShooting(aas_entityinfo_t *entinfo); -#ifdef MISSIONPACK -//returns true if this entity has the kamikaze -qboolean EntityHasKamikaze(aas_entityinfo_t *entinfo); -#endif -// set a user info key/value pair -void BotSetUserInfo(bot_state_t *bs, char *key, char *value); -// set the team status (offense, defense etc.) -void BotSetTeamStatus(bot_state_t *bs); -//returns the name of the client -char *ClientName(int client, char *name, int size); -//returns an simplyfied client name -char *EasyClientName(int client, char *name, int size); -//returns the skin used by the client -char *ClientSkin(int client, char *skin, int size); -// returns the appropriate synonym context for the current game type and situation -int BotSynonymContext(bot_state_t *bs); -// set last ordered task -int BotSetLastOrderedTask(bot_state_t *bs); -// selection of goals for teamplay -void BotTeamGoals(bot_state_t *bs, int retreat); -//returns the aggression of the bot in the range [0, 100] -float BotAggression(bot_state_t *bs); -//returns how bad the bot feels -float BotFeelingBad(bot_state_t *bs); -//returns true if the bot wants to retreat -int BotWantsToRetreat(bot_state_t *bs); -//returns true if the bot wants to chase -int BotWantsToChase(bot_state_t *bs); -//returns true if the bot wants to help -int BotWantsToHelp(bot_state_t *bs); -//returns true if the bot can and wants to rocketjump -int BotCanAndWantsToRocketJump(bot_state_t *bs); -// returns true if the bot has a persistant powerup and a weapon -int BotHasPersistantPowerupAndWeapon(bot_state_t *bs); -//returns true if the bot wants to and goes camping -int BotWantsToCamp(bot_state_t *bs); -//the bot will perform attack movements -bot_moveresult_t BotAttackMove(bot_state_t *bs, int tfl); -//returns true if the bot and the entity are in the same team -int BotSameTeam(bot_state_t *bs, int entnum); -//returns true if teamplay is on -int TeamPlayIsOn(void); -// returns the client number of the team mate flag carrier (-1 if none) -int BotTeamFlagCarrier(bot_state_t *bs); -//returns visible team mate flag carrier if available -int BotTeamFlagCarrierVisible(bot_state_t *bs); -//returns visible enemy flag carrier if available -int BotEnemyFlagCarrierVisible(bot_state_t *bs); -//get the number of visible teammates and enemies -void BotVisibleTeamMatesAndEnemies(bot_state_t *bs, int *teammates, int *enemies, float range); -//returns true if within the field of vision for the given angles -qboolean InFieldOfVision(vec3_t viewangles, float fov, vec3_t angles); -//returns true and sets the .enemy field when an enemy is found -int BotFindEnemy(bot_state_t *bs, int curenemy); -//returns a roam goal -void BotRoamGoal(bot_state_t *bs, vec3_t goal); -//returns entity visibility in the range [0, 1] -float BotEntityVisible(int viewer, vec3_t eye, vec3_t viewangles, float fov, int ent); -//the bot will aim at the current enemy -void BotAimAtEnemy(bot_state_t *bs); -//check if the bot should attack -void BotCheckAttack(bot_state_t *bs); -//AI when the bot is blocked -void BotAIBlocked(bot_state_t *bs, bot_moveresult_t *moveresult, int activate); -//AI to predict obstacles -int BotAIPredictObstacles(bot_state_t *bs, bot_goal_t *goal); -//enable or disable the areas the blocking entity is in -void BotEnableActivateGoalAreas(bot_activategoal_t *activategoal, int enable); -//pop an activate goal from the stack -int BotPopFromActivateGoalStack(bot_state_t *bs); -//clear the activate goal stack -void BotClearActivateGoalStack(bot_state_t *bs); -//returns the team the bot is in -int BotTeam(bot_state_t *bs); -//retuns the opposite team of the bot -int BotOppositeTeam(bot_state_t *bs); -//returns the flag the bot is carrying (CTFFLAG_?) -int BotCTFCarryingFlag(bot_state_t *bs); -//remember the last ordered task -void BotRememberLastOrderedTask(bot_state_t *bs); -//set ctf goals (defend base, get enemy flag) during seek -void BotCTFSeekGoals(bot_state_t *bs); -//set ctf goals (defend base, get enemy flag) during retreat -void BotCTFRetreatGoals(bot_state_t *bs); -// -#ifdef MISSIONPACK -int Bot1FCTFCarryingFlag(bot_state_t *bs); -int BotHarvesterCarryingCubes(bot_state_t *bs); -void Bot1FCTFSeekGoals(bot_state_t *bs); -void Bot1FCTFRetreatGoals(bot_state_t *bs); -void BotObeliskSeekGoals(bot_state_t *bs); -void BotObeliskRetreatGoals(bot_state_t *bs); -void BotGoHarvest(bot_state_t *bs); -void BotHarvesterSeekGoals(bot_state_t *bs); -void BotHarvesterRetreatGoals(bot_state_t *bs); -int BotTeamCubeCarrierVisible(bot_state_t *bs); -int BotEnemyCubeCarrierVisible(bot_state_t *bs); -#endif -//get a random alternate route goal towards the given base -int BotGetAlternateRouteGoal(bot_state_t *bs, int base); -//returns either the alternate route goal or the given goal -bot_goal_t *BotAlternateRoute(bot_state_t *bs, bot_goal_t *goal); -//create a new waypoint -bot_waypoint_t *BotCreateWayPoint(char *name, vec3_t origin, int areanum); -//find a waypoint with the given name -bot_waypoint_t *BotFindWayPoint(bot_waypoint_t *waypoints, char *name); -//strstr but case insensitive -char *stristr(char *str, char *charset); -//returns the number of the client with the given name -int ClientFromName(char *name); -int ClientOnSameTeamFromName(bot_state_t *bs, char *name); -// -int BotPointAreaNum(vec3_t origin); -// -void BotMapScripts(bot_state_t *bs); - -//ctf flags -#define CTF_FLAG_NONE 0 -#define CTF_FLAG_RED 1 -#define CTF_FLAG_BLUE 2 -//CTF skins -#define CTF_SKIN_REDTEAM "red" -#define CTF_SKIN_BLUETEAM "blue" - -extern int gametype; //game type -//extern int maxclients; //maximum number of clients - -extern vmCvar_t bot_grapple; -extern vmCvar_t bot_rocketjump; -extern vmCvar_t bot_fastchat; -extern vmCvar_t bot_nochat; -extern vmCvar_t bot_testrchat; -extern vmCvar_t bot_challenge; -extern vmCvar_t bot_showstates; - -extern bot_goal_t ctf_redflag; -extern bot_goal_t ctf_blueflag; -#ifdef MISSIONPACK -extern bot_goal_t ctf_neutralflag; -extern bot_goal_t redobelisk; -extern bot_goal_t blueobelisk; -extern bot_goal_t neutralobelisk; -#endif +// Copyright (C) 1999-2000 Id Software, Inc. +// + +/***************************************************************************** + * name: ai_dmq3.h + * + * desc: Quake3 bot AI + * + * $Archive: /Code/DLLs/game/ai_dmq3.h $ + * $Author: Jwaters $ + * $Revision: 2 $ + * $Modtime: 8/25/02 1:03p $ + * $Date: 8/25/02 6:26p $ + * + *****************************************************************************/ + +//setup the deathmatch AI +void BotSetupDeathmatchAI(void); +//shutdown the deathmatch AI +void BotShutdownDeathmatchAI(void); +//let the bot live within it's deathmatch AI net +void BotDeathmatchAI(bot_state_t* bs, float thinktime); +//free waypoints +void BotFreeWaypoints(bot_waypoint_t* wp); +//choose a weapon +void BotChooseWeapon(bot_state_t* bs); +//setup movement stuff +void BotSetupForMovement(bot_state_t* bs); +//update the inventory +void BotUpdateInventory(bot_state_t* bs); +//update the inventory during battle +void BotUpdateBattleInventory(bot_state_t* bs, int enemy); +//use holdable items during battle +void BotBattleUseItems(bot_state_t* bs); +//return true if the bot is dead +qboolean BotIsDead(bot_state_t* bs); +//returns true if the bot is in observer mode +qboolean BotIsObserver(bot_state_t* bs); +//returns true if the bot is in the intermission +qboolean BotIntermission(bot_state_t* bs); +//returns true if the bot is in lava or slime +qboolean BotInLavaOrSlime(bot_state_t* bs); +//returns true if the entity is dead +qboolean EntityIsDead(aas_entityinfo_t* entinfo); +//returns true if the entity is invisible +qboolean EntityIsInvisible(aas_entityinfo_t* entinfo); +//returns true if the entity is shooting +qboolean EntityIsShooting(aas_entityinfo_t* entinfo); +#ifdef MISSIONPACK +//returns true if this entity has the kamikaze +qboolean EntityHasKamikaze(aas_entityinfo_t* entinfo); +#endif +// set a user info key/value pair +void BotSetUserInfo(bot_state_t* bs, char* key, char* value); +// set the team status (offense, defense etc.) +void BotSetTeamStatus(bot_state_t* bs); +//returns the name of the client +char* ClientName(int client, char* name, int size); +//returns an simplyfied client name +char* EasyClientName(int client, char* name, int size); +//returns the skin used by the client +char* ClientSkin(int client, char* skin, int size); +// returns the appropriate synonym context for the current game type and situation +int BotSynonymContext(bot_state_t* bs); +// set last ordered task +int BotSetLastOrderedTask(bot_state_t* bs); +// selection of goals for teamplay +void BotTeamGoals(bot_state_t* bs, int retreat); +//returns the aggression of the bot in the range [0, 100] +float BotAggression(bot_state_t* bs); +//returns how bad the bot feels +float BotFeelingBad(bot_state_t* bs); +//returns true if the bot wants to retreat +int BotWantsToRetreat(bot_state_t* bs); +//returns true if the bot wants to chase +int BotWantsToChase(bot_state_t* bs); +//returns true if the bot wants to help +int BotWantsToHelp(bot_state_t* bs); +//returns true if the bot can and wants to rocketjump +int BotCanAndWantsToRocketJump(bot_state_t* bs); +// returns true if the bot has a persistant powerup and a weapon +int BotHasPersistantPowerupAndWeapon(bot_state_t* bs); +//returns true if the bot wants to and goes camping +int BotWantsToCamp(bot_state_t* bs); +//the bot will perform attack movements +bot_moveresult_t BotAttackMove(bot_state_t* bs, int tfl); +//returns true if the bot and the entity are in the same team +int BotSameTeam(bot_state_t* bs, int entnum); +//returns true if teamplay is on +int TeamPlayIsOn(void); +// returns the client number of the team mate flag carrier (-1 if none) +int BotTeamFlagCarrier(bot_state_t* bs); +//returns visible team mate flag carrier if available +int BotTeamFlagCarrierVisible(bot_state_t* bs); +//returns visible enemy flag carrier if available +int BotEnemyFlagCarrierVisible(bot_state_t* bs); +//get the number of visible teammates and enemies +void BotVisibleTeamMatesAndEnemies(bot_state_t* bs, int* teammates, int* enemies, float range); +//returns true if within the field of vision for the given angles +qboolean InFieldOfVision(vec3_t viewangles, float fov, vec3_t angles); +//returns true and sets the .enemy field when an enemy is found +int BotFindEnemy(bot_state_t* bs, int curenemy); +//returns a roam goal +void BotRoamGoal(bot_state_t* bs, vec3_t goal); +//returns entity visibility in the range [0, 1] +float BotEntityVisible(int viewer, vec3_t eye, vec3_t viewangles, float fov, int ent); +//the bot will aim at the current enemy +void BotAimAtEnemy(bot_state_t* bs); +//check if the bot should attack +void BotCheckAttack(bot_state_t* bs); +//AI when the bot is blocked +void BotAIBlocked(bot_state_t* bs, bot_moveresult_t* moveresult, int activate); +//AI to predict obstacles +int BotAIPredictObstacles(bot_state_t* bs, bot_goal_t* goal); +//enable or disable the areas the blocking entity is in +void BotEnableActivateGoalAreas(bot_activategoal_t* activategoal, int enable); +//pop an activate goal from the stack +int BotPopFromActivateGoalStack(bot_state_t* bs); +//clear the activate goal stack +void BotClearActivateGoalStack(bot_state_t* bs); +//returns the team the bot is in +int BotTeam(bot_state_t* bs); +//retuns the opposite team of the bot +int BotOppositeTeam(bot_state_t* bs); +//returns the flag the bot is carrying (CTFFLAG_?) +int BotCTFCarryingFlag(bot_state_t* bs); +//remember the last ordered task +void BotRememberLastOrderedTask(bot_state_t* bs); +//set ctf goals (defend base, get enemy flag) during seek +void BotCTFSeekGoals(bot_state_t* bs); +//set ctf goals (defend base, get enemy flag) during retreat +void BotCTFRetreatGoals(bot_state_t* bs); +// +#ifdef MISSIONPACK +int Bot1FCTFCarryingFlag(bot_state_t* bs); +int BotHarvesterCarryingCubes(bot_state_t* bs); +void Bot1FCTFSeekGoals(bot_state_t* bs); +void Bot1FCTFRetreatGoals(bot_state_t* bs); +void BotObeliskSeekGoals(bot_state_t* bs); +void BotObeliskRetreatGoals(bot_state_t* bs); +void BotGoHarvest(bot_state_t* bs); +void BotHarvesterSeekGoals(bot_state_t* bs); +void BotHarvesterRetreatGoals(bot_state_t* bs); +int BotTeamCubeCarrierVisible(bot_state_t* bs); +int BotEnemyCubeCarrierVisible(bot_state_t* bs); +#endif +//get a random alternate route goal towards the given base +int BotGetAlternateRouteGoal(bot_state_t* bs, int base); +//returns either the alternate route goal or the given goal +bot_goal_t* BotAlternateRoute(bot_state_t* bs, bot_goal_t* goal); +//create a new waypoint +bot_waypoint_t* BotCreateWayPoint(char* name, vec3_t origin, int areanum); +//find a waypoint with the given name +bot_waypoint_t* BotFindWayPoint(bot_waypoint_t* waypoints, char* name); +//strstr but case insensitive +char* stristr(char* str, char* charset); +//returns the number of the client with the given name +int ClientFromName(char* name); +int ClientOnSameTeamFromName(bot_state_t* bs, char* name); +// +int BotPointAreaNum(vec3_t origin); +// +void BotMapScripts(bot_state_t* bs); + +//ctf flags +#define CTF_FLAG_NONE 0 +#define CTF_FLAG_RED 1 +#define CTF_FLAG_BLUE 2 +//CTF skins +#define CTF_SKIN_REDTEAM "red" +#define CTF_SKIN_BLUETEAM "blue" + +extern int gametype; //game type +//extern int maxclients; //maximum number of clients + +extern vmCvar_t bot_grapple; +extern vmCvar_t bot_rocketjump; +extern vmCvar_t bot_fastchat; +extern vmCvar_t bot_nochat; +extern vmCvar_t bot_testrchat; +extern vmCvar_t bot_challenge; +extern vmCvar_t bot_showstates; + +extern bot_goal_t ctf_redflag; +extern bot_goal_t ctf_blueflag; +#ifdef MISSIONPACK +extern bot_goal_t ctf_neutralflag; +extern bot_goal_t redobelisk; +extern bot_goal_t blueobelisk; +extern bot_goal_t neutralobelisk; +#endif diff --git a/dlls/game/ai_main.h b/dlls/game/ai_main.h index 7526ca5..4bc3ff2 100644 --- a/dlls/game/ai_main.h +++ b/dlls/game/ai_main.h @@ -1,286 +1,284 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// - -/***************************************************************************** - * name: ai_main.h - * - * desc: Quake3 bot AI - * - * $Archive: /Code/DLLs/game/ai_main.h $ - * $Author: Jwaters $ - * $Revision: 2 $ - * $Modtime: 8/05/02 5:51p $ - * $Date: 8/06/02 6:28p $ - * - *****************************************************************************/ -#ifndef __AI_MAIN__ -#define __AI_MAIN__ - -//#define DEBUG -#define CTF - -//#define MAX_ITEMS 256 // already in q_shared.h -//bot flags -#define BFL_STRAFERIGHT 1 //strafe to the right -#define BFL_ATTACKED 2 //bot has attacked last ai frame -#define BFL_ATTACKJUMPED 4 //bot jumped during attack last frame -#define BFL_AIMATENEMY 8 //bot aimed at the enemy this frame -#define BFL_AVOIDRIGHT 16 //avoid obstacles by going to the right -#define BFL_IDEALVIEWSET 32 //bot has ideal view angles set -#define BFL_FIGHTSUICIDAL 64 //bot is in a suicidal fight -//long term goal types -#define LTG_TEAMHELP 1 //help a team mate -#define LTG_TEAMACCOMPANY 2 //accompany a team mate -#define LTG_DEFENDKEYAREA 3 //defend a key area -#define LTG_GETFLAG 4 //get the enemy flag -#define LTG_RUSHBASE 5 //rush to the base -#define LTG_RETURNFLAG 6 //return the flag -#define LTG_CAMP 7 //camp somewhere -#define LTG_CAMPORDER 8 //ordered to camp somewhere -#define LTG_PATROL 9 //patrol -#define LTG_GETITEM 10 //get an item -#define LTG_KILL 11 //kill someone -#define LTG_HARVEST 12 //harvest skulls -#define LTG_ATTACKENEMYBASE 13 //attack the enemy base -#define LTG_MAKELOVE_UNDER 14 -#define LTG_MAKELOVE_ONTOP 15 -//some goal dedication times -#define TEAM_HELP_TIME 60 //1 minute teamplay help time -#define TEAM_ACCOMPANY_TIME 600 //10 minutes teamplay accompany time -#define TEAM_DEFENDKEYAREA_TIME 600 //10 minutes ctf defend base time -#define TEAM_CAMP_TIME 600 //10 minutes camping time -#define TEAM_PATROL_TIME 600 //10 minutes patrolling time -#define TEAM_LEAD_TIME 600 //10 minutes taking the lead -#define TEAM_GETITEM_TIME 60 //1 minute -#define TEAM_KILL_SOMEONE 180 //3 minute to kill someone -#define TEAM_ATTACKENEMYBASE_TIME 600 //10 minutes -#define TEAM_HARVEST_TIME 120 //2 minutes -#define CTF_GETFLAG_TIME 600 //10 minutes ctf get flag time -#define CTF_RUSHBASE_TIME 120 //2 minutes ctf rush base time -#define CTF_RETURNFLAG_TIME 180 //3 minutes to return the flag -#define CTF_ROAM_TIME 60 //1 minute ctf roam time -//patrol flags -#define PATROL_LOOP 1 -#define PATROL_REVERSE 2 -#define PATROL_BACK 4 -//teamplay task preference -#define TEAMTP_DEFENDER 1 -#define TEAMTP_ATTACKER 2 -//CTF strategy -#define CTFS_AGRESSIVE 1 -//copied from the aas file header -#define PRESENCE_NONE 1 -#define PRESENCE_NORMAL 2 -#define PRESENCE_CROUCH 4 -// -#define MAX_PROXMINES 64 - -//check points -typedef struct bot_waypoint_s -{ - int inuse; - char name[32]; - bot_goal_t goal; - struct bot_waypoint_s *next, *prev; -} bot_waypoint_t; - -#define MAX_ACTIVATESTACK 8 -#define MAX_ACTIVATEAREAS 32 - -typedef struct bot_activategoal_s -{ - int inuse; - bot_goal_t goal; //goal to activate (buttons etc.) - float time; //time to activate something - float start_time; //time starting to activate something - float justused_time; //time the goal was used - int shoot; //true if bot has to shoot to activate - int weapon; //weapon to be used for activation - vec3_t target; //target to shoot at to activate something - vec3_t origin; //origin of the blocking entity to activate - int areas[MAX_ACTIVATEAREAS]; //routing areas disabled by blocking entity - int numareas; //number of disabled routing areas - int areasdisabled; //true if the areas are disabled for the routing - struct bot_activategoal_s *next; //next activate goal on stack -} bot_activategoal_t; - -//bot state -typedef struct bot_state_s -{ - int inuse; //true if this state is used by a bot client - int botthink_residual; //residual for the bot thinks - int client; //client number of the bot - int entitynum; //entity number of the bot - playerState_t cur_ps; //current player state - int last_eFlags; //last ps flags - usercmd_t lastucmd; //usercmd from last frame - int entityeventTime[1024]; //last entity event time - // - bot_settings_t settings; //several bot settings - int (*ainode)(struct bot_state_s *bs); //current AI node - float thinktime; //time the bot thinks this frame - vec3_t origin; //origin of the bot - vec3_t velocity; //velocity of the bot - int presencetype; //presence type of the bot - vec3_t eye; //eye coordinates of the bot - int areanum; //the number of the area the bot is in - int inventory[256]; // was MAX_INVENTORY, but they have different defs in bot code FIXME //string with items amounts the bot has - int tfl; //the travel flags the bot uses - int flags; //several flags - int respawn_wait; //wait until respawned - int lasthealth; //health value previous frame - int lastkilledplayer; //last killed player - int lastkilledby; //player that last killed this bot - int botdeathtype; //the death type of the bot - int enemydeathtype; //the death type of the enemy - int botsuicide; //true when the bot suicides - int enemysuicide; //true when the enemy of the bot suicides - int setupcount; //true when the bot has just been setup - int map_restart; //true when the map is being restarted - int entergamechat; //true when the bot used an enter game chat - int num_deaths; //number of time this bot died - int num_kills; //number of kills of this bot - int revenge_enemy; //the revenge enemy - int revenge_kills; //number of kills the enemy made - int lastframe_health; //health value the last frame - int lasthitcount; //number of hits last frame - int chatto; //chat to all or team - float walker; //walker charactertic - float ltime; //local bot time - float entergame_time; //time the bot entered the game - float ltg_time; //long term goal time - float nbg_time; //nearby goal time - float respawn_time; //time the bot takes to respawn - float respawnchat_time; //time the bot started a chat during respawn - float chase_time; //time the bot will chase the enemy - float enemyvisible_time; //time the enemy was last visible - float check_time; //time to check for nearby items - float stand_time; //time the bot is standing still - float lastchat_time; //time the bot last selected a chat - float kamikaze_time; //time to check for kamikaze usage - float invulnerability_time; //time to check for invulnerability usage - float standfindenemy_time; //time to find enemy while standing - float attackstrafe_time; //time the bot is strafing in one dir - float attackcrouch_time; //time the bot will stop crouching - float attackchase_time; //time the bot chases during actual attack - float attackjump_time; //time the bot jumped during attack - float enemysight_time; //time before reacting to enemy - float enemydeath_time; //time the enemy died - float enemyposition_time; //time the position and velocity of the enemy were stored - float defendaway_time; //time away while defending - float defendaway_range; //max travel time away from defend area - float rushbaseaway_time; //time away from rushing to the base - float attackaway_time; //time away from attacking the enemy base - float harvestaway_time; //time away from harvesting - float ctfroam_time; //time the bot is roaming in ctf - float killedenemy_time; //time the bot killed the enemy - float arrive_time; //time arrived (at companion) - float lastair_time; //last time the bot had air - float teleport_time; //last time the bot teleported - float camp_time; //last time camped - float camp_range; //camp range - float weaponchange_time; //time the bot started changing weapons - float firethrottlewait_time; //amount of time to wait - float firethrottleshoot_time; //amount of time to shoot - float notblocked_time; //last time the bot was not blocked - float blockedbyavoidspot_time; //time blocked by an avoid spot - float predictobstacles_time; //last time the bot predicted obstacles - int predictobstacles_goalareanum; //last goal areanum the bot predicted obstacles for - vec3_t aimtarget; - vec3_t enemyvelocity; //enemy velocity 0.5 secs ago during battle - vec3_t enemyorigin; //enemy origin 0.5 secs ago during battle - // - int kamikazebody; //kamikaze body - int proxmines[MAX_PROXMINES]; - int numproxmines; - // - int character; //the bot character - int ms; //move state of the bot - int gs; //goal state of the bot - int cs; //chat state of the bot - int ws; //weapon state of the bot - // - int enemy; //enemy entity number - int lastenemyareanum; //last reachability area the enemy was in - vec3_t lastenemyorigin; //last origin of the enemy in the reachability area - int weaponnum; //current weapon number - vec3_t viewangles; //current view angles - vec3_t ideal_viewangles; //ideal view angles - vec3_t viewanglespeed; - // - int ltgtype; //long term goal type - // team goals - int teammate; //team mate involved in this team goal - int decisionmaker; //player who decided to go for this goal - int ordered; //true if ordered to do something - float order_time; //time ordered to do something - int owndecision_time; //time the bot made it's own decision - bot_goal_t teamgoal; //the team goal - bot_goal_t altroutegoal; //alternative route goal - float reachedaltroutegoal_time; //time the bot reached the alt route goal - float teammessage_time; //time to message team mates what the bot is doing - float teamgoal_time; //time to stop helping team mate - float teammatevisible_time; //last time the team mate was NOT visible - int teamtaskpreference; //team task preference - // last ordered team goal - int lastgoal_decisionmaker; - int lastgoal_ltgtype; - int lastgoal_teammate; - bot_goal_t lastgoal_teamgoal; - // for leading team mates - int lead_teammate; //team mate the bot is leading - bot_goal_t lead_teamgoal; //team goal while leading - float lead_time; //time leading someone - float leadvisible_time; //last time the team mate was visible - float leadmessage_time; //last time a messaged was sent to the team mate - float leadbackup_time; //time backing up towards team mate - // - char teamleader[32]; //netname of the team leader - float askteamleader_time; //time asked for team leader - float becometeamleader_time; //time the bot will become the team leader - float teamgiveorders_time; //time to give team orders - float lastflagcapture_time; //last time a flag was captured - int numteammates; //number of team mates - int redflagstatus; //0 = at base, 1 = not at base - int blueflagstatus; //0 = at base, 1 = not at base - int neutralflagstatus; //0 = at base, 1 = our team has flag, 2 = enemy team has flag, 3 = enemy team dropped the flag - int flagstatuschanged; //flag status changed - int forceorders; //true if forced to give orders - int flagcarrier; //team mate carrying the enemy flag - int ctfstrategy; //ctf strategy - char subteam[32]; //sub team name - float formation_dist; //formation team mate intervening space - char formation_teammate[16]; //netname of the team mate the bot uses for relative positioning - float formation_angle; //angle relative to the formation team mate - vec3_t formation_dir; //the direction the formation is moving in - vec3_t formation_origin; //origin the bot uses for relative positioning - bot_goal_t formation_goal; //formation goal - - bot_activategoal_t *activatestack; //first activate goal on the stack - bot_activategoal_t activategoalheap[MAX_ACTIVATESTACK]; //activate goal heap - - bot_waypoint_t *checkpoints; //check points - bot_waypoint_t *patrolpoints; //patrol points - bot_waypoint_t *curpatrolpoint; //current patrol point the bot is going for - int patrolflags; //patrol flags -} bot_state_t; - -//resets the whole bot state -void BotResetState(bot_state_t *bs); -//returns the number of bots in the game -int NumBots(void); -//returns info about the entity -void BotEntityInfo(int entnum, aas_entityinfo_t *info); - -extern float floattime; -#define FloatTime() level.time - -// from the game source -void QDECL BotAI_Print(int type, const char *fmt, ...); -void QDECL QDECL BotAI_BotInitialChat( bot_state_t *bs, const char *type, ... ); -void BotAI_Trace(bsp_trace_t *bsptrace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int passent, int contentmask); -int BotAI_GetClientState( int clientNum, playerState_t *state ); -int BotAI_GetEntityState( int entityNum, entityState_t *state ); -int BotAI_GetSnapshotEntity( int clientNum, int sequence, entityState_t *state ); -int BotTeamLeader(bot_state_t *bs); -#endif // __AI_MAIN__ +// Copyright (C) 1999-2000 Id Software, Inc. +// + +/***************************************************************************** + * name: ai_main.h + * + * desc: Quake3 bot AI + * + * $Archive: /Code/DLLs/game/ai_main.h $ + * $Author: Jwaters $ + * $Revision: 2 $ + * $Modtime: 8/05/02 5:51p $ + * $Date: 8/06/02 6:28p $ + * + *****************************************************************************/ +#ifndef __AI_MAIN__ +#define __AI_MAIN__ + +//#define DEBUG +#define CTF + +//#define MAX_ITEMS 256 // already in q_shared.h +//bot flags +#define BFL_STRAFERIGHT 1 //strafe to the right +#define BFL_ATTACKED 2 //bot has attacked last ai frame +#define BFL_ATTACKJUMPED 4 //bot jumped during attack last frame +#define BFL_AIMATENEMY 8 //bot aimed at the enemy this frame +#define BFL_AVOIDRIGHT 16 //avoid obstacles by going to the right +#define BFL_IDEALVIEWSET 32 //bot has ideal view angles set +#define BFL_FIGHTSUICIDAL 64 //bot is in a suicidal fight +//long term goal types +#define LTG_TEAMHELP 1 //help a team mate +#define LTG_TEAMACCOMPANY 2 //accompany a team mate +#define LTG_DEFENDKEYAREA 3 //defend a key area +#define LTG_GETFLAG 4 //get the enemy flag +#define LTG_RUSHBASE 5 //rush to the base +#define LTG_RETURNFLAG 6 //return the flag +#define LTG_CAMP 7 //camp somewhere +#define LTG_CAMPORDER 8 //ordered to camp somewhere +#define LTG_PATROL 9 //patrol +#define LTG_GETITEM 10 //get an item +#define LTG_KILL 11 //kill someone +#define LTG_HARVEST 12 //harvest skulls +#define LTG_ATTACKENEMYBASE 13 //attack the enemy base +#define LTG_MAKELOVE_UNDER 14 +#define LTG_MAKELOVE_ONTOP 15 +//some goal dedication times +#define TEAM_HELP_TIME 60 //1 minute teamplay help time +#define TEAM_ACCOMPANY_TIME 600 //10 minutes teamplay accompany time +#define TEAM_DEFENDKEYAREA_TIME 600 //10 minutes ctf defend base time +#define TEAM_CAMP_TIME 600 //10 minutes camping time +#define TEAM_PATROL_TIME 600 //10 minutes patrolling time +#define TEAM_LEAD_TIME 600 //10 minutes taking the lead +#define TEAM_GETITEM_TIME 60 //1 minute +#define TEAM_KILL_SOMEONE 180 //3 minute to kill someone +#define TEAM_ATTACKENEMYBASE_TIME 600 //10 minutes +#define TEAM_HARVEST_TIME 120 //2 minutes +#define CTF_GETFLAG_TIME 600 //10 minutes ctf get flag time +#define CTF_RUSHBASE_TIME 120 //2 minutes ctf rush base time +#define CTF_RETURNFLAG_TIME 180 //3 minutes to return the flag +#define CTF_ROAM_TIME 60 //1 minute ctf roam time +//patrol flags +#define PATROL_LOOP 1 +#define PATROL_REVERSE 2 +#define PATROL_BACK 4 +//teamplay task preference +#define TEAMTP_DEFENDER 1 +#define TEAMTP_ATTACKER 2 +//CTF strategy +#define CTFS_AGRESSIVE 1 +//copied from the aas file header +#define PRESENCE_NONE 1 +#define PRESENCE_NORMAL 2 +#define PRESENCE_CROUCH 4 +// +#define MAX_PROXMINES 64 + +//check points +typedef struct bot_waypoint_s { + int inuse; + char name[32]; + bot_goal_t goal; + struct bot_waypoint_s* next; + struct bot_waypoint_s* prev; +} bot_waypoint_t; + +#define MAX_ACTIVATESTACK 8 +#define MAX_ACTIVATEAREAS 32 + +typedef struct bot_activategoal_s { + int inuse; + bot_goal_t goal; //goal to activate (buttons etc.) + float time; //time to activate something + float start_time; //time starting to activate something + float justused_time; //time the goal was used + int shoot; //true if bot has to shoot to activate + int weapon; //weapon to be used for activation + vec3_t target; //target to shoot at to activate something + vec3_t origin; //origin of the blocking entity to activate + int areas[MAX_ACTIVATEAREAS]; //routing areas disabled by blocking entity + int numareas; //number of disabled routing areas + int areasdisabled; //true if the areas are disabled for the routing + struct bot_activategoal_s* next; //next activate goal on stack +} bot_activategoal_t; + +//bot state +typedef struct bot_state_s { + int inuse; //true if this state is used by a bot client + int botthink_residual; //residual for the bot thinks + int client; //client number of the bot + int entitynum; //entity number of the bot + playerState_t cur_ps; //current player state + int last_eFlags; //last ps flags + usercmd_t lastucmd; //usercmd from last frame + int entityeventTime[1024]; //last entity event time + // + bot_settings_t settings; //several bot settings + int(*ainode)(struct bot_state_s* bs); //current AI node + float thinktime; //time the bot thinks this frame + vec3_t origin; //origin of the bot + vec3_t velocity; //velocity of the bot + int presencetype; //presence type of the bot + vec3_t eye; //eye coordinates of the bot + int areanum; //the number of the area the bot is in + int inventory[256]; // was MAX_INVENTORY, but they have different defs in bot code FIXME //string with items amounts the bot has + int tfl; //the travel flags the bot uses + int flags; //several flags + int respawn_wait; //wait until respawned + int lasthealth; //health value previous frame + int lastkilledplayer; //last killed player + int lastkilledby; //player that last killed this bot + int botdeathtype; //the death type of the bot + int enemydeathtype; //the death type of the enemy + int botsuicide; //true when the bot suicides + int enemysuicide; //true when the enemy of the bot suicides + int setupcount; //true when the bot has just been setup + int map_restart; //true when the map is being restarted + int entergamechat; //true when the bot used an enter game chat + int num_deaths; //number of time this bot died + int num_kills; //number of kills of this bot + int revenge_enemy; //the revenge enemy + int revenge_kills; //number of kills the enemy made + int lastframe_health; //health value the last frame + int lasthitcount; //number of hits last frame + int chatto; //chat to all or team + float walker; //walker charactertic + float ltime; //local bot time + float entergame_time; //time the bot entered the game + float ltg_time; //long term goal time + float nbg_time; //nearby goal time + float respawn_time; //time the bot takes to respawn + float respawnchat_time; //time the bot started a chat during respawn + float chase_time; //time the bot will chase the enemy + float enemyvisible_time; //time the enemy was last visible + float check_time; //time to check for nearby items + float stand_time; //time the bot is standing still + float lastchat_time; //time the bot last selected a chat + float kamikaze_time; //time to check for kamikaze usage + float invulnerability_time; //time to check for invulnerability usage + float standfindenemy_time; //time to find enemy while standing + float attackstrafe_time; //time the bot is strafing in one dir + float attackcrouch_time; //time the bot will stop crouching + float attackchase_time; //time the bot chases during actual attack + float attackjump_time; //time the bot jumped during attack + float enemysight_time; //time before reacting to enemy + float enemydeath_time; //time the enemy died + float enemyposition_time; //time the position and velocity of the enemy were stored + float defendaway_time; //time away while defending + float defendaway_range; //max travel time away from defend area + float rushbaseaway_time; //time away from rushing to the base + float attackaway_time; //time away from attacking the enemy base + float harvestaway_time; //time away from harvesting + float ctfroam_time; //time the bot is roaming in ctf + float killedenemy_time; //time the bot killed the enemy + float arrive_time; //time arrived (at companion) + float lastair_time; //last time the bot had air + float teleport_time; //last time the bot teleported + float camp_time; //last time camped + float camp_range; //camp range + float weaponchange_time; //time the bot started changing weapons + float firethrottlewait_time; //amount of time to wait + float firethrottleshoot_time; //amount of time to shoot + float notblocked_time; //last time the bot was not blocked + float blockedbyavoidspot_time; //time blocked by an avoid spot + float predictobstacles_time; //last time the bot predicted obstacles + int predictobstacles_goalareanum; //last goal areanum the bot predicted obstacles for + vec3_t aimtarget; + vec3_t enemyvelocity; //enemy velocity 0.5 secs ago during battle + vec3_t enemyorigin; //enemy origin 0.5 secs ago during battle + // + int kamikazebody; //kamikaze body + int proxmines[MAX_PROXMINES]; + int numproxmines; + // + int character; //the bot character + int ms; //move state of the bot + int gs; //goal state of the bot + int cs; //chat state of the bot + int ws; //weapon state of the bot + // + int enemy; //enemy entity number + int lastenemyareanum; //last reachability area the enemy was in + vec3_t lastenemyorigin; //last origin of the enemy in the reachability area + int weaponnum; //current weapon number + vec3_t viewangles; //current view angles + vec3_t ideal_viewangles; //ideal view angles + vec3_t viewanglespeed; + // + int ltgtype; //long term goal type + // team goals + int teammate; //team mate involved in this team goal + int decisionmaker; //player who decided to go for this goal + int ordered; //true if ordered to do something + float order_time; //time ordered to do something + int owndecision_time; //time the bot made it's own decision + bot_goal_t teamgoal; //the team goal + bot_goal_t altroutegoal; //alternative route goal + float reachedaltroutegoal_time; //time the bot reached the alt route goal + float teammessage_time; //time to message team mates what the bot is doing + float teamgoal_time; //time to stop helping team mate + float teammatevisible_time; //last time the team mate was NOT visible + int teamtaskpreference; //team task preference + // last ordered team goal + int lastgoal_decisionmaker; + int lastgoal_ltgtype; + int lastgoal_teammate; + bot_goal_t lastgoal_teamgoal; + // for leading team mates + int lead_teammate; //team mate the bot is leading + bot_goal_t lead_teamgoal; //team goal while leading + float lead_time; //time leading someone + float leadvisible_time; //last time the team mate was visible + float leadmessage_time; //last time a messaged was sent to the team mate + float leadbackup_time; //time backing up towards team mate + // + char teamleader[32]; //netname of the team leader + float askteamleader_time; //time asked for team leader + float becometeamleader_time; //time the bot will become the team leader + float teamgiveorders_time; //time to give team orders + float lastflagcapture_time; //last time a flag was captured + int numteammates; //number of team mates + int redflagstatus; //0 = at base, 1 = not at base + int blueflagstatus; //0 = at base, 1 = not at base + int neutralflagstatus; //0 = at base, 1 = our team has flag, 2 = enemy team has flag, 3 = enemy team dropped the flag + int flagstatuschanged; //flag status changed + int forceorders; //true if forced to give orders + int flagcarrier; //team mate carrying the enemy flag + int ctfstrategy; //ctf strategy + char subteam[32]; //sub team name + float formation_dist; //formation team mate intervening space + char formation_teammate[16]; //netname of the team mate the bot uses for relative positioning + float formation_angle; //angle relative to the formation team mate + vec3_t formation_dir; //the direction the formation is moving in + vec3_t formation_origin; //origin the bot uses for relative positioning + bot_goal_t formation_goal; //formation goal + + bot_activategoal_t* activatestack; //first activate goal on the stack + bot_activategoal_t activategoalheap[MAX_ACTIVATESTACK]; //activate goal heap + + bot_waypoint_t* checkpoints; //check points + bot_waypoint_t* patrolpoints; //patrol points + bot_waypoint_t* curpatrolpoint; //current patrol point the bot is going for + int patrolflags; //patrol flags +} bot_state_t; + +//resets the whole bot state +void BotResetState(bot_state_t* bs); +//returns the number of bots in the game +int NumBots(void); +//returns info about the entity +void BotEntityInfo(int entnum, aas_entityinfo_t* info); + +extern float floattime; +#define FloatTime() level.time + +// from the game source +void QDECL BotAI_Print(int type, const char* fmt, ...); +void QDECL QDECL BotAI_BotInitialChat(bot_state_t* bs, const char* type, ...); +void BotAI_Trace(bsp_trace_t* bsptrace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int passent, int contentmask); +int BotAI_GetClientState(int clientNum, playerState_t* state); +int BotAI_GetEntityState(int entityNum, entityState_t* state); +int BotAI_GetSnapshotEntity(int clientNum, int sequence, entityState_t* state); +int BotTeamLeader(bot_state_t* bs); +#endif // __AI_MAIN__ diff --git a/dlls/game/ai_team.h b/dlls/game/ai_team.h index d3a5c73..9577157 100644 --- a/dlls/game/ai_team.h +++ b/dlls/game/ai_team.h @@ -1,23 +1,23 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// - -/***************************************************************************** - * name: ai_team.h - * - * desc: Quake3 bot AI - * - * $Archive: /Code/DLLs/game/ai_team.h $ - * $Author: Jwaters $ - * $Revision: 1 $ - * $Modtime: 7/25/02 11:48a $ - * $Date: 7/30/02 1:10p $ - * - *****************************************************************************/ - -void BotTeamAI(bot_state_t *bs); -int BotGetTeamMateTaskPreference(bot_state_t *bs, int teammate); -void BotSetTeamMateTaskPreference(bot_state_t *bs, int teammate, int preference); -void BotVoiceChat(bot_state_t *bs, int toclient, const char *voicechat); -void BotVoiceChatOnly(bot_state_t *bs, int toclient, const char *voicechat); - - +// Copyright (C) 1999-2000 Id Software, Inc. +// + +/***************************************************************************** + * name: ai_team.h + * + * desc: Quake3 bot AI + * + * $Archive: /Code/DLLs/game/ai_team.h $ + * $Author: Jwaters $ + * $Revision: 1 $ + * $Modtime: 7/25/02 11:48a $ + * $Date: 7/30/02 1:10p $ + * + *****************************************************************************/ + +void BotTeamAI(bot_state_t* bs); +int BotGetTeamMateTaskPreference(bot_state_t* bs, int teammate); +void BotSetTeamMateTaskPreference(bot_state_t* bs, int teammate, int preference); +void BotVoiceChat(bot_state_t* bs, int toclient, const char* voicechat); +void BotVoiceChatOnly(bot_state_t* bs, int toclient, const char* voicechat); + + diff --git a/dlls/game/ai_vcmd.h b/dlls/game/ai_vcmd.h index fcf4ed4..b18d095 100644 --- a/dlls/game/ai_vcmd.h +++ b/dlls/game/ai_vcmd.h @@ -1,20 +1,20 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// - -/***************************************************************************** - * name: ai_vcmd.h - * - * desc: Quake3 bot AI - * - * $Archive: /Code/DLLs/game/ai_vcmd.h $ - * $Author: Jwaters $ - * $Revision: 1 $ - * $Modtime: 7/25/02 11:48a $ - * $Date: 7/30/02 1:10p $ - * - *****************************************************************************/ - -int BotVoiceChatCommand(bot_state_t *bs, int mode, char *voicechat); -void BotVoiceChat_Defend(bot_state_t *bs, int client, int mode); - - +// Copyright (C) 1999-2000 Id Software, Inc. +// + +/***************************************************************************** + * name: ai_vcmd.h + * + * desc: Quake3 bot AI + * + * $Archive: /Code/DLLs/game/ai_vcmd.h $ + * $Author: Jwaters $ + * $Revision: 1 $ + * $Modtime: 7/25/02 11:48a $ + * $Date: 7/30/02 1:10p $ + * + *****************************************************************************/ + +int BotVoiceChatCommand(bot_state_t* bs, int mode, char* voicechat); +void BotVoiceChat_Defend(bot_state_t* bs, int client, int mode); + + diff --git a/dlls/game/be_aas.h b/dlls/game/be_aas.h index b46d305..ef7d3f8 100644 --- a/dlls/game/be_aas.h +++ b/dlls/game/be_aas.h @@ -1,210 +1,204 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// - -/***************************************************************************** - * name: be_aas.h - * - * desc: Area Awareness System, stuff exported to the AI - * - * $Archive: /Code/DLLs/game/be_aas.h $ - * $Author: Steven $ - * $Revision: 2 $ - * $Modtime: 10/13/03 9:01a $ - * $Date: 10/13/03 9:11a $ - * - *****************************************************************************/ - -#ifndef MAX_STRINGFIELD -#define MAX_STRINGFIELD 80 -#endif - -//travel flags -#define TFL_INVALID 0x00000001 //traveling temporary not possible -#define TFL_WALK 0x00000002 //walking -#define TFL_CROUCH 0x00000004 //crouching -#define TFL_BARRIERJUMP 0x00000008 //jumping onto a barrier -#define TFL_JUMP 0x00000010 //jumping -#define TFL_LADDER 0x00000020 //climbing a ladder -#define TFL_WALKOFFLEDGE 0x00000080 //walking of a ledge -#define TFL_SWIM 0x00000100 //swimming -#define TFL_WATERJUMP 0x00000200 //jumping out of the water -#define TFL_TELEPORT 0x00000400 //teleporting -#define TFL_ELEVATOR 0x00000800 //elevator -#define TFL_ROCKETJUMP 0x00001000 //rocket jumping -#define TFL_BFGJUMP 0x00002000 //bfg jumping -#define TFL_GRAPPLEHOOK 0x00004000 //grappling hook -#define TFL_DOUBLEJUMP 0x00008000 //double jump -#define TFL_RAMPJUMP 0x00010000 //ramp jump -#define TFL_STRAFEJUMP 0x00020000 //strafe jump -#define TFL_JUMPPAD 0x00040000 //jump pad -#define TFL_AIR 0x00080000 //travel through air -#define TFL_WATER 0x00100000 //travel through water -#define TFL_SLIME 0x00200000 //travel through slime -#define TFL_LAVA 0x00400000 //travel through lava -#define TFL_DONOTENTER 0x00800000 //travel through donotenter area -#define TFL_FUNCBOB 0x01000000 //func bobbing -#define TFL_FLIGHT 0x02000000 //flight -#define TFL_BRIDGE 0x04000000 //move over a bridge -// -#define TFL_NOTTEAM1 0x08000000 //not team 1 -#define TFL_NOTTEAM2 0x10000000 //not team 2 - -//default travel flags -#define TFL_DEFAULT TFL_WALK|TFL_CROUCH|TFL_BARRIERJUMP|\ - TFL_JUMP|TFL_LADDER|\ - TFL_WALKOFFLEDGE|TFL_SWIM|TFL_WATERJUMP|\ - TFL_TELEPORT|TFL_ELEVATOR|\ - TFL_AIR|TFL_WATER|TFL_JUMPPAD|TFL_FUNCBOB - -// already defined in g_public.h in tiki tech, moved to l_util.h so the botlib stuff compiles but the gamecode also compiles -/* -typedef enum -{ - SOLID_NOT, // no interaction with other objects - SOLID_TRIGGER, // only touch when inside, after moving - SOLID_BBOX, // touch on edge - SOLID_BSP // bsp clip, touch on edge -} solid_t; -*/ - -//a trace is returned when a box is swept through the AAS world -typedef struct aas_trace_s -{ - qboolean startsolid; // if true, the initial point was in a solid area - float fraction; // time completed, 1.0 = didn't hit anything - vec3_t endpos; // final position - int ent; // entity blocking the trace - int lastarea; // last area the trace was in (zero if none) - int area; // area blocking the trace (zero if none) - int planenum; // number of the plane that was hit -} aas_trace_t; - -// Defined in botlib.h - -//bsp_trace_t hit surface -/* -typedef struct bsp_surface_s -{ - char name[16]; - int flags; - int value; -} bsp_surface_t; - -//a trace is returned when a box is swept through the BSP world -typedef struct bsp_trace_s -{ - qboolean allsolid; // if true, plane is not valid - qboolean startsolid; // if true, the initial point was in a solid area - float fraction; // time completed, 1.0 = didn't hit anything - vec3_t endpos; // final position - cplane_t plane; // surface normal at impact - float exp_dist; // expanded plane distance - int sidenum; // number of the brush side hit - bsp_surface_t surface; // hit surface - int contents; // contents on other side of surface hit - int ent; // number of entity hit -} bsp_trace_t; -*/ -// - - -//entity info -typedef struct aas_entityinfo_s -{ - int valid; // true if updated this frame - int type; // entity type - int flags; // entity flags - float ltime; // local time - float update_time; // time between last and current update - int number; // number of the entity - vec3_t origin; // origin of the entity - vec3_t angles; // angles of the model - vec3_t old_origin; // for lerping - vec3_t lastvisorigin; // last visible origin - vec3_t mins; // bounding box minimums - vec3_t maxs; // bounding box maximums - int groundent; // ground entity - int solid; // solid type - int modelindex; // model used - int modelindex2; // weapons, CTF flags, etc - int frame; // model frame number - int event; // impulse events -- muzzle flashes, footsteps, etc - int eventParm; // even parameter - int powerups; // bit flags - int weapon; // determines weapon and flash model, etc - int legsAnim; // mask off ANIM_TOGGLEBIT - int torsoAnim; // mask off ANIM_TOGGLEBIT -} aas_entityinfo_t; - -// area info -typedef struct aas_areainfo_s -{ - int contents; - int flags; - int presencetype; - int cluster; - vec3_t mins; - vec3_t maxs; - vec3_t center; -} aas_areainfo_t; - -// client movement prediction stop events, stop as soon as: -#define SE_NONE 0 -#define SE_HITGROUND 1 // the ground is hit -#define SE_LEAVEGROUND 2 // there's no ground -#define SE_ENTERWATER 4 // water is entered -#define SE_ENTERSLIME 8 // slime is entered -#define SE_ENTERLAVA 16 // lava is entered -#define SE_HITGROUNDDAMAGE 32 // the ground is hit with damage -#define SE_GAP 64 // there's a gap -#define SE_TOUCHJUMPPAD 128 // touching a jump pad area -#define SE_TOUCHTELEPORTER 256 // touching teleporter -#define SE_ENTERAREA 512 // the given stoparea is entered -#define SE_HITGROUNDAREA 1024 // a ground face in the area is hit -#define SE_HITBOUNDINGBOX 2048 // hit the specified bounding box -#define SE_TOUCHCLUSTERPORTAL 4096 // touching a cluster portal - -typedef struct aas_clientmove_s -{ - vec3_t endpos; //position at the end of movement prediction - int endarea; //area at end of movement prediction - vec3_t velocity; //velocity at the end of movement prediction - aas_trace_t trace; //last trace - int presencetype; //presence type at end of movement prediction - int stopevent; //event that made the prediction stop - int endcontents; //contents at the end of movement prediction - float time; //time predicted ahead - int frames; //number of frames predicted ahead -} aas_clientmove_t; - -// alternate route goals -#define ALTROUTEGOAL_ALL 1 -#define ALTROUTEGOAL_CLUSTERPORTALS 2 -#define ALTROUTEGOAL_VIEWPORTALS 4 - -typedef struct aas_altroutegoal_s -{ - vec3_t origin; - int areanum; - unsigned short starttraveltime; - unsigned short goaltraveltime; - unsigned short extratraveltime; -} aas_altroutegoal_t; - -// route prediction stop events -#define RSE_NONE 0 -#define RSE_NOROUTE 1 //no route to goal -#define RSE_USETRAVELTYPE 2 //stop as soon as on of the given travel types is used -#define RSE_ENTERCONTENTS 4 //stop when entering the given contents -#define RSE_ENTERAREA 8 //stop when entering the given area - -typedef struct aas_predictroute_s -{ - vec3_t endpos; //position at the end of movement prediction - int endarea; //area at end of movement prediction - int stopevent; //event that made the prediction stop - int endcontents; //contents at the end of movement prediction - int endtravelflags; //end travel flags - int numareas; //number of areas predicted ahead - int time; //time predicted ahead (in hundreth of a sec) -} aas_predictroute_t; +// Copyright (C) 1999-2000 Id Software, Inc. +// + +/***************************************************************************** + * name: be_aas.h + * + * desc: Area Awareness System, stuff exported to the AI + * + * $Archive: /Code/DLLs/game/be_aas.h $ + * $Author: Steven $ + * $Revision: 2 $ + * $Modtime: 10/13/03 9:01a $ + * $Date: 10/13/03 9:11a $ + * + *****************************************************************************/ + +#ifndef MAX_STRINGFIELD +#define MAX_STRINGFIELD 80 +#endif + +//travel flags +#define TFL_INVALID 0x00000001 //traveling temporary not possible +#define TFL_WALK 0x00000002 //walking +#define TFL_CROUCH 0x00000004 //crouching +#define TFL_BARRIERJUMP 0x00000008 //jumping onto a barrier +#define TFL_JUMP 0x00000010 //jumping +#define TFL_LADDER 0x00000020 //climbing a ladder +#define TFL_WALKOFFLEDGE 0x00000080 //walking of a ledge +#define TFL_SWIM 0x00000100 //swimming +#define TFL_WATERJUMP 0x00000200 //jumping out of the water +#define TFL_TELEPORT 0x00000400 //teleporting +#define TFL_ELEVATOR 0x00000800 //elevator +#define TFL_ROCKETJUMP 0x00001000 //rocket jumping +#define TFL_BFGJUMP 0x00002000 //bfg jumping +#define TFL_GRAPPLEHOOK 0x00004000 //grappling hook +#define TFL_DOUBLEJUMP 0x00008000 //double jump +#define TFL_RAMPJUMP 0x00010000 //ramp jump +#define TFL_STRAFEJUMP 0x00020000 //strafe jump +#define TFL_JUMPPAD 0x00040000 //jump pad +#define TFL_AIR 0x00080000 //travel through air +#define TFL_WATER 0x00100000 //travel through water +#define TFL_SLIME 0x00200000 //travel through slime +#define TFL_LAVA 0x00400000 //travel through lava +#define TFL_DONOTENTER 0x00800000 //travel through donotenter area +#define TFL_FUNCBOB 0x01000000 //func bobbing +#define TFL_FLIGHT 0x02000000 //flight +#define TFL_BRIDGE 0x04000000 //move over a bridge +// +#define TFL_NOTTEAM1 0x08000000 //not team 1 +#define TFL_NOTTEAM2 0x10000000 //not team 2 + +//default travel flags +#define TFL_DEFAULT TFL_WALK|TFL_CROUCH|TFL_BARRIERJUMP|\ + TFL_JUMP | TFL_LADDER | \ + TFL_WALKOFFLEDGE | TFL_SWIM | TFL_WATERJUMP | \ + TFL_TELEPORT | TFL_ELEVATOR | \ + TFL_AIR | TFL_WATER | TFL_JUMPPAD | TFL_FUNCBOB + +// already defined in g_public.h in tiki tech, moved to l_util.h so the botlib stuff compiles but the gamecode also compiles +/* +typedef enum +{ +SOLID_NOT, // no interaction with other objects +SOLID_TRIGGER, // only touch when inside, after moving +SOLID_BBOX, // touch on edge +SOLID_BSP // bsp clip, touch on edge +} solid_t; +*/ + +//a trace is returned when a box is swept through the AAS world +typedef struct aas_trace_s { + qboolean startsolid;// if true, the initial point was in a solid area + float fraction; // time completed, 1.0 = didn't hit anything + vec3_t endpos; // final position + int ent; // entity blocking the trace + int lastarea; // last area the trace was in (zero if none) + int area; // area blocking the trace (zero if none) + int planenum; // number of the plane that was hit +} aas_trace_t; + +// Defined in botlib.h + +//bsp_trace_t hit surface +/* +typedef struct bsp_surface_s +{ +char name[16]; +int flags; +int value; +} bsp_surface_t; + +//a trace is returned when a box is swept through the BSP world +typedef struct bsp_trace_s +{ +qboolean allsolid; // if true, plane is not valid +qboolean startsolid; // if true, the initial point was in a solid area +float fraction; // time completed, 1.0 = didn't hit anything +vec3_t endpos; // final position +cplane_t plane; // surface normal at impact +float exp_dist; // expanded plane distance +int sidenum; // number of the brush side hit +bsp_surface_t surface; // hit surface +int contents; // contents on other side of surface hit +int ent; // number of entity hit +} bsp_trace_t; +*/ +// + + +//entity info +typedef struct aas_entityinfo_s { + int valid; // true if updated this frame + int type; // entity type + int flags; // entity flags + float ltime; // local time + float update_time; // time between last and current update + int number; // number of the entity + vec3_t origin; // origin of the entity + vec3_t angles; // angles of the model + vec3_t old_origin; // for lerping + vec3_t lastvisorigin; // last visible origin + vec3_t mins; // bounding box minimums + vec3_t maxs; // bounding box maximums + int groundent; // ground entity + int solid; // solid type + int modelindex; // model used + int modelindex2; // weapons, CTF flags, etc + int frame; // model frame number + int event; // impulse events -- muzzle flashes, footsteps, etc + int eventParm; // even parameter + int powerups; // bit flags + int weapon; // determines weapon and flash model, etc + int legsAnim; // mask off ANIM_TOGGLEBIT + int torsoAnim; // mask off ANIM_TOGGLEBIT +} aas_entityinfo_t; + +// area info +typedef struct aas_areainfo_s { + int contents; + int flags; + int presencetype; + int cluster; + vec3_t mins; + vec3_t maxs; + vec3_t center; +} aas_areainfo_t; + +// client movement prediction stop events, stop as soon as: +#define SE_NONE 0 +#define SE_HITGROUND 1 // the ground is hit +#define SE_LEAVEGROUND 2 // there's no ground +#define SE_ENTERWATER 4 // water is entered +#define SE_ENTERSLIME 8 // slime is entered +#define SE_ENTERLAVA 16 // lava is entered +#define SE_HITGROUNDDAMAGE 32 // the ground is hit with damage +#define SE_GAP 64 // there's a gap +#define SE_TOUCHJUMPPAD 128 // touching a jump pad area +#define SE_TOUCHTELEPORTER 256 // touching teleporter +#define SE_ENTERAREA 512 // the given stoparea is entered +#define SE_HITGROUNDAREA 1024 // a ground face in the area is hit +#define SE_HITBOUNDINGBOX 2048 // hit the specified bounding box +#define SE_TOUCHCLUSTERPORTAL 4096 // touching a cluster portal + +typedef struct aas_clientmove_s { + vec3_t endpos; //position at the end of movement prediction + int endarea; //area at end of movement prediction + vec3_t velocity; //velocity at the end of movement prediction + aas_trace_t trace; //last trace + int presencetype; //presence type at end of movement prediction + int stopevent; //event that made the prediction stop + int endcontents; //contents at the end of movement prediction + float time; //time predicted ahead + int frames; //number of frames predicted ahead +} aas_clientmove_t; + +// alternate route goals +#define ALTROUTEGOAL_ALL 1 +#define ALTROUTEGOAL_CLUSTERPORTALS 2 +#define ALTROUTEGOAL_VIEWPORTALS 4 + +typedef struct aas_altroutegoal_s { + vec3_t origin; + int areanum; + unsigned short starttraveltime; + unsigned short goaltraveltime; + unsigned short extratraveltime; +} aas_altroutegoal_t; + +// route prediction stop events +#define RSE_NONE 0 +#define RSE_NOROUTE 1 //no route to goal +#define RSE_USETRAVELTYPE 2 //stop as soon as on of the given travel types is used +#define RSE_ENTERCONTENTS 4 //stop when entering the given contents +#define RSE_ENTERAREA 8 //stop when entering the given area + +typedef struct aas_predictroute_s { + vec3_t endpos; //position at the end of movement prediction + int endarea; //area at end of movement prediction + int stopevent; //event that made the prediction stop + int endcontents; //contents at the end of movement prediction + int endtravelflags; //end travel flags + int numareas; //number of areas predicted ahead + int time; //time predicted ahead (in hundreth of a sec) +} aas_predictroute_t; diff --git a/dlls/game/be_ai_char.h b/dlls/game/be_ai_char.h index b28801b..d0f20b7 100644 --- a/dlls/game/be_ai_char.h +++ b/dlls/game/be_ai_char.h @@ -1,32 +1,32 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// - -/***************************************************************************** - * name: be_ai_char.h - * - * desc: bot characters - * - * $Archive: /Code/DLLs/game/be_ai_char.h $ - * $Author: Jwaters $ - * $Revision: 1 $ - * $Modtime: 5/17/02 11:35a $ - * $Date: 7/31/02 10:45a $ - * - *****************************************************************************/ - -//loads a bot character from a file -int BotLoadCharacter(char *charfile, float skill); -//frees a bot character -void BotFreeCharacter(int character); -//returns a float characteristic -float Characteristic_Float(int character, int index); -//returns a bounded float characteristic -float Characteristic_BFloat(int character, int index, float min, float max); -//returns an integer characteristic -int Characteristic_Integer(int character, int index); -//returns a bounded integer characteristic -int Characteristic_BInteger(int character, int index, int min, int max); -//returns a string characteristic -void Characteristic_String(int character, int index, char *buf, int size); -//free cached bot characters -void BotShutdownCharacters(void); +// Copyright (C) 1999-2000 Id Software, Inc. +// + +/***************************************************************************** + * name: be_ai_char.h + * + * desc: bot characters + * + * $Archive: /Code/DLLs/game/be_ai_char.h $ + * $Author: Jwaters $ + * $Revision: 1 $ + * $Modtime: 5/17/02 11:35a $ + * $Date: 7/31/02 10:45a $ + * + *****************************************************************************/ + +//loads a bot character from a file +int BotLoadCharacter(char* charfile, float skill); +//frees a bot character +void BotFreeCharacter(int character); +//returns a float characteristic +float Characteristic_Float(int character, int index); +//returns a bounded float characteristic +float Characteristic_BFloat(int character, int index, float min, float max); +//returns an integer characteristic +int Characteristic_Integer(int character, int index); +//returns a bounded integer characteristic +int Characteristic_BInteger(int character, int index, int min, int max); +//returns a string characteristic +void Characteristic_String(int character, int index, char* buf, int size); +//free cached bot characters +void BotShutdownCharacters(void); diff --git a/dlls/game/be_ai_chat.h b/dlls/game/be_ai_chat.h index 13f9894..a8fe4e7 100644 --- a/dlls/game/be_ai_chat.h +++ b/dlls/game/be_ai_chat.h @@ -1,97 +1,95 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// -/***************************************************************************** - * name: be_ai_chat.h - * - * desc: char AI - * - * $Archive: /Code/DLLs/game/be_ai_chat.h $ - * $Author: Jwaters $ - * $Revision: 1 $ - * $Modtime: 5/17/02 11:35a $ - * $Date: 7/31/02 10:45a $ - * - *****************************************************************************/ - -#define MAX_MESSAGE_SIZE 256 -#define MAX_CHATTYPE_NAME 32 -#define MAX_MATCHVARIABLES 8 - -#define CHAT_GENDERLESS 0 -#define CHAT_GENDERFEMALE 1 -#define CHAT_GENDERMALE 2 - -#define CHAT_ALL 0 -#define CHAT_TEAM 1 -#define CHAT_TELL 2 - -//a console message -typedef struct bot_consolemessage_s -{ - int handle; - float time; //message time - int type; //message type - char message[MAX_MESSAGE_SIZE]; //message - struct bot_consolemessage_s *prev, *next; //prev and next in list -} bot_consolemessage_t; - -//match variable -typedef struct bot_matchvariable_s -{ - char offset; - int length; -} bot_matchvariable_t; -//returned to AI when a match is found -typedef struct bot_match_s -{ - char string[MAX_MESSAGE_SIZE]; - int type; - int subtype; - bot_matchvariable_t variables[MAX_MATCHVARIABLES]; -} bot_match_t; - -//setup the chat AI -int BotSetupChatAI(void); -//shutdown the chat AI -void BotShutdownChatAI(void); -//returns the handle to a newly allocated chat state -int BotAllocChatState(void); -//frees the chatstate -void BotFreeChatState(int handle); -//adds a console message to the chat state -void BotQueueConsoleMessage(int chatstate, int type, char *message); -//removes the console message from the chat state -void BotRemoveConsoleMessage(int chatstate, int handle); -//returns the next console message from the state -int BotNextConsoleMessage(int chatstate, bot_consolemessage_t *cm); -//returns the number of console messages currently stored in the state -int BotNumConsoleMessages(int chatstate); -//selects a chat message of the given type -void BotInitialChat(int chatstate, char *type, int mcontext, char *var0, char *var1, char *var2, char *var3, char *var4, char *var5, char *var6, char *var7); -//returns the number of initial chat messages of the given type -int BotNumInitialChats(int chatstate, char *type); -//find and select a reply for the given message -int BotReplyChat(int chatstate, char *message, int mcontext, int vcontext, char *var0, char *var1, char *var2, char *var3, char *var4, char *var5, char *var6, char *var7); -//returns the length of the currently selected chat message -int BotChatLength(int chatstate); -//enters the selected chat message -void BotEnterChat(int chatstate, int clientto, int sendto); -//get the chat message ready to be output -void BotGetChatMessage(int chatstate, char *buf, int size); -//checks if the first string contains the second one, returns index into first string or -1 if not found -int StringContains(char *str1, char *str2, int casesensitive); -//finds a match for the given string using the match templates -int BotFindMatch(char *str, bot_match_t *match, unsigned long int context); -//returns a variable from a match -void BotMatchVariable(bot_match_t *match, int variable, char *buf, int size); -//unify all the white spaces in the string -void UnifyWhiteSpaces(char *string); -//replace all the context related synonyms in the string -void BotReplaceSynonyms(char *string, unsigned long int context); -//loads a chat file for the chat state -int BotLoadChatFile(int chatstate, char *chatfile, char *chatname); -//store the gender of the bot in the chat state -void BotSetChatGender(int chatstate, int gender); -//store the bot name in the chat state -void BotSetChatName(int chatstate, char *name, int client); - +// Copyright (C) 1999-2000 Id Software, Inc. +// +/***************************************************************************** + * name: be_ai_chat.h + * + * desc: char AI + * + * $Archive: /Code/DLLs/game/be_ai_chat.h $ + * $Author: Jwaters $ + * $Revision: 1 $ + * $Modtime: 5/17/02 11:35a $ + * $Date: 7/31/02 10:45a $ + * + *****************************************************************************/ + +#define MAX_MESSAGE_SIZE 256 +#define MAX_CHATTYPE_NAME 32 +#define MAX_MATCHVARIABLES 8 + +#define CHAT_GENDERLESS 0 +#define CHAT_GENDERFEMALE 1 +#define CHAT_GENDERMALE 2 + +#define CHAT_ALL 0 +#define CHAT_TEAM 1 +#define CHAT_TELL 2 + +//a console message +typedef struct bot_consolemessage_s { + int handle; + float time; //message time + int type; //message type + char message[MAX_MESSAGE_SIZE]; //message + struct bot_consolemessage_s* prev; // prev in list + struct bot_consolemessage_s* next; // next in list +} bot_consolemessage_t; + +//match variable +typedef struct bot_matchvariable_s { + char offset; + int length; +} bot_matchvariable_t; +//returned to AI when a match is found +typedef struct bot_match_s { + char string[MAX_MESSAGE_SIZE]; + int type; + int subtype; + bot_matchvariable_t variables[MAX_MATCHVARIABLES]; +} bot_match_t; + +//setup the chat AI +int BotSetupChatAI(void); +//shutdown the chat AI +void BotShutdownChatAI(void); +//returns the handle to a newly allocated chat state +int BotAllocChatState(void); +//frees the chatstate +void BotFreeChatState(int handle); +//adds a console message to the chat state +void BotQueueConsoleMessage(int chatstate, int type, char* message); +//removes the console message from the chat state +void BotRemoveConsoleMessage(int chatstate, int handle); +//returns the next console message from the state +int BotNextConsoleMessage(int chatstate, bot_consolemessage_t* cm); +//returns the number of console messages currently stored in the state +int BotNumConsoleMessages(int chatstate); +//selects a chat message of the given type +void BotInitialChat(int chatstate, char* type, int mcontext, char* var0, char* var1, char* var2, char* var3, char* var4, char* var5, char* var6, char* var7); +//returns the number of initial chat messages of the given type +int BotNumInitialChats(int chatstate, char* type); +//find and select a reply for the given message +int BotReplyChat(int chatstate, char* message, int mcontext, int vcontext, char* var0, char* var1, char* var2, char* var3, char* var4, char* var5, char* var6, char* var7); +//returns the length of the currently selected chat message +int BotChatLength(int chatstate); +//enters the selected chat message +void BotEnterChat(int chatstate, int clientto, int sendto); +//get the chat message ready to be output +void BotGetChatMessage(int chatstate, char* buf, int size); +//checks if the first string contains the second one, returns index into first string or -1 if not found +int StringContains(char* str1, char* str2, int casesensitive); +//finds a match for the given string using the match templates +int BotFindMatch(char* str, bot_match_t* match, unsigned long int context); +//returns a variable from a match +void BotMatchVariable(bot_match_t* match, int variable, char* buf, int size); +//unify all the white spaces in the string +void UnifyWhiteSpaces(char* string); +//replace all the context related synonyms in the string +void BotReplaceSynonyms(char* string, unsigned long int context); +//loads a chat file for the chat state +int BotLoadChatFile(int chatstate, char* chatfile, char* chatname); +//store the gender of the bot in the chat state +void BotSetChatGender(int chatstate, int gender); +//store the bot name in the chat state +void BotSetChatName(int chatstate, char* name, int client); + diff --git a/dlls/game/be_ai_gen.h b/dlls/game/be_ai_gen.h index 8f0a8e2..0d6727e 100644 --- a/dlls/game/be_ai_gen.h +++ b/dlls/game/be_ai_gen.h @@ -1,17 +1,17 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// - -/***************************************************************************** - * name: be_ai_gen.h - * - * desc: genetic selection - * - * $Archive: /Code/DLLs/game/be_ai_gen.h $ - * $Author: Jwaters $ - * $Revision: 1 $ - * $Modtime: 5/17/02 11:35a $ - * $Date: 7/31/02 10:45a $ - * - *****************************************************************************/ - -int GeneticParentsAndChildSelection(int numranks, float *ranks, int *parent1, int *parent2, int *child); +// Copyright (C) 1999-2000 Id Software, Inc. +// + +/***************************************************************************** + * name: be_ai_gen.h + * + * desc: genetic selection + * + * $Archive: /Code/DLLs/game/be_ai_gen.h $ + * $Author: Jwaters $ + * $Revision: 1 $ + * $Modtime: 5/17/02 11:35a $ + * $Date: 7/31/02 10:45a $ + * + *****************************************************************************/ + +int GeneticParentsAndChildSelection(int numranks, float* ranks, int* parent1, int* parent2, int* child); diff --git a/dlls/game/be_ai_goal.h b/dlls/game/be_ai_goal.h index cd64e0d..7d68653 100644 --- a/dlls/game/be_ai_goal.h +++ b/dlls/game/be_ai_goal.h @@ -1,102 +1,101 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// -/***************************************************************************** - * name: be_ai_goal.h - * - * desc: goal AI - * - * $Archive: /Code/DLLs/game/be_ai_goal.h $ - * $Author: Jwaters $ - * $Revision: 1 $ - * $Modtime: 5/17/02 11:35a $ - * $Date: 7/31/02 10:45a $ - * - *****************************************************************************/ - -#define MAX_AVOIDGOALS 256 -#define MAX_GOALSTACK 8 - -#define GFL_NONE 0 -#define GFL_ITEM 1 -#define GFL_ROAM 2 -#define GFL_DROPPED 4 - -//a bot goal -typedef struct bot_goal_s -{ - vec3_t origin; //origin of the goal - int areanum; //area number of the goal - vec3_t mins, maxs; //mins and maxs of the goal - int entitynum; //number of the goal entity - int number; //goal number - int flags; //goal flags - int iteminfo; //item information -} bot_goal_t; - -//reset the whole goal state, but keep the item weights -void BotResetGoalState(int goalstate); -//reset avoid goals -void BotResetAvoidGoals(int goalstate); -//remove the goal with the given number from the avoid goals -void BotRemoveFromAvoidGoals(int goalstate, int number); -//push a goal onto the goal stack -void BotPushGoal(int goalstate, bot_goal_t *goal); -//pop a goal from the goal stack -void BotPopGoal(int goalstate); -//empty the bot's goal stack -void BotEmptyGoalStack(int goalstate); -//dump the avoid goals -void BotDumpAvoidGoals(int goalstate); -//dump the goal stack -void BotDumpGoalStack(int goalstate); -//get the name name of the goal with the given number -void BotGoalName(int number, char *name, int size); -//get the top goal from the stack -int BotGetTopGoal(int goalstate, bot_goal_t *goal); -//get the second goal on the stack -int BotGetSecondGoal(int goalstate, bot_goal_t *goal); -//choose the best long term goal item for the bot -int BotChooseLTGItem(int goalstate, vec3_t origin, int *inventory, int travelflags); -//choose the best nearby goal item for the bot -//the item may not be further away from the current bot position than maxtime -//also the travel time from the nearby goal towards the long term goal may not -//be larger than the travel time towards the long term goal from the current bot position -int BotChooseNBGItem(int goalstate, vec3_t origin, int *inventory, int travelflags, - bot_goal_t *ltg, float maxtime); -//returns true if the bot touches the goal -int BotTouchingGoal(vec3_t origin, bot_goal_t *goal); -//returns true if the goal should be visible but isn't -int BotItemGoalInVisButNotVisible(int viewer, vec3_t eye, vec3_t viewangles, bot_goal_t *goal); -//search for a goal for the given classname, the index can be used -//as a start point for the search when multiple goals are available with that same classname -int BotGetLevelItemGoal(int index, char *classname, bot_goal_t *goal); -//get the next camp spot in the map -int BotGetNextCampSpotGoal(int num, bot_goal_t *goal); -//get the map location with the given name -int BotGetMapLocationGoal(char *name, bot_goal_t *goal); -//returns the avoid goal time -float BotAvoidGoalTime(int goalstate, int number); -//set the avoid goal time -void BotSetAvoidGoalTime(int goalstate, int number, float avoidtime); -//initializes the items in the level -void BotInitLevelItems(void); -//regularly update dynamic entity items (dropped weapons, flags etc.) -void BotUpdateEntityItems(void); -//interbreed the goal fuzzy logic -void BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child); -//save the goal fuzzy logic to disk -void BotSaveGoalFuzzyLogic(int goalstate, char *filename); -//mutate the goal fuzzy logic -void BotMutateGoalFuzzyLogic(int goalstate, float range); -//loads item weights for the bot -int BotLoadItemWeights(int goalstate, char *filename); -//frees the item weights of the bot -void BotFreeItemWeights(int goalstate); -//returns the handle of a newly allocated goal state -int BotAllocGoalState(int client); -//free the given goal state -void BotFreeGoalState(int handle); -//setup the goal AI -int BotSetupGoalAI(void); -//shut down the goal AI -void BotShutdownGoalAI(void); +// Copyright (C) 1999-2000 Id Software, Inc. +// +/***************************************************************************** + * name: be_ai_goal.h + * + * desc: goal AI + * + * $Archive: /Code/DLLs/game/be_ai_goal.h $ + * $Author: Jwaters $ + * $Revision: 1 $ + * $Modtime: 5/17/02 11:35a $ + * $Date: 7/31/02 10:45a $ + * + *****************************************************************************/ + +#define MAX_AVOIDGOALS 256 +#define MAX_GOALSTACK 8 + +#define GFL_NONE 0 +#define GFL_ITEM 1 +#define GFL_ROAM 2 +#define GFL_DROPPED 4 + +//a bot goal +typedef struct bot_goal_s { + vec3_t origin; //origin of the goal + int areanum; //area number of the goal + vec3_t mins, maxs; //mins and maxs of the goal + int entitynum; //number of the goal entity + int number; //goal number + int flags; //goal flags + int iteminfo; //item information +} bot_goal_t; + +//reset the whole goal state, but keep the item weights +void BotResetGoalState(int goalstate); +//reset avoid goals +void BotResetAvoidGoals(int goalstate); +//remove the goal with the given number from the avoid goals +void BotRemoveFromAvoidGoals(int goalstate, int number); +//push a goal onto the goal stack +void BotPushGoal(int goalstate, bot_goal_t* goal); +//pop a goal from the goal stack +void BotPopGoal(int goalstate); +//empty the bot's goal stack +void BotEmptyGoalStack(int goalstate); +//dump the avoid goals +void BotDumpAvoidGoals(int goalstate); +//dump the goal stack +void BotDumpGoalStack(int goalstate); +//get the name name of the goal with the given number +void BotGoalName(int number, char* name, int size); +//get the top goal from the stack +int BotGetTopGoal(int goalstate, bot_goal_t* goal); +//get the second goal on the stack +int BotGetSecondGoal(int goalstate, bot_goal_t* goal); +//choose the best long term goal item for the bot +int BotChooseLTGItem(int goalstate, vec3_t origin, int* inventory, int travelflags); +//choose the best nearby goal item for the bot +//the item may not be further away from the current bot position than maxtime +//also the travel time from the nearby goal towards the long term goal may not +//be larger than the travel time towards the long term goal from the current bot position +int BotChooseNBGItem(int goalstate, vec3_t origin, int* inventory, int travelflags, + bot_goal_t* ltg, float maxtime); +//returns true if the bot touches the goal +int BotTouchingGoal(vec3_t origin, bot_goal_t* goal); +//returns true if the goal should be visible but isn't +int BotItemGoalInVisButNotVisible(int viewer, vec3_t eye, vec3_t viewangles, bot_goal_t* goal); +//search for a goal for the given classname, the index can be used +//as a start point for the search when multiple goals are available with that same classname +int BotGetLevelItemGoal(int index, char* classname, bot_goal_t* goal); +//get the next camp spot in the map +int BotGetNextCampSpotGoal(int num, bot_goal_t* goal); +//get the map location with the given name +int BotGetMapLocationGoal(char* name, bot_goal_t* goal); +//returns the avoid goal time +float BotAvoidGoalTime(int goalstate, int number); +//set the avoid goal time +void BotSetAvoidGoalTime(int goalstate, int number, float avoidtime); +//initializes the items in the level +void BotInitLevelItems(void); +//regularly update dynamic entity items (dropped weapons, flags etc.) +void BotUpdateEntityItems(void); +//interbreed the goal fuzzy logic +void BotInterbreedGoalFuzzyLogic(int parent1, int parent2, int child); +//save the goal fuzzy logic to disk +void BotSaveGoalFuzzyLogic(int goalstate, char* filename); +//mutate the goal fuzzy logic +void BotMutateGoalFuzzyLogic(int goalstate, float range); +//loads item weights for the bot +int BotLoadItemWeights(int goalstate, char* filename); +//frees the item weights of the bot +void BotFreeItemWeights(int goalstate); +//returns the handle of a newly allocated goal state +int BotAllocGoalState(int client); +//free the given goal state +void BotFreeGoalState(int handle); +//setup the goal AI +int BotSetupGoalAI(void); +//shut down the goal AI +void BotShutdownGoalAI(void); diff --git a/dlls/game/be_ai_move.h b/dlls/game/be_ai_move.h index 253ea4c..be1a3c9 100644 --- a/dlls/game/be_ai_move.h +++ b/dlls/game/be_ai_move.h @@ -1,126 +1,123 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// - -/***************************************************************************** - * name: be_ai_move.h - * - * desc: movement AI - * - * $Archive: /Code/DLLs/game/be_ai_move.h $ - * $Author: Jwaters $ - * $Revision: 1 $ - * $Modtime: 5/17/02 11:35a $ - * $Date: 7/31/02 10:45a $ - * - *****************************************************************************/ - -//movement types -#define MOVE_WALK 1 -#define MOVE_CROUCH 2 -#define MOVE_JUMP 4 -#define MOVE_GRAPPLE 8 -#define MOVE_ROCKETJUMP 16 -#define MOVE_BFGJUMP 32 -//move flags -#define MFL_BARRIERJUMP 1 //bot is performing a barrier jump -#define MFL_ONGROUND 2 //bot is in the ground -#define MFL_SWIMMING 4 //bot is swimming -#define MFL_AGAINSTLADDER 8 //bot is against a ladder -#define MFL_WATERJUMP 16 //bot is waterjumping -#define MFL_TELEPORTED 32 //bot is being teleported -#define MFL_GRAPPLEPULL 64 //bot is being pulled by the grapple -#define MFL_ACTIVEGRAPPLE 128 //bot is using the grapple hook -#define MFL_GRAPPLERESET 256 //bot has reset the grapple -#define MFL_WALK 512 //bot should walk slowly -// move result flags -#define MOVERESULT_MOVEMENTVIEW 1 //bot uses view for movement -#define MOVERESULT_SWIMVIEW 2 //bot uses view for swimming -#define MOVERESULT_WAITING 4 //bot is waiting for something -#define MOVERESULT_MOVEMENTVIEWSET 8 //bot has set the view in movement code -#define MOVERESULT_MOVEMENTWEAPON 16 //bot uses weapon for movement -#define MOVERESULT_ONTOPOFOBSTACLE 32 //bot is ontop of obstacle -#define MOVERESULT_ONTOPOF_FUNCBOB 64 //bot is ontop of a func_bobbing -#define MOVERESULT_ONTOPOF_ELEVATOR 128 //bot is ontop of an elevator (func_plat) -#define MOVERESULT_BLOCKEDBYAVOIDSPOT 256 //bot is blocked by an avoid spot -// -#define MAX_AVOIDREACH 1 -#define MAX_AVOIDSPOTS 32 -// avoid spot types -#define AVOID_CLEAR 0 //clear all avoid spots -#define AVOID_ALWAYS 1 //avoid always -#define AVOID_DONTBLOCK 2 //never totally block -// restult types -#define RESULTTYPE_ELEVATORUP 1 //elevator is up -#define RESULTTYPE_WAITFORFUNCBOBBING 2 //waiting for func bobbing to arrive -#define RESULTTYPE_BADGRAPPLEPATH 4 //grapple path is obstructed -#define RESULTTYPE_INSOLIDAREA 8 //stuck in solid area, this is bad - -//structure used to initialize the movement state -//the or_moveflags MFL_ONGROUND, MFL_TELEPORTED and MFL_WATERJUMP come from the playerstate -typedef struct bot_initmove_s -{ - vec3_t origin; //origin of the bot - vec3_t velocity; //velocity of the bot - vec3_t viewoffset; //view offset - int entitynum; //entity number of the bot - int client; //client number of the bot - float thinktime; //time the bot thinks - int presencetype; //presencetype of the bot - vec3_t viewangles; //view angles of the bot - int or_moveflags; //values ored to the movement flags -} bot_initmove_t; - -//NOTE: the ideal_viewangles are only valid if MFL_MOVEMENTVIEW is set -typedef struct bot_moveresult_s -{ - int failure; //true if movement failed all together - int type; //failure or blocked type - int blocked; //true if blocked by an entity - int blockentity; //entity blocking the bot - int traveltype; //last executed travel type - int flags; //result flags - int weapon; //weapon used for movement - vec3_t movedir; //movement direction - vec3_t ideal_viewangles; //ideal viewangles for the movement -} bot_moveresult_t; - -// bk001204: from code/botlib/be_ai_move.c -// TTimo 04/12/2001 was moved here to avoid dup defines -typedef struct bot_avoidspot_s -{ - vec3_t origin; - float radius; - int type; -} bot_avoidspot_t; - -//resets the whole move state -void BotResetMoveState(int movestate); -//moves the bot to the given goal -void BotMoveToGoal(bot_moveresult_t *result, int movestate, bot_goal_t *goal, int travelflags); -//moves the bot in the specified direction using the specified type of movement -int BotMoveInDirection(int movestate, vec3_t dir, float speed, int type); -//reset avoid reachability -void BotResetAvoidReach(int movestate); -//resets the last avoid reachability -void BotResetLastAvoidReach(int movestate); -//returns a reachability area if the origin is in one -int BotReachabilityArea(vec3_t origin, int client); -//view target based on movement -int BotMovementViewTarget(int movestate, bot_goal_t *goal, int travelflags, float lookahead, vec3_t target); -//predict the position of a player based on movement towards a goal -int BotPredictVisiblePosition(vec3_t origin, int areanum, bot_goal_t *goal, int travelflags, vec3_t target); -//returns the handle of a newly allocated movestate -int BotAllocMoveState(void); -//frees the movestate with the given handle -void BotFreeMoveState(int handle); -//initialize movement state before performing any movement -void BotInitMoveState(int handle, bot_initmove_t *initmove); -//add a spot to avoid (if type == AVOID_CLEAR all spots are removed) -void BotAddAvoidSpot(int movestate, vec3_t origin, float radius, int type); -//must be called every map change -void BotSetBrushModelTypes(void); -//setup movement AI -int BotSetupMoveAI(void); -//shutdown movement AI -void BotShutdownMoveAI(void); - +// Copyright (C) 1999-2000 Id Software, Inc. +// + +/***************************************************************************** + * name: be_ai_move.h + * + * desc: movement AI + * + * $Archive: /Code/DLLs/game/be_ai_move.h $ + * $Author: Jwaters $ + * $Revision: 1 $ + * $Modtime: 5/17/02 11:35a $ + * $Date: 7/31/02 10:45a $ + * + *****************************************************************************/ + +//movement types +#define MOVE_WALK 1 +#define MOVE_CROUCH 2 +#define MOVE_JUMP 4 +#define MOVE_GRAPPLE 8 +#define MOVE_ROCKETJUMP 16 +#define MOVE_BFGJUMP 32 +//move flags +#define MFL_BARRIERJUMP 1 //bot is performing a barrier jump +#define MFL_ONGROUND 2 //bot is in the ground +#define MFL_SWIMMING 4 //bot is swimming +#define MFL_AGAINSTLADDER 8 //bot is against a ladder +#define MFL_WATERJUMP 16 //bot is waterjumping +#define MFL_TELEPORTED 32 //bot is being teleported +#define MFL_GRAPPLEPULL 64 //bot is being pulled by the grapple +#define MFL_ACTIVEGRAPPLE 128 //bot is using the grapple hook +#define MFL_GRAPPLERESET 256 //bot has reset the grapple +#define MFL_WALK 512 //bot should walk slowly +// move result flags +#define MOVERESULT_MOVEMENTVIEW 1 //bot uses view for movement +#define MOVERESULT_SWIMVIEW 2 //bot uses view for swimming +#define MOVERESULT_WAITING 4 //bot is waiting for something +#define MOVERESULT_MOVEMENTVIEWSET 8 //bot has set the view in movement code +#define MOVERESULT_MOVEMENTWEAPON 16 //bot uses weapon for movement +#define MOVERESULT_ONTOPOFOBSTACLE 32 //bot is ontop of obstacle +#define MOVERESULT_ONTOPOF_FUNCBOB 64 //bot is ontop of a func_bobbing +#define MOVERESULT_ONTOPOF_ELEVATOR 128 //bot is ontop of an elevator (func_plat) +#define MOVERESULT_BLOCKEDBYAVOIDSPOT 256 //bot is blocked by an avoid spot +// +#define MAX_AVOIDREACH 1 +#define MAX_AVOIDSPOTS 32 +// avoid spot types +#define AVOID_CLEAR 0 //clear all avoid spots +#define AVOID_ALWAYS 1 //avoid always +#define AVOID_DONTBLOCK 2 //never totally block +// restult types +#define RESULTTYPE_ELEVATORUP 1 //elevator is up +#define RESULTTYPE_WAITFORFUNCBOBBING 2 //waiting for func bobbing to arrive +#define RESULTTYPE_BADGRAPPLEPATH 4 //grapple path is obstructed +#define RESULTTYPE_INSOLIDAREA 8 //stuck in solid area, this is bad + +//structure used to initialize the movement state +//the or_moveflags MFL_ONGROUND, MFL_TELEPORTED and MFL_WATERJUMP come from the playerstate +typedef struct bot_initmove_s { + vec3_t origin; //origin of the bot + vec3_t velocity; //velocity of the bot + vec3_t viewoffset; //view offset + int entitynum; //entity number of the bot + int client; //client number of the bot + float thinktime; //time the bot thinks + int presencetype; //presencetype of the bot + vec3_t viewangles; //view angles of the bot + int or_moveflags; //values ored to the movement flags +} bot_initmove_t; + +//NOTE: the ideal_viewangles are only valid if MFL_MOVEMENTVIEW is set +typedef struct bot_moveresult_s { + int failure; //true if movement failed all together + int type; //failure or blocked type + int blocked; //true if blocked by an entity + int blockentity; //entity blocking the bot + int traveltype; //last executed travel type + int flags; //result flags + int weapon; //weapon used for movement + vec3_t movedir; //movement direction + vec3_t ideal_viewangles; //ideal viewangles for the movement +} bot_moveresult_t; + +// bk001204: from code/botlib/be_ai_move.c +// TTimo 04/12/2001 was moved here to avoid dup defines +typedef struct bot_avoidspot_s { + vec3_t origin; + float radius; + int type; +} bot_avoidspot_t; + +//resets the whole move state +void BotResetMoveState(int movestate); +//moves the bot to the given goal +void BotMoveToGoal(bot_moveresult_t* result, int movestate, bot_goal_t* goal, int travelflags); +//moves the bot in the specified direction using the specified type of movement +int BotMoveInDirection(int movestate, vec3_t dir, float speed, int type); +//reset avoid reachability +void BotResetAvoidReach(int movestate); +//resets the last avoid reachability +void BotResetLastAvoidReach(int movestate); +//returns a reachability area if the origin is in one +int BotReachabilityArea(vec3_t origin, int client); +//view target based on movement +int BotMovementViewTarget(int movestate, bot_goal_t* goal, int travelflags, float lookahead, vec3_t target); +//predict the position of a player based on movement towards a goal +int BotPredictVisiblePosition(vec3_t origin, int areanum, bot_goal_t* goal, int travelflags, vec3_t target); +//returns the handle of a newly allocated movestate +int BotAllocMoveState(void); +//frees the movestate with the given handle +void BotFreeMoveState(int handle); +//initialize movement state before performing any movement +void BotInitMoveState(int handle, bot_initmove_t* initmove); +//add a spot to avoid (if type == AVOID_CLEAR all spots are removed) +void BotAddAvoidSpot(int movestate, vec3_t origin, float radius, int type); +//must be called every map change +void BotSetBrushModelTypes(void); +//setup movement AI +int BotSetupMoveAI(void); +//shutdown movement AI +void BotShutdownMoveAI(void); + diff --git a/dlls/game/be_ai_weap.h b/dlls/game/be_ai_weap.h index e6a3df7..169e701 100644 --- a/dlls/game/be_ai_weap.h +++ b/dlls/game/be_ai_weap.h @@ -1,90 +1,88 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// - -/***************************************************************************** - * name: be_ai_weap.h - * - * desc: weapon AI - * - * $Archive: /Code/DLLs/game/be_ai_weap.h $ - * $Author: Jwaters $ - * $Revision: 4 $ - * $Modtime: 8/19/02 3:51p $ - * $Date: 8/19/02 4:08p $ - * - *****************************************************************************/ - -//projectile flags -#define PFL_WINDOWDAMAGE 1 //projectile damages through window -#define PFL_RETURN 2 //set when projectile returns to owner -//weapon flags -#define WFL_FIRERELEASED 1 //set when projectile is fired with key-up event -//damage types -#define DAMAGETYPE_IMPACT 1 //damage on impact -#define DAMAGETYPE_RADIAL 2 //radial damage -#define DAMAGETYPE_VISIBLE 4 //damage to all entities visible to the projectile - -typedef struct projectileinfo_s -{ - char name[MAX_STRINGFIELD]; - char model[MAX_STRINGFIELD]; - int flags; - float gravity; - int damage; - float radius; - int visdamage; - int damagetype; - int healthinc; - float push; - float detonation; - float bounce; - float bouncefric; - float bouncestop; -} projectileinfo_t; - -typedef struct weaponinfo_s -{ - int valid; //true if the weapon info is valid - int number; //number of the weapon - char name[MAX_STRINGFIELD]; - char model[MAX_STRINGFIELD]; - int level; - int weaponindex; - int flags; - char projectile[MAX_STRINGFIELD]; - int numprojectiles; - float hspread; - float vspread; - float speed; - float acceleration; - vec3_t recoil; - vec3_t offset; - vec3_t angleoffset; - float extrazvelocity; - int ammoamount; - int ammoindex; - float activate; - float reload; - float spinup; - float spindown; - int primarydangerous; // if primary and/or alternate fire are REALLY DANGEROUS - int altdangerous; - projectileinfo_t proj; //pointer to the used projectile -} weaponinfo_t; - -//setup the weapon AI -int BotSetupWeaponAI(void); -//shut down the weapon AI -void BotShutdownWeaponAI(void); -//returns the best weapon to fight with -int BotChooseBestFightWeapon(int weaponstate, int *inventory); -//returns the information of the current weapon -void BotGetWeaponInfo(int weaponstate, int weapon, weaponinfo_t *weaponinfo); -//loads the weapon weights -int BotLoadWeaponWeights(int weaponstate, char *filename); -//returns a handle to a newly allocated weapon state -int BotAllocWeaponState(void); -//frees the weapon state -void BotFreeWeaponState(int weaponstate); -//resets the whole weapon state -void BotResetWeaponState(int weaponstate); +// Copyright (C) 1999-2000 Id Software, Inc. +// + +/***************************************************************************** + * name: be_ai_weap.h + * + * desc: weapon AI + * + * $Archive: /Code/DLLs/game/be_ai_weap.h $ + * $Author: Jwaters $ + * $Revision: 4 $ + * $Modtime: 8/19/02 3:51p $ + * $Date: 8/19/02 4:08p $ + * + *****************************************************************************/ + +//projectile flags +#define PFL_WINDOWDAMAGE 1 //projectile damages through window +#define PFL_RETURN 2 //set when projectile returns to owner +//weapon flags +#define WFL_FIRERELEASED 1 //set when projectile is fired with key-up event +//damage types +#define DAMAGETYPE_IMPACT 1 //damage on impact +#define DAMAGETYPE_RADIAL 2 //radial damage +#define DAMAGETYPE_VISIBLE 4 //damage to all entities visible to the projectile + +typedef struct projectileinfo_s { + char name[MAX_STRINGFIELD]; + char model[MAX_STRINGFIELD]; + int flags; + float gravity; + int damage; + float radius; + int visdamage; + int damagetype; + int healthinc; + float push; + float detonation; + float bounce; + float bouncefric; + float bouncestop; +} projectileinfo_t; + +typedef struct weaponinfo_s { + int valid; //true if the weapon info is valid + int number; //number of the weapon + char name[MAX_STRINGFIELD]; + char model[MAX_STRINGFIELD]; + int level; + int weaponindex; + int flags; + char projectile[MAX_STRINGFIELD]; + int numprojectiles; + float hspread; + float vspread; + float speed; + float acceleration; + vec3_t recoil; + vec3_t offset; + vec3_t angleoffset; + float extrazvelocity; + int ammoamount; + int ammoindex; + float activate; + float reload; + float spinup; + float spindown; + int primarydangerous; // if primary and/or alternate fire are REALLY DANGEROUS + int altdangerous; + projectileinfo_t proj; //pointer to the used projectile +} weaponinfo_t; + +//setup the weapon AI +int BotSetupWeaponAI(void); +//shut down the weapon AI +void BotShutdownWeaponAI(void); +//returns the best weapon to fight with +int BotChooseBestFightWeapon(int weaponstate, int* inventory); +//returns the information of the current weapon +void BotGetWeaponInfo(int weaponstate, int weapon, weaponinfo_t* weaponinfo); +//loads the weapon weights +int BotLoadWeaponWeights(int weaponstate, char* filename); +//returns a handle to a newly allocated weapon state +int BotAllocWeaponState(void); +//frees the weapon state +void BotFreeWeaponState(int weaponstate); +//resets the whole weapon state +void BotResetWeaponState(int weaponstate); diff --git a/dlls/game/botlib.h b/dlls/game/botlib.h index c49455a..3b5b3fb 100644 --- a/dlls/game/botlib.h +++ b/dlls/game/botlib.h @@ -1,506 +1,497 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// -/***************************************************************************** - * name: botlib.h - * - * desc: bot AI library - * - * $Archive: /EF2/Code/DLLs/game/botlib.h $ - * $Author: Singlis $ - * $Revision: 5 $ - * $Modtime: 9/24/03 3:09p $ - * $Date: 9/26/03 2:35p $ - * - *****************************************************************************/ - -#ifndef __BOTLIB_H__ -#define __BOTLIB_H__ - -#define BOTLIB_API_VERSION 2 - -struct aas_clientmove_s; -struct aas_entityinfo_s; -struct aas_areainfo_s; -struct aas_altroutegoal_s; -struct aas_predictroute_s; -struct bot_consolemessage_s; -struct bot_match_s; -struct bot_goal_s; -struct bot_moveresult_s; -struct bot_initmove_s; -struct weaponinfo_s; - -#define BOTFILESBASEFOLDER "botfiles" -//debug line colors -#define LINECOLOR_NONE -1 -#define LINECOLOR_RED 1//0xf2f2f0f0L -#define LINECOLOR_GREEN 2//0xd0d1d2d3L -#define LINECOLOR_BLUE 3//0xf3f3f1f1L -#define LINECOLOR_YELLOW 4//0xdcdddedfL -#define LINECOLOR_ORANGE 5//0xe0e1e2e3L - -//Print types -#define PRT_MESSAGE 1 -#define PRT_WARNING 2 -#define PRT_ERROR 3 -#define PRT_FATAL 4 -#define PRT_EXIT 5 - -//console message types -#define CMS_NORMAL 0 -#define CMS_CHAT 1 - -//botlib error codes -#define BLERR_NOERROR 0 //no error -#define BLERR_LIBRARYNOTSETUP 1 //library not setup -#define BLERR_INVALIDENTITYNUMBER 2 //invalid entity number -#define BLERR_NOAASFILE 3 //no AAS file available -#define BLERR_CANNOTOPENAASFILE 4 //cannot open AAS file -#define BLERR_WRONGAASFILEID 5 //incorrect AAS file id -#define BLERR_WRONGAASFILEVERSION 6 //incorrect AAS file version -#define BLERR_CANNOTREADAASLUMP 7 //cannot read AAS file lump -#define BLERR_CANNOTLOADICHAT 8 //cannot load initial chats -#define BLERR_CANNOTLOADITEMWEIGHTS 9 //cannot load item weights -#define BLERR_CANNOTLOADITEMCONFIG 10 //cannot load item config -#define BLERR_CANNOTLOADWEAPONWEIGHTS 11 //cannot load weapon weights -#define BLERR_CANNOTLOADWEAPONCONFIG 12 //cannot load weapon config - -//action flags -#define ACTION_ATTACK 0x0000001 -#define ACTION_ATTACKRIGHT 0x0000002 -#define ACTION_USE 0x0000004 -#define ACTION_RESPAWN 0x0000008 -#define ACTION_JUMP 0x0000010 -#define ACTION_MOVEUP 0x0000020 -#define ACTION_CROUCH 0x0000080 -#define ACTION_MOVEDOWN 0x0000100 -#define ACTION_MOVEFORWARD 0x0000200 -#define ACTION_MOVEBACK 0x0000800 -#define ACTION_MOVELEFT 0x0001000 -#define ACTION_MOVERIGHT 0x0002000 -#define ACTION_DELAYEDJUMP 0x0008000 -#define ACTION_TALK 0x0010000 -#define ACTION_GESTURE 0x0020000 -#define ACTION_WALK 0x0080000 -#define ACTION_AFFIRMATIVE 0x0100000 -#define ACTION_NEGATIVE 0x0200000 -#define ACTION_GETFLAG 0x0800000 -#define ACTION_GUARDBASE 0x1000000 -#define ACTION_PATROL 0x2000000 -#define ACTION_FOLLOWME 0x8000000 - -//the bot input, will be converted to an usercmd_t -typedef struct bot_input_s -{ - float thinktime; //time since last output (in seconds) - vec3_t dir; //movement direction - float speed; //speed in the range [0, 400] - vec3_t viewangles; //the view angles - int actionflags; //one of the ACTION_? flags - int weapon,latchweapon; //weapon to use - int firestate; //right/left hand fire state -} bot_input_t; - -#ifndef BSPTRACE - -#define BSPTRACE - -//bsp_trace_t hit surface -typedef struct bsp_surface_s -{ - char name[16]; - int flags; - int value; -} bsp_surface_t; - -//remove the bsp_trace_s structure definition l8r on -//a trace is returned when a box is swept through the world -typedef struct bsp_trace_s -{ - qboolean allsolid; // if true, plane is not valid - qboolean startsolid; // if true, the initial point was in a solid area - float fraction; // time completed, 1.0 = didn't hit anything - vec3_t endpos; // final position - cplane_t plane; // surface normal at impact - float exp_dist; // expanded plane distance - int sidenum; // number of the brush side hit - bsp_surface_t surface; // the hit point surface - int contents; // contents on other side of surface hit - int ent; // number of entity hit -} bsp_trace_t; - -#endif // BSPTRACE - -//entity state -typedef struct bot_entitystate_s -{ - int type; // entity type - int flags; // entity flags - vec3_t origin; // origin of the entity - vec3_t angles; // angles of the model - vec3_t old_origin; // for lerping - vec3_t mins; // bounding box minimums - vec3_t maxs; // bounding box maximums - int groundent; // ground entity - int solid; // solid type - int modelindex; // model used - int modelindex2; // weapons, CTF flags, etc - int frame; // model frame number - int event; // impulse events -- muzzle flashes, footsteps, etc - int eventParm; // even parameter - int powerups; // bit flags - int weapon; // determines weapon and flash model, etc - int legsAnim; // mask off ANIM_TOGGLEBIT - int torsoAnim; // mask off ANIM_TOGGLEBIT -} bot_entitystate_t; - -//bot AI library exported functions -typedef struct botlib_import_s -{ - //print messages from the bot library - void (QDECL *Print)(int type, char *fmt, ...); - //trace a bbox through the world - void (*Trace)(bsp_trace_t *trace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int passent, int contentmask); - //trace a bbox against a specific entity - void (*EntityTrace)(bsp_trace_t *trace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int entnum, int contentmask); - //retrieve the contents at the given point - int (*PointContents)(vec3_t point); - //check if the point is in potential visible sight - int (*inPVS)(vec3_t p1, vec3_t p2); - //retrieve the BSP entity data lump - char *(*BSPEntityData)(void); - // - void (*BSPModelMinsMaxsOrigin)(int modelnum, vec3_t angles, vec3_t mins, vec3_t maxs, vec3_t origin); - //send a bot client command - void (*BotClientCommand)(int client, const char *command); // was char *, changed for c++ compilation - //memory allocation - void *(*GetMemory)(int size); // allocate from Zone - void (*FreeMemory)(void *ptr); // free memory from Zone - int (*AvailableMemory)(void); // available Zone memory - void *(*HunkAlloc)(int size); // allocate from hunk - //file system access - int (*FS_FOpenFile)( const char *qpath, fileHandle_t *file, fsMode_t mode ); - int (*FS_Read)( void *buffer, int len, fileHandle_t f ); - int (*FS_Write)( const void *buffer, int len, fileHandle_t f ); - void (*FS_FCloseFile)( fileHandle_t f ); - int (*FS_Seek)( fileHandle_t f, long offset, int origin ); - //debug visualisation stuff - int (*DebugLineCreate)(void); - void (*DebugLineDelete)(int line); - void (*DebugLineShow)(int line, vec3_t start, vec3_t end, int color); - // - int (*DebugPolygonCreate)(int color, int numPoints, vec3_t *points); - void (*DebugPolygonDelete)(int id); -} botlib_import_t; - -typedef struct aas_export_s -{ - //----------------------------------- - // be_aas_entity.h - //----------------------------------- - void (*AAS_EntityInfo)(int entnum, struct aas_entityinfo_s *info); - //----------------------------------- - // be_aas_main.h - //----------------------------------- - int (*AAS_Initialized)(void); - void (*AAS_PresenceTypeBoundingBox)(int presencetype, vec3_t mins, vec3_t maxs); - float (*AAS_Time)(void); - //-------------------------------------------- - // be_aas_sample.c - //-------------------------------------------- - int (*AAS_PointAreaNum)(vec3_t point); - int (*AAS_PointReachabilityAreaIndex)( vec3_t point ); - int (*AAS_TraceAreas)(vec3_t start, vec3_t end, int *areas, vec3_t *points, int maxareas); - int (*AAS_BBoxAreas)(vec3_t absmins, vec3_t absmaxs, int *areas, int maxareas); - int (*AAS_AreaInfo)( int areanum, struct aas_areainfo_s *info ); - //-------------------------------------------- - // be_aas_bspq3.c - //-------------------------------------------- - int (*AAS_PointContents)(vec3_t point); - int (*AAS_NextBSPEntity)(int ent); - int (*AAS_ValueForBSPEpairKey)(int ent, char *key, char *value, int size); - int (*AAS_VectorForBSPEpairKey)(int ent, char *key, vec3_t v); - int (*AAS_FloatForBSPEpairKey)(int ent, char *key, float *value); - int (*AAS_IntForBSPEpairKey)(int ent, char *key, int *value); - //-------------------------------------------- - // be_aas_reach.c - //-------------------------------------------- - int (*AAS_AreaReachability)(int areanum); - //-------------------------------------------- - // be_aas_route.c - //-------------------------------------------- - int (*AAS_AreaTravelTimeToGoalArea)(int areanum, vec3_t origin, int goalareanum, int travelflags); - int (*AAS_EnableRoutingArea)(int areanum, int enable); - int (*AAS_PredictRoute)(struct aas_predictroute_s *route, int areanum, vec3_t origin, - int goalareanum, int travelflags, int maxareas, int maxtime, - int stopevent, int stopcontents, int stoptfl, int stopareanum); - //-------------------------------------------- - // be_aas_altroute.c - //-------------------------------------------- - int (*AAS_AlternativeRouteGoals)(vec3_t start, int startareanum, vec3_t goal, int goalareanum, int travelflags, - struct aas_altroutegoal_s *altroutegoals, int maxaltroutegoals, - int type); - //-------------------------------------------- - // be_aas_move.c - //-------------------------------------------- - int (*AAS_Swimming)(vec3_t origin); - int (*AAS_PredictClientMovement)(struct aas_clientmove_s *move, - int entnum, vec3_t origin, - int presencetype, int onground, - vec3_t velocity, vec3_t cmdmove, - int cmdframes, - int maxframes, float frametime, - int stopevent, int stopareanum, int visualize); -} aas_export_t; - -typedef struct ea_export_s -{ - //ClientCommand elementary actions - void (*EA_Command)(int client, const char *command ); - void (*EA_Say)(int client, char *str); - void (*EA_SayTeam)(int client, char *str); - // - void (*EA_Action)(int client, int action); - void (*EA_Gesture)(int client); - void (*EA_Talk)(int client); - void (*EA_ToggleFireState)(int client); - void (*EA_Attack)(int client, int primarydangerous, int altdangerous); - void (*EA_Use)(int client); - void (*EA_Respawn)(int client); - void (*EA_MoveUp)(int client); - void (*EA_MoveDown)(int client); - void (*EA_MoveForward)(int client); - void (*EA_MoveBack)(int client); - void (*EA_MoveLeft)(int client); - void (*EA_MoveRight)(int client); - void (*EA_Crouch)(int client); - - void (*EA_SelectWeapon)(int client, int weapon); - void (*EA_Jump)(int client); - void (*EA_DelayedJump)(int client); - void (*EA_Move)(int client, vec3_t dir, float speed); - void (*EA_View)(int client, vec3_t viewangles); - //send regular input to the server - void (*EA_EndRegular)(int client, float thinktime); - void (*EA_GetInput)(int client, float thinktime, bot_input_t *input); - void (*EA_ResetInput)(int client); -} ea_export_t; - -typedef struct ai_export_s -{ - //----------------------------------- - // be_ai_char.h - //----------------------------------- - int (*BotLoadCharacter)(char *charfile, float skill); - void (*BotFreeCharacter)(int character); - float (*Characteristic_Float)(int character, int index); - float (*Characteristic_BFloat)(int character, int index, float min, float max); - int (*Characteristic_Integer)(int character, int index); - int (*Characteristic_BInteger)(int character, int index, int min, int max); - void (*Characteristic_String)(int character, int index, char *buf, int size); - //----------------------------------- - // be_ai_chat.h - //----------------------------------- - int (*BotAllocChatState)(void); - void (*BotFreeChatState)(int handle); - void (*BotQueueConsoleMessage)(int chatstate, int type, char *message); - void (*BotRemoveConsoleMessage)(int chatstate, int handle); - int (*BotNextConsoleMessage)(int chatstate, struct bot_consolemessage_s *cm); - int (*BotNumConsoleMessages)(int chatstate); - void (*BotInitialChat)(int chatstate, char *type, int mcontext, char *var0, char *var1, char *var2, char *var3, char *var4, char *var5, char *var6, char *var7); - int (*BotNumInitialChats)(int chatstate, char *type); - int (*BotReplyChat)(int chatstate, char *message, int mcontext, int vcontext, char *var0, char *var1, char *var2, char *var3, char *var4, char *var5, char *var6, char *var7); - int (*BotChatLength)(int chatstate); - void (*BotEnterChat)(int chatstate, int client, int sendto); - void (*BotGetChatMessage)(int chatstate, char *buf, int size); - int (*StringContains)(char *str1, char *str2, int casesensitive); - int (*BotFindMatch)(char *str, struct bot_match_s *match, unsigned long int context); - void (*BotMatchVariable)(struct bot_match_s *match, int variable, char *buf, int size); - void (*UnifyWhiteSpaces)(char *string); - void (*BotReplaceSynonyms)(char *string, unsigned long int context); - int (*BotLoadChatFile)(int chatstate, char *chatfile, char *chatname); - void (*BotSetChatGender)(int chatstate, int gender); - void (*BotSetChatName)(int chatstate, char *name, int client); - //----------------------------------- - // be_ai_goal.h - //----------------------------------- - void (*BotResetGoalState)(int goalstate); - void (*BotResetAvoidGoals)(int goalstate); - void (*BotRemoveFromAvoidGoals)(int goalstate, int number); - void (*BotPushGoal)(int goalstate, struct bot_goal_s *goal); - void (*BotPopGoal)(int goalstate); - void (*BotEmptyGoalStack)(int goalstate); - void (*BotDumpAvoidGoals)(int goalstate); - void (*BotDumpGoalStack)(int goalstate); - void (*BotGoalName)(int number, char *name, int size); - int (*BotGetTopGoal)(int goalstate, struct bot_goal_s *goal); - int (*BotGetSecondGoal)(int goalstate, struct bot_goal_s *goal); - int (*BotChooseLTGItem)(int goalstate, vec3_t origin, int *inventory, int travelflags); - int (*BotChooseNBGItem)(int goalstate, vec3_t origin, int *inventory, int travelflags, - struct bot_goal_s *ltg, float maxtime); - int (*BotTouchingGoal)(vec3_t origin, struct bot_goal_s *goal); - int (*BotItemGoalInVisButNotVisible)(int viewer, vec3_t eye, vec3_t viewangles, struct bot_goal_s *goal); - int (*BotGetLevelItemGoal)(int index, char *classname, struct bot_goal_s *goal); - int (*BotGetNextCampSpotGoal)(int num, struct bot_goal_s *goal); - int (*BotGetMapLocationGoal)(char *name, struct bot_goal_s *goal); - float (*BotAvoidGoalTime)(int goalstate, int number); - void (*BotSetAvoidGoalTime)(int goalstate, int number, float avoidtime); - void (*BotInitLevelItems)(void); - void (*BotUpdateEntityItems)(void); - int (*BotLoadItemWeights)(int goalstate, char *filename); - void (*BotFreeItemWeights)(int goalstate); - void (*BotInterbreedGoalFuzzyLogic)(int parent1, int parent2, int child); - void (*BotSaveGoalFuzzyLogic)(int goalstate, char *filename); - void (*BotMutateGoalFuzzyLogic)(int goalstate, float range); - int (*BotAllocGoalState)(int client); - void (*BotFreeGoalState)(int handle); - //----------------------------------- - // be_ai_move.h - //----------------------------------- - void (*BotResetMoveState)(int movestate); - void (*BotMoveToGoal)(struct bot_moveresult_s *result, int movestate, struct bot_goal_s *goal, int travelflags); - int (*BotMoveInDirection)(int movestate, vec3_t dir, float speed, int type); - void (*BotResetAvoidReach)(int movestate); - void (*BotResetLastAvoidReach)(int movestate); - int (*BotReachabilityArea)(vec3_t origin, int testground); - int (*BotMovementViewTarget)(int movestate, struct bot_goal_s *goal, int travelflags, float lookahead, vec3_t target); - int (*BotPredictVisiblePosition)(vec3_t origin, int areanum, struct bot_goal_s *goal, int travelflags, vec3_t target); - int (*BotAllocMoveState)(void); - void (*BotFreeMoveState)(int handle); - void (*BotInitMoveState)(int handle, struct bot_initmove_s *initmove); - void (*BotAddAvoidSpot)(int movestate, vec3_t origin, float radius, int type); - //----------------------------------- - // be_ai_weap.h - //----------------------------------- - int (*BotChooseBestFightWeapon)(int weaponstate, int *inventory); - void (*BotGetWeaponInfo)(int weaponstate, int weapon, struct weaponinfo_s *weaponinfo); - int (*BotLoadWeaponWeights)(int weaponstate, char *filename); - int (*BotAllocWeaponState)(void); - void (*BotFreeWeaponState)(int weaponstate); - void (*BotResetWeaponState)(int weaponstate); - //----------------------------------- - // be_ai_gen.h - //----------------------------------- - int (*GeneticParentsAndChildSelection)(int numranks, float *ranks, int *parent1, int *parent2, int *child); -} ai_export_t; - -//bot AI library imported functions -typedef struct botlib_export_s -{ - //Area Awareness System functions - aas_export_t aas; - //Elementary Action functions - ea_export_t ea; - //AI functions - ai_export_t ai; - //setup the bot library, returns BLERR_ - int (*BotLibSetup)(void); - //shutdown the bot library, returns BLERR_ - int (*BotLibShutdown)(void); - //sets a library variable returns BLERR_ - int (*BotLibVarSet)(char *var_name, char *value); - //gets a library variable returns BLERR_ - int (*BotLibVarGet)(char *var_name, char *value, int size); - - //sets a C-like define returns BLERR_ - int (*PC_AddGlobalDefine)(char *string); - int (*PC_LoadSourceHandle)(const char *filename); - int (*PC_FreeSourceHandle)(int handle); -// int (*PC_ReadTokenHandle)(int handle, pc_token_t *pc_token); - int (*PC_SourceFileAndLine)(int handle, char *filename, int *line); - - //start a frame in the bot library - int (*BotLibStartFrame)(float time); - //load a new map in the bot library - int (*BotLibLoadMap)(const char *mapname); - //entity updates - int (*BotLibUpdateEntity)(int ent, bot_entitystate_t *state); - //just for testing - int (*Test)(int parm0, int parm1, vec3_t parm2, vec3_t parm3); -} botlib_export_t; - -//linking of bot library -botlib_export_t *GetBotLibAPI( int apiVersion, botlib_import_t *import ); - -/* Library variables: - -name: default: module(s): description: - -"basedir" "" l_utils.c base directory -"gamedir" "" l_utils.c game directory -"cddir" "" l_utils.c CD directory - -"log" "0" l_log.c enable/disable creating a log file -"maxclients" "4" be_interface.c maximum number of clients -"maxentities" "1024" be_interface.c maximum number of entities -"bot_developer" "0" be_interface.c bot developer mode - -"phys_friction" "6" be_aas_move.c ground friction -"phys_stopspeed" "100" be_aas_move.c stop speed -"phys_gravity" "800" be_aas_move.c gravity value -"phys_waterfriction" "1" be_aas_move.c water friction -"phys_watergravity" "400" be_aas_move.c gravity in water -"phys_maxvelocity" "320" be_aas_move.c maximum velocity -"phys_maxwalkvelocity" "320" be_aas_move.c maximum walk velocity -"phys_maxcrouchvelocity" "100" be_aas_move.c maximum crouch velocity -"phys_maxswimvelocity" "150" be_aas_move.c maximum swim velocity -"phys_walkaccelerate" "10" be_aas_move.c walk acceleration -"phys_airaccelerate" "1" be_aas_move.c air acceleration -"phys_swimaccelerate" "4" be_aas_move.c swim acceleration -"phys_maxstep" "18" be_aas_move.c maximum step height -"phys_maxsteepness" "0.7" be_aas_move.c maximum floor steepness -"phys_maxbarrier" "32" be_aas_move.c maximum barrier height -"phys_maxwaterjump" "19" be_aas_move.c maximum waterjump height -"phys_jumpvel" "270" be_aas_move.c jump z velocity -"phys_falldelta5" "40" be_aas_move.c -"phys_falldelta10" "60" be_aas_move.c -"rs_waterjump" "400" be_aas_move.c -"rs_teleport" "50" be_aas_move.c -"rs_barrierjump" "100" be_aas_move.c -"rs_startcrouch" "300" be_aas_move.c -"rs_startgrapple" "500" be_aas_move.c -"rs_startwalkoffledge" "70" be_aas_move.c -"rs_startjump" "300" be_aas_move.c -"rs_rocketjump" "500" be_aas_move.c -"rs_bfgjump" "500" be_aas_move.c -"rs_jumppad" "250" be_aas_move.c -"rs_aircontrolledjumppad" "300" be_aas_move.c -"rs_funcbob" "300" be_aas_move.c -"rs_startelevator" "50" be_aas_move.c -"rs_falldamage5" "300" be_aas_move.c -"rs_falldamage10" "500" be_aas_move.c -"rs_maxjumpfallheight" "450" be_aas_move.c - -"max_aaslinks" "4096" be_aas_sample.c maximum links in the AAS -"max_routingcache" "4096" be_aas_route.c maximum routing cache size in KB -"forceclustering" "0" be_aas_main.c force recalculation of clusters -"forcereachability" "0" be_aas_main.c force recalculation of reachabilities -"forcewrite" "0" be_aas_main.c force writing of aas file -"aasoptimize" "0" be_aas_main.c enable aas optimization -"sv_mapChecksum" "0" be_aas_main.c BSP file checksum -"bot_visualizejumppads" "0" be_aas_reach.c visualize jump pads - -"bot_reloadcharacters" "0" - reload bot character files -"ai_gametype" "0" be_ai_goal.c game type -"droppedweight" "1000" be_ai_goal.c additional dropped item weight -"weapindex_rocketlauncher" "5" be_ai_move.c rl weapon index for rocket jumping -"weapindex_bfg10k" "9" be_ai_move.c bfg weapon index for bfg jumping -"weapindex_grapple" "10" be_ai_move.c grapple weapon index for grappling -"entitytypemissile" "3" be_ai_move.c ET_MISSILE -"offhandgrapple" "0" be_ai_move.c enable off hand grapple hook -"cmd_grappleon" "grappleon" be_ai_move.c command to activate off hand grapple -"cmd_grappleoff" "grappleoff" be_ai_move.c command to deactivate off hand grapple -"itemconfig" "items.c" be_ai_goal.c item configuration file -"weaponconfig" "weapons.c" be_ai_weap.c weapon configuration file -"synfile" "syn.c" be_ai_chat.c file with synonyms -"rndfile" "rnd.c" be_ai_chat.c file with random strings -"matchfile" "match.c" be_ai_chat.c file with match strings -"nochat" "0" be_ai_chat.c disable chats -"max_messages" "1024" be_ai_chat.c console message heap size -"max_weaponinfo" "32" be_ai_weap.c maximum number of weapon info -"max_projectileinfo" "32" be_ai_weap.c maximum number of projectile info -"max_iteminfo" "256" be_ai_goal.c maximum number of item info -"max_levelitems" "256" be_ai_goal.c maximum number of level items - -*/ -#endif +// Copyright (C) 1999-2000 Id Software, Inc. +// +/***************************************************************************** + * name: botlib.h + * + * desc: bot AI library + * + * $Archive: /EF2/Code/DLLs/game/botlib.h $ + * $Author: Singlis $ + * $Revision: 5 $ + * $Modtime: 9/24/03 3:09p $ + * $Date: 9/26/03 2:35p $ + * + *****************************************************************************/ + +#ifndef __BOTLIB_H__ +#define __BOTLIB_H__ + +#define BOTLIB_API_VERSION 2 + +struct aas_clientmove_s; +struct aas_entityinfo_s; +struct aas_areainfo_s; +struct aas_altroutegoal_s; +struct aas_predictroute_s; +struct bot_consolemessage_s; +struct bot_match_s; +struct bot_goal_s; +struct bot_moveresult_s; +struct bot_initmove_s; +struct weaponinfo_s; + +#define BOTFILESBASEFOLDER "botfiles" +//debug line colors +#define LINECOLOR_NONE -1 +#define LINECOLOR_RED 1//0xf2f2f0f0L +#define LINECOLOR_GREEN 2//0xd0d1d2d3L +#define LINECOLOR_BLUE 3//0xf3f3f1f1L +#define LINECOLOR_YELLOW 4//0xdcdddedfL +#define LINECOLOR_ORANGE 5//0xe0e1e2e3L + +//Print types +#define PRT_MESSAGE 1 +#define PRT_WARNING 2 +#define PRT_ERROR 3 +#define PRT_FATAL 4 +#define PRT_EXIT 5 + +//console message types +#define CMS_NORMAL 0 +#define CMS_CHAT 1 + +//botlib error codes +#define BLERR_NOERROR 0 //no error +#define BLERR_LIBRARYNOTSETUP 1 //library not setup +#define BLERR_INVALIDENTITYNUMBER 2 //invalid entity number +#define BLERR_NOAASFILE 3 //no AAS file available +#define BLERR_CANNOTOPENAASFILE 4 //cannot open AAS file +#define BLERR_WRONGAASFILEID 5 //incorrect AAS file id +#define BLERR_WRONGAASFILEVERSION 6 //incorrect AAS file version +#define BLERR_CANNOTREADAASLUMP 7 //cannot read AAS file lump +#define BLERR_CANNOTLOADICHAT 8 //cannot load initial chats +#define BLERR_CANNOTLOADITEMWEIGHTS 9 //cannot load item weights +#define BLERR_CANNOTLOADITEMCONFIG 10 //cannot load item config +#define BLERR_CANNOTLOADWEAPONWEIGHTS 11 //cannot load weapon weights +#define BLERR_CANNOTLOADWEAPONCONFIG 12 //cannot load weapon config + +//action flags +#define ACTION_ATTACK 0x0000001 +#define ACTION_ATTACKRIGHT 0x0000002 +#define ACTION_USE 0x0000004 +#define ACTION_RESPAWN 0x0000008 +#define ACTION_JUMP 0x0000010 +#define ACTION_MOVEUP 0x0000020 +#define ACTION_CROUCH 0x0000080 +#define ACTION_MOVEDOWN 0x0000100 +#define ACTION_MOVEFORWARD 0x0000200 +#define ACTION_MOVEBACK 0x0000800 +#define ACTION_MOVELEFT 0x0001000 +#define ACTION_MOVERIGHT 0x0002000 +#define ACTION_DELAYEDJUMP 0x0008000 +#define ACTION_TALK 0x0010000 +#define ACTION_GESTURE 0x0020000 +#define ACTION_WALK 0x0080000 +#define ACTION_AFFIRMATIVE 0x0100000 +#define ACTION_NEGATIVE 0x0200000 +#define ACTION_GETFLAG 0x0800000 +#define ACTION_GUARDBASE 0x1000000 +#define ACTION_PATROL 0x2000000 +#define ACTION_FOLLOWME 0x8000000 + +//the bot input, will be converted to an usercmd_t +typedef struct bot_input_s { + float thinktime; //time since last output (in seconds) + vec3_t dir; //movement direction + float speed; //speed in the range [0, 400] + vec3_t viewangles; //the view angles + int actionflags; //one of the ACTION_? flags + int weapon, latchweapon; //weapon to use + int firestate; //right/left hand fire state +} bot_input_t; + +#ifndef BSPTRACE + +#define BSPTRACE + +//bsp_trace_t hit surface +typedef struct bsp_surface_s { + char name[16]; + int flags; + int value; +} bsp_surface_t; + +//remove the bsp_trace_s structure definition l8r on +//a trace is returned when a box is swept through the world +typedef struct bsp_trace_s { + qboolean allsolid; // if true, plane is not valid + qboolean startsolid; // if true, the initial point was in a solid area + float fraction; // time completed, 1.0 = didn't hit anything + vec3_t endpos; // final position + cplane_t plane; // surface normal at impact + float exp_dist; // expanded plane distance + int sidenum; // number of the brush side hit + bsp_surface_t surface; // the hit point surface + int contents; // contents on other side of surface hit + int ent; // number of entity hit +} bsp_trace_t; + +#endif // BSPTRACE + +//entity state +typedef struct bot_entitystate_s { + int type; // entity type + int flags; // entity flags + vec3_t origin; // origin of the entity + vec3_t angles; // angles of the model + vec3_t old_origin; // for lerping + vec3_t mins; // bounding box minimums + vec3_t maxs; // bounding box maximums + int groundent; // ground entity + int solid; // solid type + int modelindex; // model used + int modelindex2; // weapons, CTF flags, etc + int frame; // model frame number + int event; // impulse events -- muzzle flashes, footsteps, etc + int eventParm; // even parameter + int powerups; // bit flags + int weapon; // determines weapon and flash model, etc + int legsAnim; // mask off ANIM_TOGGLEBIT + int torsoAnim; // mask off ANIM_TOGGLEBIT +} bot_entitystate_t; + +//bot AI library exported functions +typedef struct botlib_import_s { + //print messages from the bot library + void (QDECL* Print)(int type, char* fmt, ...); + //trace a bbox through the world + void(*Trace)(bsp_trace_t* trace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int passent, int contentmask); + //trace a bbox against a specific entity + void(*EntityTrace)(bsp_trace_t* trace, vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int entnum, int contentmask); + //retrieve the contents at the given point + int(*PointContents)(vec3_t point); + //check if the point is in potential visible sight + int(*inPVS)(vec3_t p1, vec3_t p2); + //retrieve the BSP entity data lump + char* (*BSPEntityData)(void); + // + void(*BSPModelMinsMaxsOrigin)(int modelnum, vec3_t angles, vec3_t mins, vec3_t maxs, vec3_t origin); + //send a bot client command + void(*BotClientCommand)(int client, const char* command); // was char *, changed for c++ compilation + //memory allocation + void* (*GetMemory)(int size); // allocate from Zone + void(*FreeMemory)(void* ptr); // free memory from Zone + int(*AvailableMemory)(void); // available Zone memory + void* (*HunkAlloc)(int size); // allocate from hunk + //file system access + int(*FS_FOpenFile)(const char* qpath, fileHandle_t* file, fsMode_t mode); + int(*FS_Read)(void* buffer, int len, fileHandle_t f); + int(*FS_Write)(const void* buffer, int len, fileHandle_t f); + void(*FS_FCloseFile)(fileHandle_t f); + int(*FS_Seek)(fileHandle_t f, long offset, int origin); + //debug visualisation stuff + int(*DebugLineCreate)(void); + void(*DebugLineDelete)(int line); + void(*DebugLineShow)(int line, vec3_t start, vec3_t end, int color); + // + int(*DebugPolygonCreate)(int color, int numPoints, vec3_t* points); + void(*DebugPolygonDelete)(int id); +} botlib_import_t; + +typedef struct aas_export_s { + //----------------------------------- + // be_aas_entity.h + //----------------------------------- + void(*AAS_EntityInfo)(int entnum, struct aas_entityinfo_s* info); + //----------------------------------- + // be_aas_main.h + //----------------------------------- + int(*AAS_Initialized)(void); + void(*AAS_PresenceTypeBoundingBox)(int presencetype, vec3_t mins, vec3_t maxs); + float(*AAS_Time)(void); + //-------------------------------------------- + // be_aas_sample.c + //-------------------------------------------- + int(*AAS_PointAreaNum)(vec3_t point); + int(*AAS_PointReachabilityAreaIndex)(vec3_t point); + int(*AAS_TraceAreas)(vec3_t start, vec3_t end, int* areas, vec3_t* points, int maxareas); + int(*AAS_BBoxAreas)(vec3_t absmins, vec3_t absmaxs, int* areas, int maxareas); + int(*AAS_AreaInfo)(int areanum, struct aas_areainfo_s* info); + //-------------------------------------------- + // be_aas_bspq3.c + //-------------------------------------------- + int(*AAS_PointContents)(vec3_t point); + int(*AAS_NextBSPEntity)(int ent); + int(*AAS_ValueForBSPEpairKey)(int ent, char* key, char* value, int size); + int(*AAS_VectorForBSPEpairKey)(int ent, char* key, vec3_t v); + int(*AAS_FloatForBSPEpairKey)(int ent, char* key, float* value); + int(*AAS_IntForBSPEpairKey)(int ent, char* key, int* value); + //-------------------------------------------- + // be_aas_reach.c + //-------------------------------------------- + int(*AAS_AreaReachability)(int areanum); + //-------------------------------------------- + // be_aas_route.c + //-------------------------------------------- + int(*AAS_AreaTravelTimeToGoalArea)(int areanum, vec3_t origin, int goalareanum, int travelflags); + int(*AAS_EnableRoutingArea)(int areanum, int enable); + int(*AAS_PredictRoute)(struct aas_predictroute_s* route, int areanum, vec3_t origin, + int goalareanum, int travelflags, int maxareas, int maxtime, + int stopevent, int stopcontents, int stoptfl, int stopareanum); + //-------------------------------------------- + // be_aas_altroute.c + //-------------------------------------------- + int(*AAS_AlternativeRouteGoals)(vec3_t start, int startareanum, vec3_t goal, int goalareanum, int travelflags, + struct aas_altroutegoal_s* altroutegoals, int maxaltroutegoals, + int type); + //-------------------------------------------- + // be_aas_move.c + //-------------------------------------------- + int(*AAS_Swimming)(vec3_t origin); + int(*AAS_PredictClientMovement)(struct aas_clientmove_s* move, + int entnum, vec3_t origin, + int presencetype, int onground, + vec3_t velocity, vec3_t cmdmove, + int cmdframes, + int maxframes, float frametime, + int stopevent, int stopareanum, int visualize); +} aas_export_t; + +typedef struct ea_export_s { + //ClientCommand elementary actions + void(*EA_Command)(int client, const char* command); + void(*EA_Say)(int client, char* str); + void(*EA_SayTeam)(int client, char* str); + // + void(*EA_Action)(int client, int action); + void(*EA_Gesture)(int client); + void(*EA_Talk)(int client); + void(*EA_ToggleFireState)(int client); + void(*EA_Attack)(int client, int primarydangerous, int altdangerous); + void(*EA_Use)(int client); + void(*EA_Respawn)(int client); + void(*EA_MoveUp)(int client); + void(*EA_MoveDown)(int client); + void(*EA_MoveForward)(int client); + void(*EA_MoveBack)(int client); + void(*EA_MoveLeft)(int client); + void(*EA_MoveRight)(int client); + void(*EA_Crouch)(int client); + + void(*EA_SelectWeapon)(int client, int weapon); + void(*EA_Jump)(int client); + void(*EA_DelayedJump)(int client); + void(*EA_Move)(int client, vec3_t dir, float speed); + void(*EA_View)(int client, vec3_t viewangles); + //send regular input to the server + void(*EA_EndRegular)(int client, float thinktime); + void(*EA_GetInput)(int client, float thinktime, bot_input_t* input); + void(*EA_ResetInput)(int client); +} ea_export_t; + +typedef struct ai_export_s { + //----------------------------------- + // be_ai_char.h + //----------------------------------- + int(*BotLoadCharacter)(char* charfile, float skill); + void(*BotFreeCharacter)(int character); + float(*Characteristic_Float)(int character, int index); + float(*Characteristic_BFloat)(int character, int index, float min, float max); + int(*Characteristic_Integer)(int character, int index); + int(*Characteristic_BInteger)(int character, int index, int min, int max); + void(*Characteristic_String)(int character, int index, char* buf, int size); + //----------------------------------- + // be_ai_chat.h + //----------------------------------- + int(*BotAllocChatState)(void); + void(*BotFreeChatState)(int handle); + void(*BotQueueConsoleMessage)(int chatstate, int type, char* message); + void(*BotRemoveConsoleMessage)(int chatstate, int handle); + int(*BotNextConsoleMessage)(int chatstate, struct bot_consolemessage_s* cm); + int(*BotNumConsoleMessages)(int chatstate); + void(*BotInitialChat)(int chatstate, char* type, int mcontext, char* var0, char* var1, char* var2, char* var3, char* var4, char* var5, char* var6, char* var7); + int(*BotNumInitialChats)(int chatstate, char* type); + int(*BotReplyChat)(int chatstate, char* message, int mcontext, int vcontext, char* var0, char* var1, char* var2, char* var3, char* var4, char* var5, char* var6, char* var7); + int(*BotChatLength)(int chatstate); + void(*BotEnterChat)(int chatstate, int client, int sendto); + void(*BotGetChatMessage)(int chatstate, char* buf, int size); + int(*StringContains)(char* str1, char* str2, int casesensitive); + int(*BotFindMatch)(char* str, struct bot_match_s* match, unsigned long int context); + void(*BotMatchVariable)(struct bot_match_s* match, int variable, char* buf, int size); + void(*UnifyWhiteSpaces)(char* string); + void(*BotReplaceSynonyms)(char* string, unsigned long int context); + int(*BotLoadChatFile)(int chatstate, char* chatfile, char* chatname); + void(*BotSetChatGender)(int chatstate, int gender); + void(*BotSetChatName)(int chatstate, char* name, int client); + //----------------------------------- + // be_ai_goal.h + //----------------------------------- + void(*BotResetGoalState)(int goalstate); + void(*BotResetAvoidGoals)(int goalstate); + void(*BotRemoveFromAvoidGoals)(int goalstate, int number); + void(*BotPushGoal)(int goalstate, struct bot_goal_s* goal); + void(*BotPopGoal)(int goalstate); + void(*BotEmptyGoalStack)(int goalstate); + void(*BotDumpAvoidGoals)(int goalstate); + void(*BotDumpGoalStack)(int goalstate); + void(*BotGoalName)(int number, char* name, int size); + int(*BotGetTopGoal)(int goalstate, struct bot_goal_s* goal); + int(*BotGetSecondGoal)(int goalstate, struct bot_goal_s* goal); + int(*BotChooseLTGItem)(int goalstate, vec3_t origin, int* inventory, int travelflags); + int(*BotChooseNBGItem)(int goalstate, vec3_t origin, int* inventory, int travelflags, + struct bot_goal_s* ltg, float maxtime); + int(*BotTouchingGoal)(vec3_t origin, struct bot_goal_s* goal); + int(*BotItemGoalInVisButNotVisible)(int viewer, vec3_t eye, vec3_t viewangles, struct bot_goal_s* goal); + int(*BotGetLevelItemGoal)(int index, char* classname, struct bot_goal_s* goal); + int(*BotGetNextCampSpotGoal)(int num, struct bot_goal_s* goal); + int(*BotGetMapLocationGoal)(char* name, struct bot_goal_s* goal); + float(*BotAvoidGoalTime)(int goalstate, int number); + void(*BotSetAvoidGoalTime)(int goalstate, int number, float avoidtime); + void(*BotInitLevelItems)(void); + void(*BotUpdateEntityItems)(void); + int(*BotLoadItemWeights)(int goalstate, char* filename); + void(*BotFreeItemWeights)(int goalstate); + void(*BotInterbreedGoalFuzzyLogic)(int parent1, int parent2, int child); + void(*BotSaveGoalFuzzyLogic)(int goalstate, char* filename); + void(*BotMutateGoalFuzzyLogic)(int goalstate, float range); + int(*BotAllocGoalState)(int client); + void(*BotFreeGoalState)(int handle); + //----------------------------------- + // be_ai_move.h + //----------------------------------- + void(*BotResetMoveState)(int movestate); + void(*BotMoveToGoal)(struct bot_moveresult_s* result, int movestate, struct bot_goal_s* goal, int travelflags); + int(*BotMoveInDirection)(int movestate, vec3_t dir, float speed, int type); + void(*BotResetAvoidReach)(int movestate); + void(*BotResetLastAvoidReach)(int movestate); + int(*BotReachabilityArea)(vec3_t origin, int testground); + int(*BotMovementViewTarget)(int movestate, struct bot_goal_s* goal, int travelflags, float lookahead, vec3_t target); + int(*BotPredictVisiblePosition)(vec3_t origin, int areanum, struct bot_goal_s* goal, int travelflags, vec3_t target); + int(*BotAllocMoveState)(void); + void(*BotFreeMoveState)(int handle); + void(*BotInitMoveState)(int handle, struct bot_initmove_s* initmove); + void(*BotAddAvoidSpot)(int movestate, vec3_t origin, float radius, int type); + //----------------------------------- + // be_ai_weap.h + //----------------------------------- + int(*BotChooseBestFightWeapon)(int weaponstate, int* inventory); + void(*BotGetWeaponInfo)(int weaponstate, int weapon, struct weaponinfo_s* weaponinfo); + int(*BotLoadWeaponWeights)(int weaponstate, char* filename); + int(*BotAllocWeaponState)(void); + void(*BotFreeWeaponState)(int weaponstate); + void(*BotResetWeaponState)(int weaponstate); + //----------------------------------- + // be_ai_gen.h + //----------------------------------- + int(*GeneticParentsAndChildSelection)(int numranks, float* ranks, int* parent1, int* parent2, int* child); +} ai_export_t; + +//bot AI library imported functions +typedef struct botlib_export_s { + //Area Awareness System functions + aas_export_t aas; + //Elementary Action functions + ea_export_t ea; + //AI functions + ai_export_t ai; + //setup the bot library, returns BLERR_ + int(*BotLibSetup)(void); + //shutdown the bot library, returns BLERR_ + int(*BotLibShutdown)(void); + //sets a library variable returns BLERR_ + int(*BotLibVarSet)(char* var_name, char* value); + //gets a library variable returns BLERR_ + int(*BotLibVarGet)(char* var_name, char* value, int size); + + //sets a C-like define returns BLERR_ + int(*PC_AddGlobalDefine)(char* string); + int(*PC_LoadSourceHandle)(const char* filename); + int(*PC_FreeSourceHandle)(int handle); + // int (*PC_ReadTokenHandle)(int handle, pc_token_t* pc_token); + int(*PC_SourceFileAndLine)(int handle, char* filename, int* line); + + //start a frame in the bot library + int(*BotLibStartFrame)(float time); + //load a new map in the bot library + int(*BotLibLoadMap)(const char* mapname); + //entity updates + int(*BotLibUpdateEntity)(int ent, bot_entitystate_t* state); + //just for testing + int(*Test)(int parm0, int parm1, vec3_t parm2, vec3_t parm3); +} botlib_export_t; + +//linking of bot library +botlib_export_t* GetBotLibAPI(int apiVersion, botlib_import_t* import); + +/* Library variables: + +name: default: module(s): description: + +"basedir" "" l_utils.c base directory +"gamedir" "" l_utils.c game directory +"cddir" "" l_utils.c CD directory + +"log" "0" l_log.c enable/disable creating a log file +"maxclients" "4" be_interface.c maximum number of clients +"maxentities" "1024" be_interface.c maximum number of entities +"bot_developer" "0" be_interface.c bot developer mode + +"phys_friction" "6" be_aas_move.c ground friction +"phys_stopspeed" "100" be_aas_move.c stop speed +"phys_gravity" "800" be_aas_move.c gravity value +"phys_waterfriction" "1" be_aas_move.c water friction +"phys_watergravity" "400" be_aas_move.c gravity in water +"phys_maxvelocity" "320" be_aas_move.c maximum velocity +"phys_maxwalkvelocity" "320" be_aas_move.c maximum walk velocity +"phys_maxcrouchvelocity" "100" be_aas_move.c maximum crouch velocity +"phys_maxswimvelocity" "150" be_aas_move.c maximum swim velocity +"phys_walkaccelerate" "10" be_aas_move.c walk acceleration +"phys_airaccelerate" "1" be_aas_move.c air acceleration +"phys_swimaccelerate" "4" be_aas_move.c swim acceleration +"phys_maxstep" "18" be_aas_move.c maximum step height +"phys_maxsteepness" "0.7" be_aas_move.c maximum floor steepness +"phys_maxbarrier" "32" be_aas_move.c maximum barrier height +"phys_maxwaterjump" "19" be_aas_move.c maximum waterjump height +"phys_jumpvel" "270" be_aas_move.c jump z velocity +"phys_falldelta5" "40" be_aas_move.c +"phys_falldelta10" "60" be_aas_move.c +"rs_waterjump" "400" be_aas_move.c +"rs_teleport" "50" be_aas_move.c +"rs_barrierjump" "100" be_aas_move.c +"rs_startcrouch" "300" be_aas_move.c +"rs_startgrapple" "500" be_aas_move.c +"rs_startwalkoffledge" "70" be_aas_move.c +"rs_startjump" "300" be_aas_move.c +"rs_rocketjump" "500" be_aas_move.c +"rs_bfgjump" "500" be_aas_move.c +"rs_jumppad" "250" be_aas_move.c +"rs_aircontrolledjumppad" "300" be_aas_move.c +"rs_funcbob" "300" be_aas_move.c +"rs_startelevator" "50" be_aas_move.c +"rs_falldamage5" "300" be_aas_move.c +"rs_falldamage10" "500" be_aas_move.c +"rs_maxjumpfallheight" "450" be_aas_move.c + +"max_aaslinks" "4096" be_aas_sample.c maximum links in the AAS +"max_routingcache" "4096" be_aas_route.c maximum routing cache size in KB +"forceclustering" "0" be_aas_main.c force recalculation of clusters +"forcereachability" "0" be_aas_main.c force recalculation of reachabilities +"forcewrite" "0" be_aas_main.c force writing of aas file +"aasoptimize" "0" be_aas_main.c enable aas optimization +"sv_mapChecksum" "0" be_aas_main.c BSP file checksum +"bot_visualizejumppads" "0" be_aas_reach.c visualize jump pads + +"bot_reloadcharacters" "0" - reload bot character files +"ai_gametype" "0" be_ai_goal.c game type +"droppedweight" "1000" be_ai_goal.c additional dropped item weight +"weapindex_rocketlauncher" "5" be_ai_move.c rl weapon index for rocket jumping +"weapindex_bfg10k" "9" be_ai_move.c bfg weapon index for bfg jumping +"weapindex_grapple" "10" be_ai_move.c grapple weapon index for grappling +"entitytypemissile" "3" be_ai_move.c ET_MISSILE +"offhandgrapple" "0" be_ai_move.c enable off hand grapple hook +"cmd_grappleon" "grappleon" be_ai_move.c command to activate off hand grapple +"cmd_grappleoff" "grappleoff" be_ai_move.c command to deactivate off hand grapple +"itemconfig" "items.c" be_ai_goal.c item configuration file +"weaponconfig" "weapons.c" be_ai_weap.c weapon configuration file +"synfile" "syn.c" be_ai_chat.c file with synonyms +"rndfile" "rnd.c" be_ai_chat.c file with random strings +"matchfile" "match.c" be_ai_chat.c file with match strings +"nochat" "0" be_ai_chat.c disable chats +"max_messages" "1024" be_ai_chat.c console message heap size +"max_weaponinfo" "32" be_ai_weap.c maximum number of weapon info +"max_projectileinfo" "32" be_ai_weap.c maximum number of projectile info +"max_iteminfo" "256" be_ai_goal.c maximum number of item info +"max_levelitems" "256" be_ai_goal.c maximum number of level items + +*/ +#endif diff --git a/dlls/game/botmenudef.h b/dlls/game/botmenudef.h index ef23567..3521220 100644 --- a/dlls/game/botmenudef.h +++ b/dlls/game/botmenudef.h @@ -1,287 +1,287 @@ - -#define ITEM_TYPE_TEXT 0 // simple text -#define ITEM_TYPE_BUTTON 1 // button, basically text with a border -#define ITEM_TYPE_RADIOBUTTON 2 // toggle button, may be grouped -#define ITEM_TYPE_CHECKBOX 3 // check box -#define ITEM_TYPE_EDITFIELD 4 // editable text, associated with a cvar -#define ITEM_TYPE_COMBO 5 // drop down list -#define ITEM_TYPE_LISTBOX 6 // scrollable list -#define ITEM_TYPE_MODEL 7 // model -#define ITEM_TYPE_OWNERDRAW 8 // owner draw, name specs what it is -#define ITEM_TYPE_NUMERICFIELD 9 // editable text, associated with a cvar -#define ITEM_TYPE_SLIDER 10 // mouse speed, volume, etc. -#define ITEM_TYPE_YESNO 11 // yes no cvar setting -#define ITEM_TYPE_MULTI 12 // multiple list setting, enumerated -#define ITEM_TYPE_BIND 13 // multiple list setting, enumerated - -#define ITEM_ALIGN_LEFT 0 // left alignment -#define ITEM_ALIGN_CENTER 1 // center alignment -#define ITEM_ALIGN_RIGHT 2 // right alignment - -#define ITEM_TEXTSTYLE_NORMAL 0 // normal text -#define ITEM_TEXTSTYLE_BLINK 1 // fast blinking -#define ITEM_TEXTSTYLE_PULSE 2 // slow pulsing -#define ITEM_TEXTSTYLE_SHADOWED 3 // drop shadow ( need a color for this ) -#define ITEM_TEXTSTYLE_OUTLINED 4 // drop shadow ( need a color for this ) -#define ITEM_TEXTSTYLE_OUTLINESHADOWED 5 // drop shadow ( need a color for this ) -#define ITEM_TEXTSTYLE_SHADOWEDMORE 6 // drop shadow ( need a color for this ) - -#define WINDOW_BORDER_NONE 0 // no border -#define WINDOW_BORDER_FULL 1 // full border based on border color ( single pixel ) -#define WINDOW_BORDER_HORZ 2 // horizontal borders only -#define WINDOW_BORDER_VERT 3 // vertical borders only -#define WINDOW_BORDER_KCGRADIENT 4 // horizontal border using the gradient bars - -#define WINDOW_STYLE_EMPTY 0 // no background -#define WINDOW_STYLE_FILLED 1 // filled with background color -#define WINDOW_STYLE_GRADIENT 2 // gradient bar based on background color -#define WINDOW_STYLE_SHADER 3 // gradient bar based on background color -#define WINDOW_STYLE_TEAMCOLOR 4 // team color -#define WINDOW_STYLE_CINEMATIC 5 // cinematic - -#define MENU_TRUE 1 // uh.. true -#define MENU_FALSE 0 // and false - -#define HUD_VERTICAL 0x00 -#define HUD_HORIZONTAL 0x01 - -// list box element types -#define LISTBOX_TEXT 0x00 -#define LISTBOX_IMAGE 0x01 - -// list feeders -#define FEEDER_HEADS 0x00 // model heads -#define FEEDER_MAPS 0x01 // text maps based on game type -#define FEEDER_SERVERS 0x02 // servers -#define FEEDER_CLANS 0x03 // clan names -#define FEEDER_ALLMAPS 0x04 // all maps available, in graphic format -#define FEEDER_REDTEAM_LIST 0x05 // red team members -#define FEEDER_BLUETEAM_LIST 0x06 // blue team members -#define FEEDER_PLAYER_LIST 0x07 // players -#define FEEDER_TEAM_LIST 0x08 // team members for team voting -#define FEEDER_MODS 0x09 // team members for team voting -#define FEEDER_DEMOS 0x0a // team members for team voting -#define FEEDER_SCOREBOARD 0x0b // team members for team voting -#define FEEDER_Q3HEADS 0x0c // model heads -#define FEEDER_SERVERSTATUS 0x0d // server status -#define FEEDER_FINDPLAYER 0x0e // find player -#define FEEDER_CINEMATICS 0x0f // cinematics - -// display flags -#define CG_SHOW_BLUE_TEAM_HAS_REDFLAG 0x00000001 -#define CG_SHOW_RED_TEAM_HAS_BLUEFLAG 0x00000002 -#define CG_SHOW_ANYTEAMGAME 0x00000004 -#define CG_SHOW_HARVESTER 0x00000008 -#define CG_SHOW_ONEFLAG 0x00000010 -#define CG_SHOW_CTF 0x00000020 -#define CG_SHOW_OBELISK 0x00000040 -#define CG_SHOW_HEALTHCRITICAL 0x00000080 -#define CG_SHOW_SINGLEPLAYER 0x00000100 -#define CG_SHOW_TOURNAMENT 0x00000200 -#define CG_SHOW_DURINGINCOMINGVOICE 0x00000400 -#define CG_SHOW_IF_PLAYER_HAS_FLAG 0x00000800 -#define CG_SHOW_LANPLAYONLY 0x00001000 -#define CG_SHOW_MINED 0x00002000 -#define CG_SHOW_HEALTHOK 0x00004000 -#define CG_SHOW_TEAMINFO 0x00008000 -#define CG_SHOW_NOTEAMINFO 0x00010000 -#define CG_SHOW_OTHERTEAMHASFLAG 0x00020000 -#define CG_SHOW_YOURTEAMHASENEMYFLAG 0x00040000 -#define CG_SHOW_ANYNONTEAMGAME 0x00080000 -#define CG_SHOW_2DONLY 0x10000000 - - -#define UI_SHOW_LEADER 0x00000001 -#define UI_SHOW_NOTLEADER 0x00000002 -#define UI_SHOW_FAVORITESERVERS 0x00000004 -#define UI_SHOW_ANYNONTEAMGAME 0x00000008 -#define UI_SHOW_ANYTEAMGAME 0x00000010 -#define UI_SHOW_NEWHIGHSCORE 0x00000020 -#define UI_SHOW_DEMOAVAILABLE 0x00000040 -#define UI_SHOW_NEWBESTTIME 0x00000080 -#define UI_SHOW_FFA 0x00000100 -#define UI_SHOW_NOTFFA 0x00000200 -#define UI_SHOW_NETANYNONTEAMGAME 0x00000400 -#define UI_SHOW_NETANYTEAMGAME 0x00000800 -#define UI_SHOW_NOTFAVORITESERVERS 0x00001000 - - - - -// owner draw types -// ideally these should be done outside of this file but -// this makes it much easier for the macro expansion to -// convert them for the designers ( from the .menu files ) -#define CG_OWNERDRAW_BASE 1 -#define CG_PLAYER_ARMOR_ICON 1 -#define CG_PLAYER_ARMOR_VALUE 2 -#define CG_PLAYER_HEAD 3 -#define CG_PLAYER_HEALTH 4 -#define CG_PLAYER_AMMO_ICON 5 -#define CG_PLAYER_AMMO_VALUE 6 -#define CG_SELECTEDPLAYER_HEAD 7 -#define CG_SELECTEDPLAYER_NAME 8 -#define CG_SELECTEDPLAYER_LOCATION 9 -#define CG_SELECTEDPLAYER_STATUS 10 -#define CG_SELECTEDPLAYER_WEAPON 11 -#define CG_SELECTEDPLAYER_POWERUP 12 - -#define CG_FLAGCARRIER_HEAD 13 -#define CG_FLAGCARRIER_NAME 14 -#define CG_FLAGCARRIER_LOCATION 15 -#define CG_FLAGCARRIER_STATUS 16 -#define CG_FLAGCARRIER_WEAPON 17 -#define CG_FLAGCARRIER_POWERUP 18 - -#define CG_PLAYER_ITEM 19 -#define CG_PLAYER_SCORE 20 - -#define CG_BLUE_FLAGHEAD 21 -#define CG_BLUE_FLAGSTATUS 22 -#define CG_BLUE_FLAGNAME 23 -#define CG_RED_FLAGHEAD 24 -#define CG_RED_FLAGSTATUS 25 -#define CG_RED_FLAGNAME 26 - -#define CG_BLUE_SCORE 27 -#define CG_RED_SCORE 28 -#define CG_RED_NAME 29 -#define CG_BLUE_NAME 30 -#define CG_HARVESTER_SKULLS 31 // only shows in harvester -#define CG_ONEFLAG_STATUS 32 // only shows in one flag -#define CG_PLAYER_LOCATION 33 -#define CG_TEAM_COLOR 34 -#define CG_CTF_POWERUP 35 - -#define CG_AREA_POWERUP 36 -#define CG_AREA_LAGOMETER 37 // painted with old system -#define CG_PLAYER_HASFLAG 38 -#define CG_GAME_TYPE 39 // not done - -#define CG_SELECTEDPLAYER_ARMOR 40 -#define CG_SELECTEDPLAYER_HEALTH 41 -#define CG_PLAYER_STATUS 42 -#define CG_FRAGGED_MSG 43 // painted with old system -#define CG_PROXMINED_MSG 44 // painted with old system -#define CG_AREA_FPSINFO 45 // painted with old system -#define CG_AREA_SYSTEMCHAT 46 // painted with old system -#define CG_AREA_TEAMCHAT 47 // painted with old system -#define CG_AREA_CHAT 48 // painted with old system -#define CG_GAME_STATUS 49 -#define CG_KILLER 50 -#define CG_PLAYER_ARMOR_ICON2D 51 -#define CG_PLAYER_AMMO_ICON2D 52 -#define CG_ACCURACY 53 -#define CG_ASSISTS 54 -#define CG_DEFEND 55 -#define CG_EXCELLENT 56 -#define CG_IMPRESSIVE 57 -#define CG_PERFECT 58 -#define CG_GAUNTLET 59 -#define CG_SPECTATORS 60 -#define CG_TEAMINFO 61 -#define CG_VOICE_HEAD 62 -#define CG_VOICE_NAME 63 -#define CG_PLAYER_HASFLAG2D 64 -#define CG_HARVESTER_SKULLS2D 65 // only shows in harvester -#define CG_CAPFRAGLIMIT 66 -#define CG_1STPLACE 67 -#define CG_2NDPLACE 68 -#define CG_CAPTURES 69 - - - - -#define UI_OWNERDRAW_BASE 200 -#define UI_HANDICAP 200 -#define UI_EFFECTS 201 -#define UI_PLAYERMODEL 202 -#define UI_CLANNAME 203 -#define UI_CLANLOGO 204 -#define UI_GAMETYPE 205 -#define UI_MAPPREVIEW 206 -#define UI_SKILL 207 -#define UI_BLUETEAMNAME 208 -#define UI_REDTEAMNAME 209 -#define UI_BLUETEAM1 210 -#define UI_BLUETEAM2 211 -#define UI_BLUETEAM3 212 -#define UI_BLUETEAM4 213 -#define UI_BLUETEAM5 214 -#define UI_REDTEAM1 215 -#define UI_REDTEAM2 216 -#define UI_REDTEAM3 217 -#define UI_REDTEAM4 218 -#define UI_REDTEAM5 219 -#define UI_NETSOURCE 220 -#define UI_NETMAPPREVIEW 221 -#define UI_NETFILTER 222 -#define UI_TIER 223 -#define UI_OPPONENTMODEL 224 -#define UI_TIERMAP1 225 -#define UI_TIERMAP2 226 -#define UI_TIERMAP3 227 -#define UI_PLAYERLOGO 228 -#define UI_OPPONENTLOGO 229 -#define UI_PLAYERLOGO_METAL 230 -#define UI_OPPONENTLOGO_METAL 231 -#define UI_PLAYERLOGO_NAME 232 -#define UI_OPPONENTLOGO_NAME 233 -#define UI_TIER_MAPNAME 234 -#define UI_TIER_GAMETYPE 235 -#define UI_ALLMAPS_SELECTION 236 -#define UI_OPPONENT_NAME 237 -#define UI_VOTE_KICK 238 -#define UI_BOTNAME 239 -#define UI_BOTSKILL 240 -#define UI_REDBLUE 241 -#define UI_CROSSHAIR 242 -#define UI_SELECTEDPLAYER 243 -#define UI_MAPCINEMATIC 244 -#define UI_NETGAMETYPE 245 -#define UI_NETMAPCINEMATIC 246 -#define UI_SERVERREFRESHDATE 247 -#define UI_SERVERMOTD 248 -#define UI_GLINFO 249 -#define UI_KEYBINDSTATUS 250 -#define UI_CLANCINEMATIC 251 -#define UI_MAP_TIMETOBEAT 252 -#define UI_JOINGAMETYPE 253 -#define UI_PREVIEWCINEMATIC 254 -#define UI_STARTMAPCINEMATIC 255 -#define UI_MAPS_SELECTION 256 - -#define VOICECHAT_GETFLAG "getflag" // command someone to get the flag -#define VOICECHAT_OFFENSE "offense" // command someone to go on offense -#define VOICECHAT_DEFEND "defend" // command someone to go on defense -#define VOICECHAT_DEFENDFLAG "defendflag" // command someone to defend the flag -#define VOICECHAT_PATROL "patrol" // command someone to go on patrol (roam) -#define VOICECHAT_CAMP "camp" // command someone to camp (we don't have sounds for this one) -#define VOICECHAT_FOLLOWME "followme" // command someone to follow you -#define VOICECHAT_RETURNFLAG "returnflag" // command someone to return our flag -#define VOICECHAT_FOLLOWFLAGCARRIER "followflagcarrier" // command someone to follow the flag carrier -#define VOICECHAT_YES "yes" // yes, affirmative, etc. -#define VOICECHAT_NO "no" // no, negative, etc. -#define VOICECHAT_ONGETFLAG "ongetflag" // I'm getting the flag -#define VOICECHAT_ONOFFENSE "onoffense" // I'm on offense -#define VOICECHAT_ONDEFENSE "ondefense" // I'm on defense -#define VOICECHAT_ONPATROL "onpatrol" // I'm on patrol (roaming) -#define VOICECHAT_ONCAMPING "oncamp" // I'm camping somewhere -#define VOICECHAT_ONFOLLOW "onfollow" // I'm following -#define VOICECHAT_ONFOLLOWCARRIER "onfollowcarrier" // I'm following the flag carrier -#define VOICECHAT_ONRETURNFLAG "onreturnflag" // I'm returning our flag -#define VOICECHAT_INPOSITION "inposition" // I'm in position -#define VOICECHAT_IHAVEFLAG "ihaveflag" // I have the flag -#define VOICECHAT_BASEATTACK "baseattack" // the base is under attack -#define VOICECHAT_ENEMYHASFLAG "enemyhasflag" // the enemy has our flag (CTF) -#define VOICECHAT_STARTLEADER "startleader" // I'm the leader -#define VOICECHAT_STOPLEADER "stopleader" // I resign leadership -#define VOICECHAT_TRASH "trash" // lots of trash talk -#define VOICECHAT_WHOISLEADER "whoisleader" // who is the team leader -#define VOICECHAT_WANTONDEFENSE "wantondefense" // I want to be on defense -#define VOICECHAT_WANTONOFFENSE "wantonoffense" // I want to be on offense -#define VOICECHAT_KILLINSULT "kill_insult" // I just killed you -#define VOICECHAT_TAUNT "taunt" // I want to taunt you -#define VOICECHAT_DEATHINSULT "death_insult" // you just killed me -#define VOICECHAT_KILLGAUNTLET "kill_gauntlet" // I just killed you with the gauntlet -#define VOICECHAT_PRAISE "praise" // you did something good + +#define ITEM_TYPE_TEXT 0 // simple text +#define ITEM_TYPE_BUTTON 1 // button, basically text with a border +#define ITEM_TYPE_RADIOBUTTON 2 // toggle button, may be grouped +#define ITEM_TYPE_CHECKBOX 3 // check box +#define ITEM_TYPE_EDITFIELD 4 // editable text, associated with a cvar +#define ITEM_TYPE_COMBO 5 // drop down list +#define ITEM_TYPE_LISTBOX 6 // scrollable list +#define ITEM_TYPE_MODEL 7 // model +#define ITEM_TYPE_OWNERDRAW 8 // owner draw, name specs what it is +#define ITEM_TYPE_NUMERICFIELD 9 // editable text, associated with a cvar +#define ITEM_TYPE_SLIDER 10 // mouse speed, volume, etc. +#define ITEM_TYPE_YESNO 11 // yes no cvar setting +#define ITEM_TYPE_MULTI 12 // multiple list setting, enumerated +#define ITEM_TYPE_BIND 13 // multiple list setting, enumerated + +#define ITEM_ALIGN_LEFT 0 // left alignment +#define ITEM_ALIGN_CENTER 1 // center alignment +#define ITEM_ALIGN_RIGHT 2 // right alignment + +#define ITEM_TEXTSTYLE_NORMAL 0 // normal text +#define ITEM_TEXTSTYLE_BLINK 1 // fast blinking +#define ITEM_TEXTSTYLE_PULSE 2 // slow pulsing +#define ITEM_TEXTSTYLE_SHADOWED 3 // drop shadow ( need a color for this ) +#define ITEM_TEXTSTYLE_OUTLINED 4 // drop shadow ( need a color for this ) +#define ITEM_TEXTSTYLE_OUTLINESHADOWED 5 // drop shadow ( need a color for this ) +#define ITEM_TEXTSTYLE_SHADOWEDMORE 6 // drop shadow ( need a color for this ) + +#define WINDOW_BORDER_NONE 0 // no border +#define WINDOW_BORDER_FULL 1 // full border based on border color ( single pixel ) +#define WINDOW_BORDER_HORZ 2 // horizontal borders only +#define WINDOW_BORDER_VERT 3 // vertical borders only +#define WINDOW_BORDER_KCGRADIENT 4 // horizontal border using the gradient bars + +#define WINDOW_STYLE_EMPTY 0 // no background +#define WINDOW_STYLE_FILLED 1 // filled with background color +#define WINDOW_STYLE_GRADIENT 2 // gradient bar based on background color +#define WINDOW_STYLE_SHADER 3 // gradient bar based on background color +#define WINDOW_STYLE_TEAMCOLOR 4 // team color +#define WINDOW_STYLE_CINEMATIC 5 // cinematic + +#define MENU_TRUE 1 // uh.. true +#define MENU_FALSE 0 // and false + +#define HUD_VERTICAL 0x00 +#define HUD_HORIZONTAL 0x01 + +// list box element types +#define LISTBOX_TEXT 0x00 +#define LISTBOX_IMAGE 0x01 + +// list feeders +#define FEEDER_HEADS 0x00 // model heads +#define FEEDER_MAPS 0x01 // text maps based on game type +#define FEEDER_SERVERS 0x02 // servers +#define FEEDER_CLANS 0x03 // clan names +#define FEEDER_ALLMAPS 0x04 // all maps available, in graphic format +#define FEEDER_REDTEAM_LIST 0x05 // red team members +#define FEEDER_BLUETEAM_LIST 0x06 // blue team members +#define FEEDER_PLAYER_LIST 0x07 // players +#define FEEDER_TEAM_LIST 0x08 // team members for team voting +#define FEEDER_MODS 0x09 // team members for team voting +#define FEEDER_DEMOS 0x0a // team members for team voting +#define FEEDER_SCOREBOARD 0x0b // team members for team voting +#define FEEDER_Q3HEADS 0x0c // model heads +#define FEEDER_SERVERSTATUS 0x0d // server status +#define FEEDER_FINDPLAYER 0x0e // find player +#define FEEDER_CINEMATICS 0x0f // cinematics + +// display flags +#define CG_SHOW_BLUE_TEAM_HAS_REDFLAG 0x00000001 +#define CG_SHOW_RED_TEAM_HAS_BLUEFLAG 0x00000002 +#define CG_SHOW_ANYTEAMGAME 0x00000004 +#define CG_SHOW_HARVESTER 0x00000008 +#define CG_SHOW_ONEFLAG 0x00000010 +#define CG_SHOW_CTF 0x00000020 +#define CG_SHOW_OBELISK 0x00000040 +#define CG_SHOW_HEALTHCRITICAL 0x00000080 +#define CG_SHOW_SINGLEPLAYER 0x00000100 +#define CG_SHOW_TOURNAMENT 0x00000200 +#define CG_SHOW_DURINGINCOMINGVOICE 0x00000400 +#define CG_SHOW_IF_PLAYER_HAS_FLAG 0x00000800 +#define CG_SHOW_LANPLAYONLY 0x00001000 +#define CG_SHOW_MINED 0x00002000 +#define CG_SHOW_HEALTHOK 0x00004000 +#define CG_SHOW_TEAMINFO 0x00008000 +#define CG_SHOW_NOTEAMINFO 0x00010000 +#define CG_SHOW_OTHERTEAMHASFLAG 0x00020000 +#define CG_SHOW_YOURTEAMHASENEMYFLAG 0x00040000 +#define CG_SHOW_ANYNONTEAMGAME 0x00080000 +#define CG_SHOW_2DONLY 0x10000000 + + +#define UI_SHOW_LEADER 0x00000001 +#define UI_SHOW_NOTLEADER 0x00000002 +#define UI_SHOW_FAVORITESERVERS 0x00000004 +#define UI_SHOW_ANYNONTEAMGAME 0x00000008 +#define UI_SHOW_ANYTEAMGAME 0x00000010 +#define UI_SHOW_NEWHIGHSCORE 0x00000020 +#define UI_SHOW_DEMOAVAILABLE 0x00000040 +#define UI_SHOW_NEWBESTTIME 0x00000080 +#define UI_SHOW_FFA 0x00000100 +#define UI_SHOW_NOTFFA 0x00000200 +#define UI_SHOW_NETANYNONTEAMGAME 0x00000400 +#define UI_SHOW_NETANYTEAMGAME 0x00000800 +#define UI_SHOW_NOTFAVORITESERVERS 0x00001000 + + + + +// owner draw types +// ideally these should be done outside of this file but +// this makes it much easier for the macro expansion to +// convert them for the designers ( from the .menu files ) +#define CG_OWNERDRAW_BASE 1 +#define CG_PLAYER_ARMOR_ICON 1 +#define CG_PLAYER_ARMOR_VALUE 2 +#define CG_PLAYER_HEAD 3 +#define CG_PLAYER_HEALTH 4 +#define CG_PLAYER_AMMO_ICON 5 +#define CG_PLAYER_AMMO_VALUE 6 +#define CG_SELECTEDPLAYER_HEAD 7 +#define CG_SELECTEDPLAYER_NAME 8 +#define CG_SELECTEDPLAYER_LOCATION 9 +#define CG_SELECTEDPLAYER_STATUS 10 +#define CG_SELECTEDPLAYER_WEAPON 11 +#define CG_SELECTEDPLAYER_POWERUP 12 + +#define CG_FLAGCARRIER_HEAD 13 +#define CG_FLAGCARRIER_NAME 14 +#define CG_FLAGCARRIER_LOCATION 15 +#define CG_FLAGCARRIER_STATUS 16 +#define CG_FLAGCARRIER_WEAPON 17 +#define CG_FLAGCARRIER_POWERUP 18 + +#define CG_PLAYER_ITEM 19 +#define CG_PLAYER_SCORE 20 + +#define CG_BLUE_FLAGHEAD 21 +#define CG_BLUE_FLAGSTATUS 22 +#define CG_BLUE_FLAGNAME 23 +#define CG_RED_FLAGHEAD 24 +#define CG_RED_FLAGSTATUS 25 +#define CG_RED_FLAGNAME 26 + +#define CG_BLUE_SCORE 27 +#define CG_RED_SCORE 28 +#define CG_RED_NAME 29 +#define CG_BLUE_NAME 30 +#define CG_HARVESTER_SKULLS 31 // only shows in harvester +#define CG_ONEFLAG_STATUS 32 // only shows in one flag +#define CG_PLAYER_LOCATION 33 +#define CG_TEAM_COLOR 34 +#define CG_CTF_POWERUP 35 + +#define CG_AREA_POWERUP 36 +#define CG_AREA_LAGOMETER 37 // painted with old system +#define CG_PLAYER_HASFLAG 38 +#define CG_GAME_TYPE 39 // not done + +#define CG_SELECTEDPLAYER_ARMOR 40 +#define CG_SELECTEDPLAYER_HEALTH 41 +#define CG_PLAYER_STATUS 42 +#define CG_FRAGGED_MSG 43 // painted with old system +#define CG_PROXMINED_MSG 44 // painted with old system +#define CG_AREA_FPSINFO 45 // painted with old system +#define CG_AREA_SYSTEMCHAT 46 // painted with old system +#define CG_AREA_TEAMCHAT 47 // painted with old system +#define CG_AREA_CHAT 48 // painted with old system +#define CG_GAME_STATUS 49 +#define CG_KILLER 50 +#define CG_PLAYER_ARMOR_ICON2D 51 +#define CG_PLAYER_AMMO_ICON2D 52 +#define CG_ACCURACY 53 +#define CG_ASSISTS 54 +#define CG_DEFEND 55 +#define CG_EXCELLENT 56 +#define CG_IMPRESSIVE 57 +#define CG_PERFECT 58 +#define CG_GAUNTLET 59 +#define CG_SPECTATORS 60 +#define CG_TEAMINFO 61 +#define CG_VOICE_HEAD 62 +#define CG_VOICE_NAME 63 +#define CG_PLAYER_HASFLAG2D 64 +#define CG_HARVESTER_SKULLS2D 65 // only shows in harvester +#define CG_CAPFRAGLIMIT 66 +#define CG_1STPLACE 67 +#define CG_2NDPLACE 68 +#define CG_CAPTURES 69 + + + + +#define UI_OWNERDRAW_BASE 200 +#define UI_HANDICAP 200 +#define UI_EFFECTS 201 +#define UI_PLAYERMODEL 202 +#define UI_CLANNAME 203 +#define UI_CLANLOGO 204 +#define UI_GAMETYPE 205 +#define UI_MAPPREVIEW 206 +#define UI_SKILL 207 +#define UI_BLUETEAMNAME 208 +#define UI_REDTEAMNAME 209 +#define UI_BLUETEAM1 210 +#define UI_BLUETEAM2 211 +#define UI_BLUETEAM3 212 +#define UI_BLUETEAM4 213 +#define UI_BLUETEAM5 214 +#define UI_REDTEAM1 215 +#define UI_REDTEAM2 216 +#define UI_REDTEAM3 217 +#define UI_REDTEAM4 218 +#define UI_REDTEAM5 219 +#define UI_NETSOURCE 220 +#define UI_NETMAPPREVIEW 221 +#define UI_NETFILTER 222 +#define UI_TIER 223 +#define UI_OPPONENTMODEL 224 +#define UI_TIERMAP1 225 +#define UI_TIERMAP2 226 +#define UI_TIERMAP3 227 +#define UI_PLAYERLOGO 228 +#define UI_OPPONENTLOGO 229 +#define UI_PLAYERLOGO_METAL 230 +#define UI_OPPONENTLOGO_METAL 231 +#define UI_PLAYERLOGO_NAME 232 +#define UI_OPPONENTLOGO_NAME 233 +#define UI_TIER_MAPNAME 234 +#define UI_TIER_GAMETYPE 235 +#define UI_ALLMAPS_SELECTION 236 +#define UI_OPPONENT_NAME 237 +#define UI_VOTE_KICK 238 +#define UI_BOTNAME 239 +#define UI_BOTSKILL 240 +#define UI_REDBLUE 241 +#define UI_CROSSHAIR 242 +#define UI_SELECTEDPLAYER 243 +#define UI_MAPCINEMATIC 244 +#define UI_NETGAMETYPE 245 +#define UI_NETMAPCINEMATIC 246 +#define UI_SERVERREFRESHDATE 247 +#define UI_SERVERMOTD 248 +#define UI_GLINFO 249 +#define UI_KEYBINDSTATUS 250 +#define UI_CLANCINEMATIC 251 +#define UI_MAP_TIMETOBEAT 252 +#define UI_JOINGAMETYPE 253 +#define UI_PREVIEWCINEMATIC 254 +#define UI_STARTMAPCINEMATIC 255 +#define UI_MAPS_SELECTION 256 + +#define VOICECHAT_GETFLAG "getflag" // command someone to get the flag +#define VOICECHAT_OFFENSE "offense" // command someone to go on offense +#define VOICECHAT_DEFEND "defend" // command someone to go on defense +#define VOICECHAT_DEFENDFLAG "defendflag" // command someone to defend the flag +#define VOICECHAT_PATROL "patrol" // command someone to go on patrol (roam) +#define VOICECHAT_CAMP "camp" // command someone to camp (we don't have sounds for this one) +#define VOICECHAT_FOLLOWME "followme" // command someone to follow you +#define VOICECHAT_RETURNFLAG "returnflag" // command someone to return our flag +#define VOICECHAT_FOLLOWFLAGCARRIER "followflagcarrier" // command someone to follow the flag carrier +#define VOICECHAT_YES "yes" // yes, affirmative, etc. +#define VOICECHAT_NO "no" // no, negative, etc. +#define VOICECHAT_ONGETFLAG "ongetflag" // I'm getting the flag +#define VOICECHAT_ONOFFENSE "onoffense" // I'm on offense +#define VOICECHAT_ONDEFENSE "ondefense" // I'm on defense +#define VOICECHAT_ONPATROL "onpatrol" // I'm on patrol (roaming) +#define VOICECHAT_ONCAMPING "oncamp" // I'm camping somewhere +#define VOICECHAT_ONFOLLOW "onfollow" // I'm following +#define VOICECHAT_ONFOLLOWCARRIER "onfollowcarrier" // I'm following the flag carrier +#define VOICECHAT_ONRETURNFLAG "onreturnflag" // I'm returning our flag +#define VOICECHAT_INPOSITION "inposition" // I'm in position +#define VOICECHAT_IHAVEFLAG "ihaveflag" // I have the flag +#define VOICECHAT_BASEATTACK "baseattack" // the base is under attack +#define VOICECHAT_ENEMYHASFLAG "enemyhasflag" // the enemy has our flag (CTF) +#define VOICECHAT_STARTLEADER "startleader" // I'm the leader +#define VOICECHAT_STOPLEADER "stopleader" // I resign leadership +#define VOICECHAT_TRASH "trash" // lots of trash talk +#define VOICECHAT_WHOISLEADER "whoisleader" // who is the team leader +#define VOICECHAT_WANTONDEFENSE "wantondefense" // I want to be on defense +#define VOICECHAT_WANTONOFFENSE "wantonoffense" // I want to be on offense +#define VOICECHAT_KILLINSULT "kill_insult" // I just killed you +#define VOICECHAT_TAUNT "taunt" // I want to taunt you +#define VOICECHAT_DEATHINSULT "death_insult" // you just killed me +#define VOICECHAT_KILLGAUNTLET "kill_gauntlet" // I just killed you with the gauntlet +#define VOICECHAT_PRAISE "praise" // you did something good diff --git a/dlls/game/chars.h b/dlls/game/chars.h index 98d046e..45682a3 100644 --- a/dlls/game/chars.h +++ b/dlls/game/chars.h @@ -1,124 +1,124 @@ -// Copyright (C) 1999-2000 Id Software, Inc. -// -//=========================================================================== -// -// Name: chars.h -// Function: bot characteristics -// Programmer: Mr Elusive (MrElusive@idsoftware.com) -// Last update: 1999-09-08 -// Tab Size: 4 (real tabs) -//=========================================================================== - - -//======================================================== -//======================================================== -//name -#define CHARACTERISTIC_NAME 0 //string -//gender of the bot -#define CHARACTERISTIC_GENDER 1 //string ("male", "female", "it") -//attack skill -// > 0.0 && < 0.2 = don't move -// > 0.3 && < 1.0 = aim at enemy during retreat -// > 0.0 && < 0.4 = only move forward/backward -// >= 0.4 && < 1.0 = circle strafing -// > 0.7 && < 1.0 = random strafe direction change -#define CHARACTERISTIC_ATTACK_SKILL 2 //float [0, 1] -//weapon weight file -#define CHARACTERISTIC_WEAPONWEIGHTS 3 //string -//view angle difference to angle change factor -#define CHARACTERISTIC_VIEW_FACTOR 4 //float <0, 1] -//maximum view angle change -#define CHARACTERISTIC_VIEW_MAXCHANGE 5 //float [1, 360] -//reaction time in seconds -#define CHARACTERISTIC_REACTIONTIME 6 //float [0, 5] -//accuracy when aiming -#define CHARACTERISTIC_AIM_ACCURACY 7 //float [0, 1] -//weapon specific aim accuracy -#define CHARACTERISTIC_AIM_ACCURACY_MACHINEGUN 8 //float [0, 1] -#define CHARACTERISTIC_AIM_ACCURACY_SHOTGUN 9 //float [0, 1] -#define CHARACTERISTIC_AIM_ACCURACY_ROCKETLAUNCHER 10 //float [0, 1] -#define CHARACTERISTIC_AIM_ACCURACY_GRENADELAUNCHER 11 //float [0, 1] -#define CHARACTERISTIC_AIM_ACCURACY_LIGHTNING 12 -#define CHARACTERISTIC_AIM_ACCURACY_PLASMAGUN 13 //float [0, 1] -#define CHARACTERISTIC_AIM_ACCURACY_RAILGUN 14 -#define CHARACTERISTIC_AIM_ACCURACY_BFG10K 15 //float [0, 1] -//skill when aiming -// > 0.0 && < 0.9 = aim is affected by enemy movement -// > 0.4 && <= 0.8 = enemy linear leading -// > 0.8 && <= 1.0 = enemy exact movement leading -// > 0.5 && <= 1.0 = prediction shots when enemy is not visible -// > 0.6 && <= 1.0 = splash damage by shooting nearby geometry -#define CHARACTERISTIC_AIM_SKILL 16 //float [0, 1] -//weapon specific aim skill -#define CHARACTERISTIC_AIM_SKILL_ROCKETLAUNCHER 17 //float [0, 1] -#define CHARACTERISTIC_AIM_SKILL_GRENADELAUNCHER 18 //float [0, 1] -#define CHARACTERISTIC_AIM_SKILL_PLASMAGUN 19 //float [0, 1] -#define CHARACTERISTIC_AIM_SKILL_BFG10K 20 //float [0, 1] -//======================================================== -//chat -//======================================================== -//file with chats -#define CHARACTERISTIC_CHAT_FILE 21 //string -//name of the chat character -#define CHARACTERISTIC_CHAT_NAME 22 //string -//characters per minute type speed -#define CHARACTERISTIC_CHAT_CPM 23 //integer [1, 4000] -//tendency to insult/praise -#define CHARACTERISTIC_CHAT_INSULT 24 //float [0, 1] -//tendency to chat misc -#define CHARACTERISTIC_CHAT_MISC 25 //float [0, 1] -//tendency to chat at start or end of level -#define CHARACTERISTIC_CHAT_STARTENDLEVEL 26 //float [0, 1] -//tendency to chat entering or exiting the game -#define CHARACTERISTIC_CHAT_ENTEREXITGAME 27 //float [0, 1] -//tendency to chat when killed someone -#define CHARACTERISTIC_CHAT_KILL 28 //float [0, 1] -//tendency to chat when died -#define CHARACTERISTIC_CHAT_DEATH 29 //float [0, 1] -//tendency to chat when enemy suicides -#define CHARACTERISTIC_CHAT_ENEMYSUICIDE 30 //float [0, 1] -//tendency to chat when hit while talking -#define CHARACTERISTIC_CHAT_HITTALKING 31 //float [0, 1] -//tendency to chat when bot was hit but didn't dye -#define CHARACTERISTIC_CHAT_HITNODEATH 32 //float [0, 1] -//tendency to chat when bot hit the enemy but enemy didn't dye -#define CHARACTERISTIC_CHAT_HITNOKILL 33 //float [0, 1] -//tendency to randomly chat -#define CHARACTERISTIC_CHAT_RANDOM 34 //float [0, 1] -//tendency to reply -#define CHARACTERISTIC_CHAT_REPLY 35 //float [0, 1] -//======================================================== -//movement -//======================================================== -//tendency to crouch -#define CHARACTERISTIC_CROUCHER 36 //float [0, 1] -//tendency to jump -#define CHARACTERISTIC_JUMPER 37 //float [0, 1] -//tendency to walk -#define CHARACTERISTIC_WALKER 48 //float [0, 1] -//tendency to jump using a weapon -#define CHARACTERISTIC_WEAPONJUMPING 38 //float [0, 1] -//tendency to use the grapple hook when available -#define CHARACTERISTIC_GRAPPLE_USER 39 //float [0, 1] //use this!! -//======================================================== -//goal -//======================================================== -//item weight file -#define CHARACTERISTIC_ITEMWEIGHTS 40 //string -//the aggression of the bot -#define CHARACTERISTIC_AGGRESSION 41 //float [0, 1] -//the self preservation of the bot (rockets near walls etc.) -#define CHARACTERISTIC_SELFPRESERVATION 42 //float [0, 1] -//how likely the bot is to take revenge -#define CHARACTERISTIC_VENGEFULNESS 43 //float [0, 1] //use this!! -//tendency to camp -#define CHARACTERISTIC_CAMPER 44 //float [0, 1] -//======================================================== -//======================================================== -//tendency to get easy frags -#define CHARACTERISTIC_EASY_FRAGGER 45 //float [0, 1] -//how alert the bot is (view distance) -#define CHARACTERISTIC_ALERTNESS 46 //float [0, 1] -//how much the bot fires it's weapon -#define CHARACTERISTIC_FIRETHROTTLE 47 //float [0, 1] - +// Copyright (C) 1999-2000 Id Software, Inc. +// +//=========================================================================== +// +// Name: chars.h +// Function: bot characteristics +// Programmer: Mr Elusive (MrElusive@idsoftware.com) +// Last update: 1999-09-08 +// Tab Size: 4 (real tabs) +//=========================================================================== + + +//======================================================== +//======================================================== +//name +#define CHARACTERISTIC_NAME 0 //string +//gender of the bot +#define CHARACTERISTIC_GENDER 1 //string ("male", "female", "it") +//attack skill +// > 0.0 && < 0.2 = don't move +// > 0.3 && < 1.0 = aim at enemy during retreat +// > 0.0 && < 0.4 = only move forward/backward +// >= 0.4 && < 1.0 = circle strafing +// > 0.7 && < 1.0 = random strafe direction change +#define CHARACTERISTIC_ATTACK_SKILL 2 //float [0, 1] +//weapon weight file +#define CHARACTERISTIC_WEAPONWEIGHTS 3 //string +//view angle difference to angle change factor +#define CHARACTERISTIC_VIEW_FACTOR 4 //float <0, 1] +//maximum view angle change +#define CHARACTERISTIC_VIEW_MAXCHANGE 5 //float [1, 360] +//reaction time in seconds +#define CHARACTERISTIC_REACTIONTIME 6 //float [0, 5] +//accuracy when aiming +#define CHARACTERISTIC_AIM_ACCURACY 7 //float [0, 1] +//weapon specific aim accuracy +#define CHARACTERISTIC_AIM_ACCURACY_MACHINEGUN 8 //float [0, 1] +#define CHARACTERISTIC_AIM_ACCURACY_SHOTGUN 9 //float [0, 1] +#define CHARACTERISTIC_AIM_ACCURACY_ROCKETLAUNCHER 10 //float [0, 1] +#define CHARACTERISTIC_AIM_ACCURACY_GRENADELAUNCHER 11 //float [0, 1] +#define CHARACTERISTIC_AIM_ACCURACY_LIGHTNING 12 +#define CHARACTERISTIC_AIM_ACCURACY_PLASMAGUN 13 //float [0, 1] +#define CHARACTERISTIC_AIM_ACCURACY_RAILGUN 14 +#define CHARACTERISTIC_AIM_ACCURACY_BFG10K 15 //float [0, 1] +//skill when aiming +// > 0.0 && < 0.9 = aim is affected by enemy movement +// > 0.4 && <= 0.8 = enemy linear leading +// > 0.8 && <= 1.0 = enemy exact movement leading +// > 0.5 && <= 1.0 = prediction shots when enemy is not visible +// > 0.6 && <= 1.0 = splash damage by shooting nearby geometry +#define CHARACTERISTIC_AIM_SKILL 16 //float [0, 1] +//weapon specific aim skill +#define CHARACTERISTIC_AIM_SKILL_ROCKETLAUNCHER 17 //float [0, 1] +#define CHARACTERISTIC_AIM_SKILL_GRENADELAUNCHER 18 //float [0, 1] +#define CHARACTERISTIC_AIM_SKILL_PLASMAGUN 19 //float [0, 1] +#define CHARACTERISTIC_AIM_SKILL_BFG10K 20 //float [0, 1] +//======================================================== +//chat +//======================================================== +//file with chats +#define CHARACTERISTIC_CHAT_FILE 21 //string +//name of the chat character +#define CHARACTERISTIC_CHAT_NAME 22 //string +//characters per minute type speed +#define CHARACTERISTIC_CHAT_CPM 23 //integer [1, 4000] +//tendency to insult/praise +#define CHARACTERISTIC_CHAT_INSULT 24 //float [0, 1] +//tendency to chat misc +#define CHARACTERISTIC_CHAT_MISC 25 //float [0, 1] +//tendency to chat at start or end of level +#define CHARACTERISTIC_CHAT_STARTENDLEVEL 26 //float [0, 1] +//tendency to chat entering or exiting the game +#define CHARACTERISTIC_CHAT_ENTEREXITGAME 27 //float [0, 1] +//tendency to chat when killed someone +#define CHARACTERISTIC_CHAT_KILL 28 //float [0, 1] +//tendency to chat when died +#define CHARACTERISTIC_CHAT_DEATH 29 //float [0, 1] +//tendency to chat when enemy suicides +#define CHARACTERISTIC_CHAT_ENEMYSUICIDE 30 //float [0, 1] +//tendency to chat when hit while talking +#define CHARACTERISTIC_CHAT_HITTALKING 31 //float [0, 1] +//tendency to chat when bot was hit but didn't dye +#define CHARACTERISTIC_CHAT_HITNODEATH 32 //float [0, 1] +//tendency to chat when bot hit the enemy but enemy didn't dye +#define CHARACTERISTIC_CHAT_HITNOKILL 33 //float [0, 1] +//tendency to randomly chat +#define CHARACTERISTIC_CHAT_RANDOM 34 //float [0, 1] +//tendency to reply +#define CHARACTERISTIC_CHAT_REPLY 35 //float [0, 1] +//======================================================== +//movement +//======================================================== +//tendency to crouch +#define CHARACTERISTIC_CROUCHER 36 //float [0, 1] +//tendency to jump +#define CHARACTERISTIC_JUMPER 37 //float [0, 1] +//tendency to walk +#define CHARACTERISTIC_WALKER 48 //float [0, 1] +//tendency to jump using a weapon +#define CHARACTERISTIC_WEAPONJUMPING 38 //float [0, 1] +//tendency to use the grapple hook when available +#define CHARACTERISTIC_GRAPPLE_USER 39 //float [0, 1] //use this!! +//======================================================== +//goal +//======================================================== +//item weight file +#define CHARACTERISTIC_ITEMWEIGHTS 40 //string +//the aggression of the bot +#define CHARACTERISTIC_AGGRESSION 41 //float [0, 1] +//the self preservation of the bot (rockets near walls etc.) +#define CHARACTERISTIC_SELFPRESERVATION 42 //float [0, 1] +//how likely the bot is to take revenge +#define CHARACTERISTIC_VENGEFULNESS 43 //float [0, 1] //use this!! +//tendency to camp +#define CHARACTERISTIC_CAMPER 44 //float [0, 1] +//======================================================== +//======================================================== +//tendency to get easy frags +#define CHARACTERISTIC_EASY_FRAGGER 45 //float [0, 1] +//how alert the bot is (view distance) +#define CHARACTERISTIC_ALERTNESS 46 //float [0, 1] +//how much the bot fires it's weapon +#define CHARACTERISTIC_FIRETHROTTLE 47 //float [0, 1] + diff --git a/dlls/game/inv.h b/dlls/game/inv.h index aa43eb8..ac161fd 100644 --- a/dlls/game/inv.h +++ b/dlls/game/inv.h @@ -1,152 +1,152 @@ - -#define INVENTORY_NONE 0 -//armor -#define INVENTORY_ARMOR 1 -//weapons -#define INVENTORY_PHASER 4 -#define INVENTORY_SHOTGUN 5 -#define INVENTORY_MACHINEGUN 6 -#define INVENTORY_GRENADELAUNCHER 7 -#define INVENTORY_ROCKETLAUNCHER 8 -#define INVENTORY_LIGHTNING 9 -#define INVENTORY_RAILGUN 10 -#define INVENTORY_PLASMAGUN 11 -#define INVENTORY_BFG10K 13 -#define INVENTORY_GRAPPLINGHOOK 14 -#define INVENTORY_NAILGUN 15 -#define INVENTORY_PROXLAUNCHER 16 -#define INVENTORY_CHAINGUN 17 -//ammo -#define INVENTORY_PLASMA 18 -#define INVENTORY_BULLETS 19 -#define INVENTORY_FED 20 -#define INVENTORY_IDRYLL 21 - -#define INVENTORY_BURSTRIFLE 22 - -/* -#define INVENTORY_GRENADES 20 -#define INVENTORY_CELLS 21 -#define INVENTORY_LIGHTNINGAMMO 22 -#define INVENTORY_ROCKETS 23 -#define INVENTORY_SLUGS 24 -#define INVENTORY_BFGAMMO 25 -#define INVENTORY_NAILS 26 -#define INVENTORY_MINES 27 -#define INVENTORY_BELT 28 -*/ -//powerups -#define INVENTORY_HEALTH 29 -#define INVENTORY_TELEPORTER 30 -#define INVENTORY_MEDKIT 31 -#define INVENTORY_KAMIKAZE 32 -#define INVENTORY_PORTAL 33 -#define INVENTORY_INVULNERABILITY 34 -#define INVENTORY_QUAD 35 -#define INVENTORY_ENVIRONMENTSUIT 36 -#define INVENTORY_HASTE 37 -#define INVENTORY_INVISIBILITY 38 -#define INVENTORY_REGEN 39 -#define INVENTORY_FLIGHT 40 -#define INVENTORY_SCOUT 41 -#define INVENTORY_GUARD 42 -#define INVENTORY_DOUBLER 43 -#define INVENTORY_AMMOREGEN 44 - -#define INVENTORY_REDFLAG 45 -#define INVENTORY_BLUEFLAG 46 -#define INVENTORY_NEUTRALFLAG 47 -#define INVENTORY_REDCUBE 48 -#define INVENTORY_BLUECUBE 49 -//enemy stuff -#define ENEMY_HORIZONTAL_DIST 200 -#define ENEMY_HEIGHT 201 -#define NUM_VISIBLE_ENEMIES 202 -#define NUM_VISIBLE_TEAMMATES 203 - -// if running the mission pack -#ifdef MISSIONPACK - -//#error "running mission pack" - -#endif - -//item numbers (make sure they are in sync with bg_itemlist in bg_misc.c) -#define MODELINDEX_ARMORSHARD 1 -#define MODELINDEX_ARMORCOMBAT 2 -#define MODELINDEX_ARMORBODY 3 -#define MODELINDEX_HEALTHSMALL 4 -#define MODELINDEX_HEALTH 5 -#define MODELINDEX_HEALTHLARGE 6 -#define MODELINDEX_HEALTHMEGA 7 - -#define MODELINDEX_GAUNTLET 8 -#define MODELINDEX_SHOTGUN 9 -#define MODELINDEX_MACHINEGUN 10 -#define MODELINDEX_GRENADELAUNCHER 11 -#define MODELINDEX_ROCKETLAUNCHER 12 -#define MODELINDEX_LIGHTNING 13 -#define MODELINDEX_RAILGUN 14 -#define MODELINDEX_PLASMAGUN 15 -#define MODELINDEX_BFG10K 16 -#define MODELINDEX_GRAPPLINGHOOK 17 - -#define MODELINDEX_SHELLS 18 -#define MODELINDEX_BULLETS 19 -#define MODELINDEX_GRENADES 20 -#define MODELINDEX_CELLS 21 -#define MODELINDEX_LIGHTNINGAMMO 22 -#define MODELINDEX_ROCKETS 23 -#define MODELINDEX_SLUGS 24 -#define MODELINDEX_BFGAMMO 25 - -#define MODELINDEX_TELEPORTER 26 -#define MODELINDEX_MEDKIT 27 -#define MODELINDEX_QUAD 28 -#define MODELINDEX_ENVIRONMENTSUIT 29 -#define MODELINDEX_HASTE 30 -#define MODELINDEX_INVISIBILITY 31 -#define MODELINDEX_REGEN 32 -#define MODELINDEX_FLIGHT 33 - -#define MODELINDEX_REDFLAG 34 -#define MODELINDEX_BLUEFLAG 35 - -// mission pack only defines - -#define MODELINDEX_KAMIKAZE 36 -#define MODELINDEX_PORTAL 37 -#define MODELINDEX_INVULNERABILITY 38 - -#define MODELINDEX_NAILS 39 -#define MODELINDEX_MINES 40 -#define MODELINDEX_BELT 41 - -#define MODELINDEX_SCOUT 42 -#define MODELINDEX_GUARD 43 -#define MODELINDEX_DOUBLER 44 -#define MODELINDEX_AMMOREGEN 45 - -#define MODELINDEX_NEUTRALFLAG 46 -#define MODELINDEX_REDCUBE 47 -#define MODELINDEX_BLUECUBE 48 - -#define MODELINDEX_NAILGUN 49 -#define MODELINDEX_PROXLAUNCHER 50 -#define MODELINDEX_CHAINGUN 51 - - -// -#define WEAPONINDEX_PHASER 2 -#define WEAPONINDEX_MACHINEGUN 3 -#define WEAPONINDEX_SHOTGUN 4 -#define WEAPONINDEX_GRENADE_LAUNCHER 5 -#define WEAPONINDEX_ROCKET_LAUNCHER 6 -#define WEAPONINDEX_LIGHTNING 7 -#define WEAPONINDEX_RAILGUN 8 -#define WEAPONINDEX_PLASMAGUN 9 -#define WEAPONINDEX_BFG 10 -#define WEAPONINDEX_GRAPPLING_HOOK 10 -#define WEAPONINDEX_NAILGUN 11 -#define WEAPONINDEX_PROXLAUNCHER 12 -#define WEAPONINDEX_CHAINGUN 13 + +#define INVENTORY_NONE 0 +//armor +#define INVENTORY_ARMOR 1 +//weapons +#define INVENTORY_PHASER 4 +#define INVENTORY_SHOTGUN 5 +#define INVENTORY_MACHINEGUN 6 +#define INVENTORY_GRENADELAUNCHER 7 +#define INVENTORY_ROCKETLAUNCHER 8 +#define INVENTORY_LIGHTNING 9 +#define INVENTORY_RAILGUN 10 +#define INVENTORY_PLASMAGUN 11 +#define INVENTORY_BFG10K 13 +#define INVENTORY_GRAPPLINGHOOK 14 +#define INVENTORY_NAILGUN 15 +#define INVENTORY_PROXLAUNCHER 16 +#define INVENTORY_CHAINGUN 17 +//ammo +#define INVENTORY_PLASMA 18 +#define INVENTORY_BULLETS 19 +#define INVENTORY_FED 20 +#define INVENTORY_IDRYLL 21 + +#define INVENTORY_BURSTRIFLE 22 + +/* +#define INVENTORY_GRENADES 20 +#define INVENTORY_CELLS 21 +#define INVENTORY_LIGHTNINGAMMO 22 +#define INVENTORY_ROCKETS 23 +#define INVENTORY_SLUGS 24 +#define INVENTORY_BFGAMMO 25 +#define INVENTORY_NAILS 26 +#define INVENTORY_MINES 27 +#define INVENTORY_BELT 28 +*/ +//powerups +#define INVENTORY_HEALTH 29 +#define INVENTORY_TELEPORTER 30 +#define INVENTORY_MEDKIT 31 +#define INVENTORY_KAMIKAZE 32 +#define INVENTORY_PORTAL 33 +#define INVENTORY_INVULNERABILITY 34 +#define INVENTORY_QUAD 35 +#define INVENTORY_ENVIRONMENTSUIT 36 +#define INVENTORY_HASTE 37 +#define INVENTORY_INVISIBILITY 38 +#define INVENTORY_REGEN 39 +#define INVENTORY_FLIGHT 40 +#define INVENTORY_SCOUT 41 +#define INVENTORY_GUARD 42 +#define INVENTORY_DOUBLER 43 +#define INVENTORY_AMMOREGEN 44 + +#define INVENTORY_REDFLAG 45 +#define INVENTORY_BLUEFLAG 46 +#define INVENTORY_NEUTRALFLAG 47 +#define INVENTORY_REDCUBE 48 +#define INVENTORY_BLUECUBE 49 +//enemy stuff +#define ENEMY_HORIZONTAL_DIST 200 +#define ENEMY_HEIGHT 201 +#define NUM_VISIBLE_ENEMIES 202 +#define NUM_VISIBLE_TEAMMATES 203 + +// if running the mission pack +#ifdef MISSIONPACK + +//#error "running mission pack" + +#endif + +//item numbers (make sure they are in sync with bg_itemlist in bg_misc.c) +#define MODELINDEX_ARMORSHARD 1 +#define MODELINDEX_ARMORCOMBAT 2 +#define MODELINDEX_ARMORBODY 3 +#define MODELINDEX_HEALTHSMALL 4 +#define MODELINDEX_HEALTH 5 +#define MODELINDEX_HEALTHLARGE 6 +#define MODELINDEX_HEALTHMEGA 7 + +#define MODELINDEX_GAUNTLET 8 +#define MODELINDEX_SHOTGUN 9 +#define MODELINDEX_MACHINEGUN 10 +#define MODELINDEX_GRENADELAUNCHER 11 +#define MODELINDEX_ROCKETLAUNCHER 12 +#define MODELINDEX_LIGHTNING 13 +#define MODELINDEX_RAILGUN 14 +#define MODELINDEX_PLASMAGUN 15 +#define MODELINDEX_BFG10K 16 +#define MODELINDEX_GRAPPLINGHOOK 17 + +#define MODELINDEX_SHELLS 18 +#define MODELINDEX_BULLETS 19 +#define MODELINDEX_GRENADES 20 +#define MODELINDEX_CELLS 21 +#define MODELINDEX_LIGHTNINGAMMO 22 +#define MODELINDEX_ROCKETS 23 +#define MODELINDEX_SLUGS 24 +#define MODELINDEX_BFGAMMO 25 + +#define MODELINDEX_TELEPORTER 26 +#define MODELINDEX_MEDKIT 27 +#define MODELINDEX_QUAD 28 +#define MODELINDEX_ENVIRONMENTSUIT 29 +#define MODELINDEX_HASTE 30 +#define MODELINDEX_INVISIBILITY 31 +#define MODELINDEX_REGEN 32 +#define MODELINDEX_FLIGHT 33 + +#define MODELINDEX_REDFLAG 34 +#define MODELINDEX_BLUEFLAG 35 + +// mission pack only defines + +#define MODELINDEX_KAMIKAZE 36 +#define MODELINDEX_PORTAL 37 +#define MODELINDEX_INVULNERABILITY 38 + +#define MODELINDEX_NAILS 39 +#define MODELINDEX_MINES 40 +#define MODELINDEX_BELT 41 + +#define MODELINDEX_SCOUT 42 +#define MODELINDEX_GUARD 43 +#define MODELINDEX_DOUBLER 44 +#define MODELINDEX_AMMOREGEN 45 + +#define MODELINDEX_NEUTRALFLAG 46 +#define MODELINDEX_REDCUBE 47 +#define MODELINDEX_BLUECUBE 48 + +#define MODELINDEX_NAILGUN 49 +#define MODELINDEX_PROXLAUNCHER 50 +#define MODELINDEX_CHAINGUN 51 + + +// +#define WEAPONINDEX_PHASER 2 +#define WEAPONINDEX_MACHINEGUN 3 +#define WEAPONINDEX_SHOTGUN 4 +#define WEAPONINDEX_GRENADE_LAUNCHER 5 +#define WEAPONINDEX_ROCKET_LAUNCHER 6 +#define WEAPONINDEX_LIGHTNING 7 +#define WEAPONINDEX_RAILGUN 8 +#define WEAPONINDEX_PLASMAGUN 9 +#define WEAPONINDEX_BFG 10 +#define WEAPONINDEX_GRAPPLING_HOOK 10 +#define WEAPONINDEX_NAILGUN 11 +#define WEAPONINDEX_PROXLAUNCHER 12 +#define WEAPONINDEX_CHAINGUN 13 diff --git a/dlls/game/match.h b/dlls/game/match.h index ea14f3d..7fb6a38 100644 --- a/dlls/game/match.h +++ b/dlls/game/match.h @@ -1,122 +1,122 @@ -//=========================================================================== -// -// Name: match.h -// Function: match template defines -// Programmer: Mr Elusive -// Last update: -// Tab Size: 4 (real tabs) -// -//=========================================================================== - -// make sure this is the same character as we use in chats in g_cmd.c -#define EC "\x19" - -//match template contexts -#define MTCONTEXT_MISC 2 -#define MTCONTEXT_INITIALTEAMCHAT 4 -#define MTCONTEXT_TIME 8 -#define MTCONTEXT_TEAMMATE 16 -#define MTCONTEXT_ADDRESSEE 32 -#define MTCONTEXT_PATROLKEYAREA 64 -#define MTCONTEXT_REPLYCHAT 128 -#define MTCONTEXT_CTF 256 - -//message types -#define MSG_NEWLEADER 1 //new leader -#define MSG_ENTERGAME 2 //enter game message -#define MSG_HELP 3 //help someone -#define MSG_ACCOMPANY 4 //accompany someone -#define MSG_DEFENDKEYAREA 5 //defend a key area -#define MSG_RUSHBASE 6 //everyone rush to base -#define MSG_GETFLAG 7 //get the enemy flag -#define MSG_STARTTEAMLEADERSHIP 8 //someone wants to become the team leader -#define MSG_STOPTEAMLEADERSHIP 9 //someone wants to stop being the team leader -#define MSG_WHOISTEAMLAEDER 10 //who is the team leader -#define MSG_WAIT 11 //wait for someone -#define MSG_WHATAREYOUDOING 12 //what are you doing? -#define MSG_JOINSUBTEAM 13 //join a sub-team -#define MSG_LEAVESUBTEAM 14 //leave a sub-team -#define MSG_CREATENEWFORMATION 15 //create a new formation -#define MSG_FORMATIONPOSITION 16 //tell someone his/her position in a formation -#define MSG_FORMATIONSPACE 17 //set the formation intervening space -#define MSG_DOFORMATION 18 //form a known formation -#define MSG_DISMISS 19 //dismiss commanded team mates -#define MSG_CAMP 20 //camp somewhere -#define MSG_CHECKPOINT 21 //remember a check point -#define MSG_PATROL 22 //patrol between certain keypoints -#define MSG_LEADTHEWAY 23 //lead the way -#define MSG_GETITEM 24 //get an item -#define MSG_KILL 25 //kill someone -#define MSG_WHEREAREYOU 26 //where is someone -#define MSG_RETURNFLAG 27 //return the flag -#define MSG_WHATISMYCOMMAND 28 //ask the team leader what to do -#define MSG_WHICHTEAM 29 //ask which team a bot is in -#define MSG_TASKPREFERENCE 30 //tell your teamplay task preference -#define MSG_ATTACKENEMYBASE 31 //attack the enemy base -#define MSG_HARVEST 32 //go harvest -#define MSG_SUICIDE 33 //order to suicide -// -#define MSG_ME 100 -#define MSG_EVERYONE 101 -#define MSG_MULTIPLENAMES 102 -#define MSG_NAME 103 -#define MSG_PATROLKEYAREA 104 -#define MSG_MINUTES 105 -#define MSG_SECONDS 106 -#define MSG_FOREVER 107 -#define MSG_FORALONGTIME 108 -#define MSG_FORAWHILE 109 -// -#define MSG_CHATALL 200 -#define MSG_CHATTEAM 201 -#define MSG_CHATTELL 202 -// -#define MSG_CTF 300 //ctf message - -//command sub types -#define ST_SOMEWHERE 0 -#define ST_NEARITEM 1 -#define ST_ADDRESSED 2 -#define ST_METER 4 -#define ST_FEET 8 -#define ST_TIME 16 -#define ST_HERE 32 -#define ST_THERE 64 -#define ST_I 128 -#define ST_MORE 256 -#define ST_BACK 512 -#define ST_REVERSE 1024 -#define ST_SOMEONE 2048 -#define ST_GOTFLAG 4096 -#define ST_CAPTUREDFLAG 8192 -#define ST_RETURNEDFLAG 16384 -#define ST_TEAM 32768 -#define ST_1FCTFGOTFLAG 65535 -//ctf task preferences -#define ST_DEFENDER 1 -#define ST_ATTACKER 2 -#define ST_ROAMER 4 - - -//word replacement variables -#define THE_ENEMY 7 -#define THE_TEAM 7 -//team message variables -#define NETNAME 0 -#define PLACE 1 -#define FLAG 1 -#define MESSAGE 2 -#define ADDRESSEE 2 -#define ITEM 3 -#define TEAMMATE 4 -#define TEAMNAME 4 -#define ENEMY 4 -#define KEYAREA 5 -#define FORMATION 5 -#define POSITION 5 -#define NUMBER 5 -#define TIME 6 -#define NAME 6 -#define MORE 6 - - +//=========================================================================== +// +// Name: match.h +// Function: match template defines +// Programmer: Mr Elusive +// Last update: +// Tab Size: 4 (real tabs) +// +//=========================================================================== + +// make sure this is the same character as we use in chats in g_cmd.c +#define EC "\x19" + +//match template contexts +#define MTCONTEXT_MISC 2 +#define MTCONTEXT_INITIALTEAMCHAT 4 +#define MTCONTEXT_TIME 8 +#define MTCONTEXT_TEAMMATE 16 +#define MTCONTEXT_ADDRESSEE 32 +#define MTCONTEXT_PATROLKEYAREA 64 +#define MTCONTEXT_REPLYCHAT 128 +#define MTCONTEXT_CTF 256 + +//message types +#define MSG_NEWLEADER 1 //new leader +#define MSG_ENTERGAME 2 //enter game message +#define MSG_HELP 3 //help someone +#define MSG_ACCOMPANY 4 //accompany someone +#define MSG_DEFENDKEYAREA 5 //defend a key area +#define MSG_RUSHBASE 6 //everyone rush to base +#define MSG_GETFLAG 7 //get the enemy flag +#define MSG_STARTTEAMLEADERSHIP 8 //someone wants to become the team leader +#define MSG_STOPTEAMLEADERSHIP 9 //someone wants to stop being the team leader +#define MSG_WHOISTEAMLAEDER 10 //who is the team leader +#define MSG_WAIT 11 //wait for someone +#define MSG_WHATAREYOUDOING 12 //what are you doing? +#define MSG_JOINSUBTEAM 13 //join a sub-team +#define MSG_LEAVESUBTEAM 14 //leave a sub-team +#define MSG_CREATENEWFORMATION 15 //create a new formation +#define MSG_FORMATIONPOSITION 16 //tell someone his/her position in a formation +#define MSG_FORMATIONSPACE 17 //set the formation intervening space +#define MSG_DOFORMATION 18 //form a known formation +#define MSG_DISMISS 19 //dismiss commanded team mates +#define MSG_CAMP 20 //camp somewhere +#define MSG_CHECKPOINT 21 //remember a check point +#define MSG_PATROL 22 //patrol between certain keypoints +#define MSG_LEADTHEWAY 23 //lead the way +#define MSG_GETITEM 24 //get an item +#define MSG_KILL 25 //kill someone +#define MSG_WHEREAREYOU 26 //where is someone +#define MSG_RETURNFLAG 27 //return the flag +#define MSG_WHATISMYCOMMAND 28 //ask the team leader what to do +#define MSG_WHICHTEAM 29 //ask which team a bot is in +#define MSG_TASKPREFERENCE 30 //tell your teamplay task preference +#define MSG_ATTACKENEMYBASE 31 //attack the enemy base +#define MSG_HARVEST 32 //go harvest +#define MSG_SUICIDE 33 //order to suicide +// +#define MSG_ME 100 +#define MSG_EVERYONE 101 +#define MSG_MULTIPLENAMES 102 +#define MSG_NAME 103 +#define MSG_PATROLKEYAREA 104 +#define MSG_MINUTES 105 +#define MSG_SECONDS 106 +#define MSG_FOREVER 107 +#define MSG_FORALONGTIME 108 +#define MSG_FORAWHILE 109 +// +#define MSG_CHATALL 200 +#define MSG_CHATTEAM 201 +#define MSG_CHATTELL 202 +// +#define MSG_CTF 300 //ctf message + +//command sub types +#define ST_SOMEWHERE 0 +#define ST_NEARITEM 1 +#define ST_ADDRESSED 2 +#define ST_METER 4 +#define ST_FEET 8 +#define ST_TIME 16 +#define ST_HERE 32 +#define ST_THERE 64 +#define ST_I 128 +#define ST_MORE 256 +#define ST_BACK 512 +#define ST_REVERSE 1024 +#define ST_SOMEONE 2048 +#define ST_GOTFLAG 4096 +#define ST_CAPTUREDFLAG 8192 +#define ST_RETURNEDFLAG 16384 +#define ST_TEAM 32768 +#define ST_1FCTFGOTFLAG 65535 +//ctf task preferences +#define ST_DEFENDER 1 +#define ST_ATTACKER 2 +#define ST_ROAMER 4 + + +//word replacement variables +#define THE_ENEMY 7 +#define THE_TEAM 7 +//team message variables +#define NETNAME 0 +#define PLACE 1 +#define FLAG 1 +#define MESSAGE 2 +#define ADDRESSEE 2 +#define ITEM 3 +#define TEAMMATE 4 +#define TEAMNAME 4 +#define ENEMY 4 +#define KEYAREA 5 +#define FORMATION 5 +#define POSITION 5 +#define NUMBER 5 +#define TIME 6 +#define NAME 6 +#define MORE 6 + + diff --git a/dlls/game/syn.h b/dlls/game/syn.h index 583fe01..907d9a9 100644 --- a/dlls/game/syn.h +++ b/dlls/game/syn.h @@ -1,22 +1,22 @@ -//=========================================================================== -// -// Name: syn.h -// Function: synonyms -// Programmer: Mr Elusive -// Last update: - -// Tab Size: 4 (real tabs) -// Notes: - -//=========================================================================== - -#define CONTEXT_ALL 0xFFFFFFFF -#define CONTEXT_NORMAL 1 -#define CONTEXT_NEARBYITEM 2 -#define CONTEXT_CTFREDTEAM 4 -#define CONTEXT_CTFBLUETEAM 8 -#define CONTEXT_REPLY 16 -#define CONTEXT_OBELISKREDTEAM 32 -#define CONTEXT_OBELISKBLUETEAM 64 -#define CONTEXT_HARVESTERREDTEAM 128 -#define CONTEXT_HARVESTERBLUETEAM 256 - -#define CONTEXT_NAMES 1024 +//=========================================================================== +// +// Name: syn.h +// Function: synonyms +// Programmer: Mr Elusive +// Last update: - +// Tab Size: 4 (real tabs) +// Notes: - +//=========================================================================== + +#define CONTEXT_ALL 0xFFFFFFFF +#define CONTEXT_NORMAL 1 +#define CONTEXT_NEARBYITEM 2 +#define CONTEXT_CTFREDTEAM 4 +#define CONTEXT_CTFBLUETEAM 8 +#define CONTEXT_REPLY 16 +#define CONTEXT_OBELISKREDTEAM 32 +#define CONTEXT_OBELISKBLUETEAM 64 +#define CONTEXT_HARVESTERREDTEAM 128 +#define CONTEXT_HARVESTERBLUETEAM 256 + +#define CONTEXT_NAMES 1024