From b7d363a108963ca13647ee25b58c5a531366cf49 Mon Sep 17 00:00:00 2001 From: TimePath Date: Sun, 7 Aug 2016 13:46:16 +1000 Subject: [PATCH] Bots: define the API boundaries --- qcsrc/common/monsters/monster.qh | 2 +- qcsrc/common/monsters/sv_monsters.qc | 2 + qcsrc/common/t_items.qc | 3 +- qcsrc/common/triggers/func/breakable.qc | 2 +- qcsrc/common/weapons/all.qh | 8 +- qcsrc/server/autocvars.qh | 56 ------------ qcsrc/server/bot/_mod.inc | 6 +- qcsrc/server/bot/_mod.qh | 6 +- qcsrc/server/bot/api.qc | 49 +++++++++++ qcsrc/server/bot/api.qh | 87 +++++++++++++++++++ qcsrc/server/bot/default/_mod.inc | 7 ++ qcsrc/server/bot/default/_mod.qh | 7 ++ qcsrc/server/bot/{ => default}/aim.qc | 6 +- qcsrc/server/bot/{ => default}/aim.qh | 0 qcsrc/server/bot/{ => default}/bot.qc | 22 ++--- qcsrc/server/bot/{ => default}/bot.qh | 6 -- qcsrc/server/bot/default/cvars.qc | 1 + qcsrc/server/bot/default/cvars.qh | 58 +++++++++++++ qcsrc/server/bot/default/havocbot/_mod.inc | 3 + qcsrc/server/bot/default/havocbot/_mod.qh | 3 + .../bot/{ => default}/havocbot/havocbot.qc | 2 + .../bot/{ => default}/havocbot/havocbot.qh | 0 .../bot/{ => default}/havocbot/roles.qc | 2 + .../bot/{ => default}/havocbot/roles.qh | 0 .../bot/{ => default}/havocbot/scripting.qh | 0 qcsrc/server/bot/{ => default}/navigation.qc | 2 + qcsrc/server/bot/{ => default}/navigation.qh | 0 qcsrc/server/bot/{ => default}/scripting.qc | 2 + qcsrc/server/bot/{ => default}/scripting.qh | 0 qcsrc/server/bot/{ => default}/waypoints.qc | 4 +- qcsrc/server/bot/{ => default}/waypoints.qh | 9 -- qcsrc/server/bot/havocbot/_mod.inc | 3 - qcsrc/server/bot/havocbot/_mod.qh | 3 - qcsrc/server/cl_client.qc | 3 +- qcsrc/server/cl_impulse.qc | 3 +- qcsrc/server/cl_player.qc | 2 +- qcsrc/server/command/sv_cmd.qc | 4 +- qcsrc/server/g_damage.qc | 2 +- qcsrc/server/g_world.qc | 2 +- qcsrc/server/mutators/gamemode.qh | 7 +- qcsrc/server/mutators/mutator.qh | 7 +- .../mutators/mutator/gamemode_keyhunt.qc | 2 - qcsrc/server/pathlib/path_waypoint.qc | 2 +- qcsrc/server/progs.inc | 1 - qcsrc/server/race.qc | 3 +- qcsrc/server/sv_main.qc | 3 +- qcsrc/server/teamplay.qc | 2 +- 47 files changed, 265 insertions(+), 139 deletions(-) create mode 100644 qcsrc/server/bot/api.qc create mode 100644 qcsrc/server/bot/api.qh create mode 100644 qcsrc/server/bot/default/_mod.inc create mode 100644 qcsrc/server/bot/default/_mod.qh rename qcsrc/server/bot/{ => default}/aim.qc (99%) rename qcsrc/server/bot/{ => default}/aim.qh (100%) rename qcsrc/server/bot/{ => default}/bot.qc (98%) rename qcsrc/server/bot/{ => default}/bot.qh (95%) create mode 100644 qcsrc/server/bot/default/cvars.qc create mode 100644 qcsrc/server/bot/default/cvars.qh create mode 100644 qcsrc/server/bot/default/havocbot/_mod.inc create mode 100644 qcsrc/server/bot/default/havocbot/_mod.qh rename qcsrc/server/bot/{ => default}/havocbot/havocbot.qc (99%) rename qcsrc/server/bot/{ => default}/havocbot/havocbot.qh (100%) rename qcsrc/server/bot/{ => default}/havocbot/roles.qc (99%) rename qcsrc/server/bot/{ => default}/havocbot/roles.qh (100%) rename qcsrc/server/bot/{ => default}/havocbot/scripting.qh (100%) rename qcsrc/server/bot/{ => default}/navigation.qc (99%) rename qcsrc/server/bot/{ => default}/navigation.qh (100%) rename qcsrc/server/bot/{ => default}/scripting.qc (99%) rename qcsrc/server/bot/{ => default}/scripting.qh (100%) rename qcsrc/server/bot/{ => default}/waypoints.qc (99%) rename qcsrc/server/bot/{ => default}/waypoints.qh (81%) delete mode 100644 qcsrc/server/bot/havocbot/_mod.inc delete mode 100644 qcsrc/server/bot/havocbot/_mod.qh diff --git a/qcsrc/common/monsters/monster.qh b/qcsrc/common/monsters/monster.qh index de24caa01..7b9638070 100644 --- a/qcsrc/common/monsters/monster.qh +++ b/qcsrc/common/monsters/monster.qh @@ -4,7 +4,7 @@ #ifdef SVQC #include "sv_monsters.qh" #include -#include +#include #include #include #include diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 8508d5708..f03a51368 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -685,6 +685,8 @@ void Monster_CalculateVelocity(entity this, vector to, vector from, float turnra //this.angles = vectoangles(this.velocity); } +.entity draggedby; + void Monster_Move(entity this, float runspeed, float walkspeed, float stpspeed) { if(this.target2) { this.goalentity = find(NULL, targetname, this.target2); } diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index f7c816295..d180e1c1b 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -4,8 +4,7 @@ #if defined(SVQC) - #include "../server/bot/bot.qh" - #include "../server/bot/waypoints.qh" + #include "../server/bot/api.qh" #include diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index 6763701d3..29d6c6a26 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -2,7 +2,7 @@ #include #include -#include +#include #include #include #include diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index fa9d64ab8..24ea41c64 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -26,15 +26,15 @@ WepSet ReadWepSet(); #include -#ifdef SVQC -#include -#endif - REGISTRY(Weapons, 72) // Increase as needed. Can be up to 72. #define Weapons_from(i) _Weapons_from(i, WEP_Null) REGISTER_REGISTRY(Weapons) STATIC_INIT(WeaponPickup) { FOREACH(Weapons, true, it.m_pickup = NEW(WeaponPickup, it)); } +#ifdef SVQC +#include +#endif + .WepSet m_wepset; #define WEPSET(id) (WEP_##id.m_wepset) #define WepSet_FromWeapon(it) ((it).m_wepset) diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 188cc7131..a8d45bd52 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -5,61 +5,9 @@ bool autocvar__campaign_testrun; int autocvar__campaign_index; string autocvar__campaign_name; bool autocvar__sv_init; -float autocvar_bot_ai_aimskill_blendrate; -float autocvar_bot_ai_aimskill_firetolerance_distdegrees; -float autocvar_bot_ai_aimskill_firetolerance_maxdegrees; -float autocvar_bot_ai_aimskill_firetolerance_mindegrees; -float autocvar_bot_ai_aimskill_fixedrate; -float autocvar_bot_ai_aimskill_mouse; -float autocvar_bot_ai_aimskill_offset; -float autocvar_bot_ai_aimskill_order_filter_1st; -float autocvar_bot_ai_aimskill_order_filter_2nd; -float autocvar_bot_ai_aimskill_order_filter_3th; -float autocvar_bot_ai_aimskill_order_filter_4th; -float autocvar_bot_ai_aimskill_order_filter_5th; -float autocvar_bot_ai_aimskill_order_mix_1st; -float autocvar_bot_ai_aimskill_order_mix_2nd; -float autocvar_bot_ai_aimskill_order_mix_3th; -float autocvar_bot_ai_aimskill_order_mix_4th; -float autocvar_bot_ai_aimskill_order_mix_5th; -float autocvar_bot_ai_aimskill_think; -float autocvar_bot_ai_bunnyhop_firstjumpdelay; -float autocvar_bot_ai_bunnyhop_skilloffset; -float autocvar_bot_ai_bunnyhop_startdistance; -float autocvar_bot_ai_bunnyhop_stopdistance; -float autocvar_bot_ai_chooseweaponinterval; -string autocvar_bot_ai_custom_weapon_priority_close; -string autocvar_bot_ai_custom_weapon_priority_distances; -string autocvar_bot_ai_custom_weapon_priority_far; -string autocvar_bot_ai_custom_weapon_priority_mid; -float autocvar_bot_ai_dangerdetectioninterval; -float autocvar_bot_ai_dangerdetectionupdates; -float autocvar_bot_ai_enemydetectioninterval; -float autocvar_bot_ai_enemydetectionradius; -float autocvar_bot_ai_friends_aware_pickup_radius; -float autocvar_bot_ai_ignoregoal_timeout; -float autocvar_bot_ai_keyboard_distance; -float autocvar_bot_ai_keyboard_threshold; -float autocvar_bot_ai_navigation_jetpack; -float autocvar_bot_ai_navigation_jetpack_mindistance; float autocvar_bot_ai_strategyinterval; -float autocvar_bot_ai_thinkinterval; -bool autocvar_bot_ai_weapon_combo; -float autocvar_bot_ai_weapon_combo_threshold; -string autocvar_bot_config_file; -bool autocvar_bot_god; -bool autocvar_bot_ignore_bots; -bool autocvar_bot_join_empty; -bool autocvar_bot_navigation_ignoreplayers; -bool autocvar_bot_nofire; #define autocvar_bot_number cvar("bot_number") -#define autocvar_bot_prefix cvar_string("bot_prefix") -#define autocvar_bot_suffix cvar_string("bot_suffix") -bool autocvar_bot_usemodelnames; int autocvar_bot_vs_human; -bool autocvar_bot_debug_tracewalk; -bool autocvar_bot_debug_goalstack; -bool autocvar_bot_wander_enable; int autocvar_captureleadlimit_override; #define autocvar_capturelimit_override cvar("capturelimit_override") float autocvar_ekg; @@ -172,7 +120,6 @@ float autocvar_g_chat_flood_spl_tell; int autocvar_g_chat_nospectators; bool autocvar_g_chat_teamcolors; bool autocvar_g_chat_tellprivacy; -bool autocvar_g_debug_bot_commands; bool autocvar_g_forced_respawn; string autocvar_g_forced_team_blue; string autocvar_g_forced_team_otherwise; @@ -296,7 +243,6 @@ float autocvar_g_turrets_targetscan_maxdelay; float autocvar_g_turrets_targetscan_mindelay; bool autocvar_g_use_ammunition; bool autocvar_g_waypointeditor; -int autocvar_g_waypointeditor_auto; bool autocvar_g_waypoints_for_items; #define autocvar_g_weapon_stay cvar("g_weapon_stay") bool autocvar_g_weapon_throwable; @@ -321,7 +267,6 @@ int autocvar_rescan_pending; bool autocvar_samelevel; string autocvar_sessionid; #define autocvar_skill cvar("skill") -float autocvar_skill_auto; #define autocvar_slowmo cvar("slowmo") float autocvar_snd_soundradius; int autocvar_spawn_debug; @@ -429,7 +374,6 @@ float autocvar_timelimit_overtime; int autocvar_timelimit_overtimes; float autocvar_timelimit_suddendeath; #define autocvar_utf8_enable cvar("utf8_enable") -bool autocvar_waypoint_benchmark; float autocvar_sv_gameplayfix_gravityunaffectedbyticrate; bool autocvar_sv_gameplayfix_upwardvelocityclearsongroundflag; float autocvar_g_trueaim_minrange; diff --git a/qcsrc/server/bot/_mod.inc b/qcsrc/server/bot/_mod.inc index 787939110..8f0672e26 100644 --- a/qcsrc/server/bot/_mod.inc +++ b/qcsrc/server/bot/_mod.inc @@ -1,6 +1,2 @@ // generated file; do not modify -#include -#include -#include -#include -#include +#include diff --git a/qcsrc/server/bot/_mod.qh b/qcsrc/server/bot/_mod.qh index 802d39187..33f0b0229 100644 --- a/qcsrc/server/bot/_mod.qh +++ b/qcsrc/server/bot/_mod.qh @@ -1,6 +1,2 @@ // generated file; do not modify -#include -#include -#include -#include -#include +#include diff --git a/qcsrc/server/bot/api.qc b/qcsrc/server/bot/api.qc new file mode 100644 index 000000000..85b0e4656 --- /dev/null +++ b/qcsrc/server/bot/api.qc @@ -0,0 +1,49 @@ +#include "api.qh" + +#if 1 + +#include "default/_mod.inc" +#include "default/havocbot/_mod.inc" + +#else + +bool bot_aim(entity this, float shotspeed, float shotspeedupward, float maxshottime, float applygravity) { return false; } +void bot_clientconnect(entity this) { } +void bot_clientdisconnect(entity this) { } +void bot_cmdhelp(string scmd) { } +void bot_endgame() { } +bool bot_fixcount() { return true; } +void bot_list_commands() { } +void bot_queuecommand(entity bot, string cmdstring) { } +void bot_relinkplayerlist() { } +void bot_resetqueues() { } +void bot_serverframe() { } +bool bot_shouldattack(entity this, entity e) { return false; } +void bot_think(entity this) { } + +entity find_bot_by_name(string name) { return NULL; } +entity find_bot_by_number(float number) { return NULL; } + +void havocbot_goalrating_controlpoints(entity this, float ratingscale, vector org, float sradius) { } +void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius) { } +void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius) { } + +entity navigation_findnearestwaypoint(entity ent, float walkfromwp) { return NULL; } +void navigation_goalrating_end(entity this) { } +void navigation_goalrating_start(entity this) { } +void navigation_markroutes(entity this, entity fixed_source_waypoint) { } +void navigation_markroutes_inverted(entity fixed_source_waypoint) { } +void navigation_routerating(entity this, entity e, float f, float rangebias) { } + +bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float movemode) { return false; } + +void waypoint_remove(entity e) { } +void waypoint_saveall() { } +void waypoint_schedulerelinkall() { } +void waypoint_schedulerelink(entity wp) { } +void waypoint_spawnforitem(entity e) { } +void waypoint_spawnforitem_force(entity e, vector org) { } +void waypoint_spawnforteleporter(entity e, vector destination, float timetaken) { } +void waypoint_spawnforteleporter_v(entity e, vector org, vector destination, float timetaken) { } +entity waypoint_spawn(vector m1, vector m2, float f) { return NULL; } +#endif diff --git a/qcsrc/server/bot/api.qh b/qcsrc/server/bot/api.qh new file mode 100644 index 000000000..9c525892f --- /dev/null +++ b/qcsrc/server/bot/api.qh @@ -0,0 +1,87 @@ +#pragma once + +#include + +const int WAYPOINTFLAG_GENERATED = BIT(23); +const int WAYPOINTFLAG_ITEM = BIT(22); +const int WAYPOINTFLAG_TELEPORT = BIT(21); +const int WAYPOINTFLAG_NORELINK = BIT(20); +const int WAYPOINTFLAG_PERSONAL = BIT(19); +const int WAYPOINTFLAG_PROTECTED = BIT(18); // Useless WP detection never kills these. +const int WAYPOINTFLAG_USEFUL = BIT(17); // Useless WP detection temporary flag. +const int WAYPOINTFLAG_DEAD_END = BIT(16); // Useless WP detection temporary flag. + +entity kh_worldkeylist; +.entity kh_worldkeynext; + +float bot_custom_weapon; +float bot_weapons_close[Weapons_MAX]; +float bot_weapons_far[Weapons_MAX]; +float bot_weapons_mid[Weapons_MAX]; +float skill; + +.float bot_attack; +.float bot_dodgerating; +.float bot_dodge; +.float bot_forced_team; +.float bot_moveskill; // moving technique +.float bot_pickup; +.float(entity player, entity item) bot_pickupevalfunc; +.float bot_strategytime; +.string cleanname; +.float havocbot_role_timeout; +.float isbot; // true if this client is actually a bot +.float lastteleporttime; +.float navigation_hasgoals; +.float nearestwaypointtimeout; +.entity nearestwaypoint; +.float speed; +.entity wp00, wp01, wp02, wp03, wp04, wp05, wp06, wp07, wp08, wp09, wp10, wp11, wp12, wp13, wp14, wp15; +.entity wp16, wp17, wp18, wp19, wp20, wp21, wp22, wp23, wp24, wp25, wp26, wp27, wp28, wp29, wp30, wp31; +.float wp00mincost, wp01mincost, wp02mincost, wp03mincost, wp04mincost, wp05mincost, wp06mincost, wp07mincost; +.float wp08mincost, wp09mincost, wp10mincost, wp11mincost, wp12mincost, wp13mincost, wp14mincost, wp15mincost; +.float wp16mincost, wp17mincost, wp18mincost, wp19mincost, wp20mincost, wp21mincost, wp22mincost, wp23mincost; +.float wp24mincost, wp25mincost, wp26mincost, wp27mincost, wp28mincost, wp29mincost, wp30mincost, wp31mincost; +.float wpconsidered; +.float wpcost; +.int wpflags; + +bool bot_aim(entity this, float shotspeed, float shotspeedupward, float maxshottime, float applygravity); +void bot_clientconnect(entity this); +void bot_clientdisconnect(entity this); +void bot_cmdhelp(string scmd); +void bot_endgame(); +bool bot_fixcount(); +void bot_list_commands(); +void bot_queuecommand(entity bot, string cmdstring); +void bot_relinkplayerlist(); +void bot_resetqueues(); +void bot_serverframe(); +bool bot_shouldattack(entity this, entity e); +void bot_think(entity this); + +entity find_bot_by_name(string name); +entity find_bot_by_number(float number); + +void havocbot_goalrating_controlpoints(entity this, float ratingscale, vector org, float sradius); +void havocbot_goalrating_enemyplayers(entity this, float ratingscale, vector org, float sradius); +void havocbot_goalrating_items(entity this, float ratingscale, vector org, float sradius); + +entity navigation_findnearestwaypoint(entity ent, float walkfromwp); +void navigation_goalrating_end(entity this); +void navigation_goalrating_start(entity this); +void navigation_markroutes(entity this, entity fixed_source_waypoint); +void navigation_markroutes_inverted(entity fixed_source_waypoint); +void navigation_routerating(entity this, entity e, float f, float rangebias); + +bool tracewalk(entity e, vector start, vector m1, vector m2, vector end, float movemode); + +void waypoint_remove(entity e); +void waypoint_saveall(); +void waypoint_schedulerelinkall(); +void waypoint_schedulerelink(entity wp); +void waypoint_spawnforitem(entity e); +void waypoint_spawnforitem_force(entity e, vector org); +void waypoint_spawnforteleporter(entity e, vector destination, float timetaken); +void waypoint_spawnforteleporter_v(entity e, vector org, vector destination, float timetaken); +entity waypoint_spawn(vector m1, vector m2, float f); diff --git a/qcsrc/server/bot/default/_mod.inc b/qcsrc/server/bot/default/_mod.inc new file mode 100644 index 000000000..ec73502c3 --- /dev/null +++ b/qcsrc/server/bot/default/_mod.inc @@ -0,0 +1,7 @@ +// generated file; do not modify +#include +#include +#include +#include +#include +#include diff --git a/qcsrc/server/bot/default/_mod.qh b/qcsrc/server/bot/default/_mod.qh new file mode 100644 index 000000000..9252f195e --- /dev/null +++ b/qcsrc/server/bot/default/_mod.qh @@ -0,0 +1,7 @@ +// generated file; do not modify +#include +#include +#include +#include +#include +#include diff --git a/qcsrc/server/bot/aim.qc b/qcsrc/server/bot/default/aim.qc similarity index 99% rename from qcsrc/server/bot/aim.qc rename to qcsrc/server/bot/default/aim.qc index b867b5f6d..7c87db0ff 100644 --- a/qcsrc/server/bot/aim.qc +++ b/qcsrc/server/bot/default/aim.qc @@ -1,13 +1,15 @@ #include "aim.qh" +#include "cvars.qh" + #include "bot.qh" #include #include -#include "../weapons/weaponsystem.qh" +#include "../../weapons/weaponsystem.qh" -#include "../mutators/all.qh" +#include "../../mutators/all.qh" // traces multiple trajectories to find one that will impact the target // 'end' vector is the place it aims for, diff --git a/qcsrc/server/bot/aim.qh b/qcsrc/server/bot/default/aim.qh similarity index 100% rename from qcsrc/server/bot/aim.qh rename to qcsrc/server/bot/default/aim.qh diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/default/bot.qc similarity index 98% rename from qcsrc/server/bot/bot.qc rename to qcsrc/server/bot/default/bot.qc index 58feef659..753c1867e 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/default/bot.qc @@ -1,5 +1,7 @@ #include "bot.qh" +#include "cvars.qh" + #include "aim.qh" #include "navigation.qh" #include "scripting.qh" @@ -8,20 +10,20 @@ #include "havocbot/havocbot.qh" #include "havocbot/scripting.qh" -#include "../teamplay.qh" +#include "../../teamplay.qh" -#include "../antilag.qh" -#include "../autocvars.qh" -#include "../campaign.qh" -#include "../cl_client.qh" -#include "../constants.qh" -#include "../defs.qh" -#include "../race.qh" +#include "../../antilag.qh" +#include "../../autocvars.qh" +#include "../../campaign.qh" +#include "../../cl_client.qh" +#include "../../constants.qh" +#include "../../defs.qh" +#include "../../race.qh" #include -#include "../mutators/all.qh" +#include "../../mutators/all.qh" -#include "../weapons/accuracy.qh" +#include "../../weapons/accuracy.qh" #include #include diff --git a/qcsrc/server/bot/bot.qh b/qcsrc/server/bot/default/bot.qh similarity index 95% rename from qcsrc/server/bot/bot.qh rename to qcsrc/server/bot/default/bot.qh index e9dd92668..095930760 100644 --- a/qcsrc/server/bot/bot.qh +++ b/qcsrc/server/bot/default/bot.qh @@ -20,7 +20,6 @@ const int AI_STATUS_STUCK = BIT(11); // Cannot reach any goal .int aistatus; // Skill system -float skill; float autoskill_nextthink; // havocbot_keyboardskill // keyboard movement @@ -43,14 +42,9 @@ float autoskill_nextthink; .float totalfrags_lastcheck; // Custom weapon priorities -float bot_custom_weapon; float bot_distance_far; float bot_distance_close; -float bot_weapons_far[Weapons_MAX]; -float bot_weapons_mid[Weapons_MAX]; -float bot_weapons_close[Weapons_MAX]; - entity bot_list; .entity nextbot; .string cleanname; diff --git a/qcsrc/server/bot/default/cvars.qc b/qcsrc/server/bot/default/cvars.qc new file mode 100644 index 000000000..779e7f0cf --- /dev/null +++ b/qcsrc/server/bot/default/cvars.qc @@ -0,0 +1 @@ +#include "cvars.qh" diff --git a/qcsrc/server/bot/default/cvars.qh b/qcsrc/server/bot/default/cvars.qh new file mode 100644 index 000000000..d612c7ab9 --- /dev/null +++ b/qcsrc/server/bot/default/cvars.qh @@ -0,0 +1,58 @@ +#pragma once + +float autocvar_bot_ai_aimskill_blendrate; +float autocvar_bot_ai_aimskill_firetolerance_distdegrees; +float autocvar_bot_ai_aimskill_firetolerance_maxdegrees; +float autocvar_bot_ai_aimskill_firetolerance_mindegrees; +float autocvar_bot_ai_aimskill_fixedrate; +float autocvar_bot_ai_aimskill_mouse; +float autocvar_bot_ai_aimskill_offset; +float autocvar_bot_ai_aimskill_order_filter_1st; +float autocvar_bot_ai_aimskill_order_filter_2nd; +float autocvar_bot_ai_aimskill_order_filter_3th; +float autocvar_bot_ai_aimskill_order_filter_4th; +float autocvar_bot_ai_aimskill_order_filter_5th; +float autocvar_bot_ai_aimskill_order_mix_1st; +float autocvar_bot_ai_aimskill_order_mix_2nd; +float autocvar_bot_ai_aimskill_order_mix_3th; +float autocvar_bot_ai_aimskill_order_mix_4th; +float autocvar_bot_ai_aimskill_order_mix_5th; +float autocvar_bot_ai_aimskill_think; +float autocvar_bot_ai_bunnyhop_firstjumpdelay; +float autocvar_bot_ai_bunnyhop_skilloffset; +float autocvar_bot_ai_bunnyhop_startdistance; +float autocvar_bot_ai_bunnyhop_stopdistance; +float autocvar_bot_ai_chooseweaponinterval; +string autocvar_bot_ai_custom_weapon_priority_close; +string autocvar_bot_ai_custom_weapon_priority_distances; +string autocvar_bot_ai_custom_weapon_priority_far; +string autocvar_bot_ai_custom_weapon_priority_mid; +float autocvar_bot_ai_dangerdetectioninterval; +float autocvar_bot_ai_dangerdetectionupdates; +float autocvar_bot_ai_enemydetectioninterval; +float autocvar_bot_ai_enemydetectionradius; +float autocvar_bot_ai_friends_aware_pickup_radius; +float autocvar_bot_ai_ignoregoal_timeout; +float autocvar_bot_ai_keyboard_distance; +float autocvar_bot_ai_keyboard_threshold; +float autocvar_bot_ai_navigation_jetpack; +float autocvar_bot_ai_navigation_jetpack_mindistance; +float autocvar_bot_ai_thinkinterval; +bool autocvar_bot_ai_weapon_combo; +float autocvar_bot_ai_weapon_combo_threshold; +string autocvar_bot_config_file; +bool autocvar_bot_god; +bool autocvar_bot_ignore_bots; +bool autocvar_bot_join_empty; +bool autocvar_bot_navigation_ignoreplayers; +bool autocvar_bot_nofire; +#define autocvar_bot_prefix cvar_string("bot_prefix") +#define autocvar_bot_suffix cvar_string("bot_suffix") +bool autocvar_bot_usemodelnames; +bool autocvar_bot_debug_tracewalk; +bool autocvar_bot_debug_goalstack; +bool autocvar_bot_wander_enable; +bool autocvar_g_debug_bot_commands; +int autocvar_g_waypointeditor_auto; +float autocvar_skill_auto; +bool autocvar_waypoint_benchmark; diff --git a/qcsrc/server/bot/default/havocbot/_mod.inc b/qcsrc/server/bot/default/havocbot/_mod.inc new file mode 100644 index 000000000..3ecfda161 --- /dev/null +++ b/qcsrc/server/bot/default/havocbot/_mod.inc @@ -0,0 +1,3 @@ +// generated file; do not modify +#include +#include diff --git a/qcsrc/server/bot/default/havocbot/_mod.qh b/qcsrc/server/bot/default/havocbot/_mod.qh new file mode 100644 index 000000000..01fcd46ef --- /dev/null +++ b/qcsrc/server/bot/default/havocbot/_mod.qh @@ -0,0 +1,3 @@ +// generated file; do not modify +#include +#include diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/default/havocbot/havocbot.qc similarity index 99% rename from qcsrc/server/bot/havocbot/havocbot.qc rename to qcsrc/server/bot/default/havocbot/havocbot.qc index ceb9b296e..67b558eed 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/default/havocbot/havocbot.qc @@ -1,5 +1,7 @@ #include "havocbot.qh" +#include "../cvars.qh" + #include "../aim.qh" #include "../bot.qh" #include "../navigation.qh" diff --git a/qcsrc/server/bot/havocbot/havocbot.qh b/qcsrc/server/bot/default/havocbot/havocbot.qh similarity index 100% rename from qcsrc/server/bot/havocbot/havocbot.qh rename to qcsrc/server/bot/default/havocbot/havocbot.qh diff --git a/qcsrc/server/bot/havocbot/roles.qc b/qcsrc/server/bot/default/havocbot/roles.qc similarity index 99% rename from qcsrc/server/bot/havocbot/roles.qc rename to qcsrc/server/bot/default/havocbot/roles.qc index 9ea6a3d90..fffe6e4b9 100644 --- a/qcsrc/server/bot/havocbot/roles.qc +++ b/qcsrc/server/bot/default/havocbot/roles.qc @@ -2,6 +2,8 @@ #include "havocbot.qh" +#include "../cvars.qh" + #include "../bot.qh" #include "../navigation.qh" diff --git a/qcsrc/server/bot/havocbot/roles.qh b/qcsrc/server/bot/default/havocbot/roles.qh similarity index 100% rename from qcsrc/server/bot/havocbot/roles.qh rename to qcsrc/server/bot/default/havocbot/roles.qh diff --git a/qcsrc/server/bot/havocbot/scripting.qh b/qcsrc/server/bot/default/havocbot/scripting.qh similarity index 100% rename from qcsrc/server/bot/havocbot/scripting.qh rename to qcsrc/server/bot/default/havocbot/scripting.qh diff --git a/qcsrc/server/bot/navigation.qc b/qcsrc/server/bot/default/navigation.qc similarity index 99% rename from qcsrc/server/bot/navigation.qc rename to qcsrc/server/bot/default/navigation.qc index c9418e2e3..5ab07b1a8 100644 --- a/qcsrc/server/bot/navigation.qc +++ b/qcsrc/server/bot/default/navigation.qc @@ -1,5 +1,7 @@ #include "navigation.qh" +#include "cvars.qh" + #include "bot.qh" #include "waypoints.qh" diff --git a/qcsrc/server/bot/navigation.qh b/qcsrc/server/bot/default/navigation.qh similarity index 100% rename from qcsrc/server/bot/navigation.qh rename to qcsrc/server/bot/default/navigation.qh diff --git a/qcsrc/server/bot/scripting.qc b/qcsrc/server/bot/default/scripting.qc similarity index 99% rename from qcsrc/server/bot/scripting.qc rename to qcsrc/server/bot/default/scripting.qc index 291b22f5f..8b2f9e6d1 100644 --- a/qcsrc/server/bot/scripting.qc +++ b/qcsrc/server/bot/default/scripting.qc @@ -1,5 +1,7 @@ #include "scripting.qh" +#include "cvars.qh" + #include #include diff --git a/qcsrc/server/bot/scripting.qh b/qcsrc/server/bot/default/scripting.qh similarity index 100% rename from qcsrc/server/bot/scripting.qh rename to qcsrc/server/bot/default/scripting.qh diff --git a/qcsrc/server/bot/waypoints.qc b/qcsrc/server/bot/default/waypoints.qc similarity index 99% rename from qcsrc/server/bot/waypoints.qc rename to qcsrc/server/bot/default/waypoints.qc index 89078f5c8..84995d1c7 100644 --- a/qcsrc/server/bot/waypoints.qc +++ b/qcsrc/server/bot/default/waypoints.qc @@ -1,11 +1,13 @@ #include "waypoints.qh" +#include "cvars.qh" + #include "bot.qh" #include "navigation.qh" #include -#include "../antilag.qh" +#include "../../antilag.qh" #include diff --git a/qcsrc/server/bot/waypoints.qh b/qcsrc/server/bot/default/waypoints.qh similarity index 81% rename from qcsrc/server/bot/waypoints.qh rename to qcsrc/server/bot/default/waypoints.qh index 23c0fa63c..38d57a04a 100644 --- a/qcsrc/server/bot/waypoints.qh +++ b/qcsrc/server/bot/default/waypoints.qh @@ -3,15 +3,6 @@ * Globals and Fields */ -const int WAYPOINTFLAG_GENERATED = BIT(23); -const int WAYPOINTFLAG_ITEM = BIT(22); -const int WAYPOINTFLAG_TELEPORT = BIT(21); -const int WAYPOINTFLAG_NORELINK = BIT(20); -const int WAYPOINTFLAG_PERSONAL = BIT(19); -const int WAYPOINTFLAG_PROTECTED = BIT(18); // Useless WP detection never kills these. -const int WAYPOINTFLAG_USEFUL = BIT(17); // Useless WP detection temporary flag. -const int WAYPOINTFLAG_DEAD_END = BIT(16); // Useless WP detection temporary flag. - // fields you can query using prvm_global server to get some statistics about waypoint linking culling float relink_total, relink_walkculled, relink_pvsculled, relink_lengthculled; diff --git a/qcsrc/server/bot/havocbot/_mod.inc b/qcsrc/server/bot/havocbot/_mod.inc deleted file mode 100644 index a6270bc13..000000000 --- a/qcsrc/server/bot/havocbot/_mod.inc +++ /dev/null @@ -1,3 +0,0 @@ -// generated file; do not modify -#include -#include diff --git a/qcsrc/server/bot/havocbot/_mod.qh b/qcsrc/server/bot/havocbot/_mod.qh deleted file mode 100644 index 4b62d1b8e..000000000 --- a/qcsrc/server/bot/havocbot/_mod.qh +++ /dev/null @@ -1,3 +0,0 @@ -// generated file; do not modify -#include -#include diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 8de814507..a3082d2b7 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -19,8 +19,7 @@ #include "campaign.qh" #include "command/common.qh" -#include "bot/bot.qh" -#include "bot/navigation.qh" +#include "bot/api.qh" #include "../common/ent_cs.qh" #include diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index a2aeb88a9..51cb60a72 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -1,12 +1,11 @@ #include "cl_impulse.qh" #include "round_handler.qh" -#include "bot/waypoints.qh" +#include "bot/api.qh" #include "weapons/throwing.qh" #include "command/common.qh" #include "cheats.qh" -#include "bot/navigation.qh" #include "weapons/selection.qh" #include "weapons/tracing.qh" #include "weapons/weaponsystem.qh" diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 29a55cbd8..a542e6431 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -1,6 +1,6 @@ #include "cl_player.qh" -#include "bot/bot.qh" +#include "bot/api.qh" #include "cheats.qh" #include "g_damage.qh" #include "g_subs.qh" diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index f263f5e61..f983eeb4e 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -16,9 +16,7 @@ #include "../playerdemo.qh" #include "../teamplay.qh" -#include "../bot/bot.qh" -#include "../bot/navigation.qh" -#include "../bot/scripting.qh" +#include "../bot/api.qh" #include "../mutators/all.qh" diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index debc54743..d7e9b07c0 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -1,6 +1,6 @@ #include "g_damage.qh" -#include "bot/bot.qh" +#include "bot/api.qh" #include "g_hook.qh" #include "mutators/all.qh" #include "scores.qh" diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index ed35a5b0d..39d8acdfc 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -2,7 +2,7 @@ #include "anticheat.qh" #include "antilag.qh" -#include "bot/bot.qh" +#include "bot/api.qh" #include "campaign.qh" #include "cheats.qh" #include "cl_client.qh" diff --git a/qcsrc/server/mutators/gamemode.qh b/qcsrc/server/mutators/gamemode.qh index ee80b44b0..1e60b203e 100644 --- a/qcsrc/server/mutators/gamemode.qh +++ b/qcsrc/server/mutators/gamemode.qh @@ -11,12 +11,7 @@ #include #include -#include -#include -#include -#include - -#include +#include #include diff --git a/qcsrc/server/mutators/mutator.qh b/qcsrc/server/mutators/mutator.qh index 40fad29b3..a63321a36 100644 --- a/qcsrc/server/mutators/mutator.qh +++ b/qcsrc/server/mutators/mutator.qh @@ -11,12 +11,7 @@ #include #include -#include -#include -#include - -#include -#include +#include #include #include diff --git a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc index 236db8aa8..26b381199 100644 --- a/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc +++ b/qcsrc/server/mutators/mutator/gamemode_keyhunt.qc @@ -50,8 +50,6 @@ USING(kh_Think_t, void()); void kh_StartRound(); void kh_Controller_SetThink(float t, kh_Think_t func); -entity kh_worldkeylist; -.entity kh_worldkeynext; #endif #ifdef IMPLEMENTATION diff --git a/qcsrc/server/pathlib/path_waypoint.qc b/qcsrc/server/pathlib/path_waypoint.qc index a2aaf5563..f60932c66 100644 --- a/qcsrc/server/pathlib/path_waypoint.qc +++ b/qcsrc/server/pathlib/path_waypoint.qc @@ -1,5 +1,5 @@ #include "path_waypoint.qh" -#include "../bot/waypoints.qh" +#include "../bot/api.qh" #include "pathlib.qh" #include "main.qh" diff --git a/qcsrc/server/progs.inc b/qcsrc/server/progs.inc index 163b16674..c49b604e6 100644 --- a/qcsrc/server/progs.inc +++ b/qcsrc/server/progs.inc @@ -10,7 +10,6 @@ #include "../server/_mod.inc" #include "bot/_mod.inc" -#include "bot/havocbot/_mod.inc" #include "command/_mod.inc" #include "mutators/_mod.inc" #include "pathlib/_all.inc" diff --git a/qcsrc/server/race.qc b/qcsrc/server/race.qc index a46c8b3d9..b315d6cad 100644 --- a/qcsrc/server/race.qc +++ b/qcsrc/server/race.qc @@ -4,8 +4,7 @@ #include "portals.qh" #include "scores.qh" #include "spawnpoints.qh" -#include "bot/waypoints.qh" -#include "bot/navigation.qh" +#include "bot/api.qh" #include "command/getreplies.qh" #include "../common/deathtypes/all.qh" #include "../common/notifications/all.qh" diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 52887cc15..4a72bb1ae 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -4,8 +4,7 @@ #include "g_hook.qh" #include "g_world.qh" -#include "bot/bot.qh" -#include "bot/waypoints.qh" +#include "bot/api.qh" #include "command/common.qh" diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index e2156705a..56f85bd46 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -5,7 +5,7 @@ #include "scores.qh" #include "scores_rules.qh" -#include "bot/bot.qh" +#include "bot/api.qh" #include "command/vote.qh" -- 2.39.2