Xonotic
|
#include "navigation.qh"
#include <common/constants.qh>
#include <common/items/_mod.qh>
#include <common/mapobjects/func/ladder.qh>
#include <common/mapobjects/trigger/hurt.qh>
#include <common/mapobjects/trigger/jumppads.qh>
#include <common/net_linked.qh>
#include <common/stats.qh>
#include <common/weapons/_all.qh>
#include <server/bot/api.qh>
#include <server/bot/default/bot.qh>
#include <server/bot/default/cvars.qh>
#include <server/bot/default/waypoints.qh>
#include <server/items/items.qh>
Go to the source code of this file.
Macros | |
#define | MAX_CHASE_DISTANCE 700 |
#define | NAV_SWIM_ONWATER 1 |
#define | NAV_SWIM_UNDERWATER 2 |
#define | NAV_WALK 0 |
#define | RESURFACE_LIMITED(org, lim) org = resurface_limited(org, lim, m1) |
Variables | |
float | goalcounter |
vector | lastposition |
float | speed |
#define MAX_CHASE_DISTANCE 700 |
Definition at line 54 of file navigation.qc.
Referenced by navigation_routetogoal(), and navigation_shortenpath().
#define NAV_SWIM_ONWATER 1 |
Definition at line 266 of file navigation.qc.
Referenced by tracewalk().
#define NAV_SWIM_UNDERWATER 2 |
Definition at line 267 of file navigation.qc.
Referenced by tracewalk().
#define NAV_WALK 0 |
Definition at line 265 of file navigation.qc.
Referenced by tracewalk().
#define RESURFACE_LIMITED | ( | org, | |
lim | |||
) | org = resurface_limited(org, lim, m1) |
Definition at line 263 of file navigation.qc.
Referenced by tracewalk().
Definition at line 1873 of file navigation.qc.
References entity(), g_bot_dodge, g_waypoints, IL_EACH, v, and vector().
Referenced by bot_serverframe().
Definition at line 2061 of file navigation.qc.
References entity(), goalcounter, goalcurrent, goalstack01, goalstack02, goalstack03, goalstack04, goalstack05, goalstack06, goalstack07, goalstack08, goalstack09, goalstack10, goalstack11, goalstack12, goalstack13, goalstack14, goalstack15, goalstack16, goalstack17, goalstack18, goalstack19, goalstack20, goalstack21, goalstack22, goalstack23, goalstack24, goalstack25, goalstack26, goalstack27, goalstack28, goalstack29, goalstack30, goalstack31, lastposition, NULL, origin, and vector().
Referenced by havocbot_moveto(), and havocbot_movetogoal().
Definition at line 2018 of file navigation.qc.
References debuglastnode, IS_PLAYER, and NULL.
Referenced by tracewalk().
Definition at line 2033 of file navigation.qc.
References DEBUG_NODE_FAIL, DEBUG_NODE_SUCCESS, DEBUG_NODE_WARNING, and vector().
Referenced by tracewalk().
void debugresetnodes | ( | ) |
Definition at line 2013 of file navigation.qc.
References debuglastnode.
Referenced by tracewalk().
Definition at line 103 of file navigation.qc.
References bound(), dest, and vector().
Referenced by havocbot_ai(), havocbot_bunnyhop(), havocbot_moveto(), and havocbot_movetogoal().
Definition at line 203 of file navigation.qc.
References IS_PLAYER, SUBMERGED, SUBMERGED_NO, SUBMERGED_UNDEFINED, SUBMERGED_YES, and WATERLEVEL_SUBMERGED.
Referenced by waypoint_gettravelcost().
bool navigation_checkladders | ( | entity | e, |
vector | org, | ||
vector | m1, | ||
vector | m2, | ||
vector | end, | ||
vector | end2, | ||
int | movemode | ||
) |
Definition at line 223 of file navigation.qc.
References boxesoverlap(), IL_EACH, trace_fraction, vec2, and vector().
Referenced by tracewalk().
Definition at line 750 of file navigation.qc.
References FLOAT_MAX, goalcurrent, goalcurrent_distance_2d, goalcurrent_distance_time, goalcurrent_distance_z, goalcurrent_prev, goalentity, goalentity_lock_timeout, goalentity_shouldbefrozen, goalstack01, goalstack02, goalstack03, goalstack04, goalstack05, goalstack06, goalstack07, goalstack08, goalstack09, goalstack10, goalstack11, goalstack12, goalstack13, goalstack14, goalstack15, goalstack16, goalstack17, goalstack18, goalstack19, goalstack20, goalstack21, goalstack22, goalstack23, goalstack24, goalstack25, goalstack26, goalstack27, goalstack28, goalstack29, goalstack30, goalstack31, lastteleporttime, and NULL.
Referenced by havocbot_ai(), havocbot_movetogoal(), havocbot_resetgoal(), navigation_goalrating_start(), and navigation_unstuck().
Definition at line 76 of file navigation.qc.
References bot_basewaypoint, navigation_dynamicgoal, nearestwaypoint, nearestwaypointtimeout, and time.
Referenced by ctf_DelayedFlagSetup(), ka_SpawnBall(), kh_Key_Spawn(), PutPlayerInServer(), and W_ThrowNewWeapon().
Definition at line 86 of file navigation.qc.
References nearestwaypoint, nearestwaypointtimeout, and time.
Referenced by ctf_Handle_Throw(), ka_DropEvent(), ka_RespawnBall(), and kh_Key_Detach().
Definition at line 95 of file navigation.qc.
References bot_basewaypoint, nearestwaypoint, and nearestwaypointtimeout.
Referenced by ctf_RespawnFlag(), ka_TouchEvent(), and kh_Key_Attach().
Definition at line 1011 of file navigation.qc.
References autocvar_g_waypointeditor_auto, entity(), navigation_findnearestwaypoint_withdist_except(), NULL, and WAYPOINTFLAG_PROTECTED.
Referenced by botframe_autowaypoints_fix_from(), navigation_routerating(), waypoint_remove_fromeditor(), and waypoint_unreachable().
entity navigation_findnearestwaypoint_withdist_except | ( | entity | ent, |
float | walkfromwp, | ||
float | bestdist, | ||
entity | except | ||
) |
Definition at line 918 of file navigation.qc.
References best, boxesoverlap(), entity(), g_jumppads, g_waypoints, if(), IL_EACH, IS_BOT_CLIENT, IS_PLAYER, navigation_testtracewalk, navigation_waypoint_will_link(), NULL, set_tracewalk_dest(), SOLID_BSP, trace_ent, tracewalk_dest, tracewalk_dest_height, trigger_push_test(), v, vector(), vlen(), waypointeditor_enabled, WAYPOINTFLAG_JUMP, WAYPOINTFLAG_TELEPORT, and WPFLAGMASK_NORELINK.
Referenced by navigation_findnearestwaypoint().
Definition at line 1783 of file navigation.qc.
References AI_STATUS_RUNNING, aistatus, BOT_BUNNYHOP_WP_DETECTION_RANGE, bot_navigation_movemode, entity(), g_waypoints, goalcurrent, goalcurrent_prev, IL_EACH, NULL, origin, set_tracewalk_dest(), tracewalk(), tracewalk_dest, tracewalk_dest_height, vdist, WAYPOINTFLAG_JUMP, and WAYPOINTFLAG_TELEPORT.
Referenced by navigation_goalrating_start().
Definition at line 1845 of file navigation.qc.
References AI_STATUS_STUCK, aistatus, autocvar_bot_wander_enable, boolean, entity(), goalcurrent, goalentity, goalentity_shouldbefrozen, goalstack31, LOG_DEBUG, navigation_bestgoal, navigation_poproute(), navigation_routetogoal(), netname, NULL, and origin.
Referenced by havocbot_moveto_refresh_route(), havocbot_role_ast_defense(), havocbot_role_ast_offense(), havocbot_role_ctf_carrier(), havocbot_role_ctf_defense(), havocbot_role_ctf_escort(), havocbot_role_ctf_middle(), havocbot_role_ctf_offense(), havocbot_role_ctf_retriever(), havocbot_role_cts(), havocbot_role_dom(), havocbot_role_ft_freeing(), havocbot_role_ft_offense(), havocbot_role_generic(), havocbot_role_ka_carrier(), havocbot_role_ka_collector(), havocbot_role_kh_carrier(), havocbot_role_kh_defense(), havocbot_role_kh_freelancer(), havocbot_role_kh_offense(), havocbot_role_ons_offense(), and havocbot_role_race().
Definition at line 1830 of file navigation.qc.
References AI_STATUS_STUCK, aistatus, entity(), goalstack31, navigation_bestgoal, navigation_bestrating, navigation_clearroute(), navigation_get_really_close_waypoint(), navigation_jetpack_goal, navigation_markroutes(), and NULL.
Referenced by havocbot_moveto_refresh_route(), havocbot_role_ast_defense(), havocbot_role_ast_offense(), havocbot_role_ctf_carrier(), havocbot_role_ctf_defense(), havocbot_role_ctf_escort(), havocbot_role_ctf_middle(), havocbot_role_ctf_offense(), havocbot_role_ctf_retriever(), havocbot_role_cts(), havocbot_role_dom(), havocbot_role_ft_freeing(), havocbot_role_ft_offense(), havocbot_role_generic(), havocbot_role_ka_carrier(), havocbot_role_ka_collector(), havocbot_role_kh_carrier(), havocbot_role_kh_defense(), havocbot_role_kh_freelancer(), havocbot_role_kh_offense(), havocbot_role_ons_offense(), and havocbot_role_race().
Definition at line 43 of file navigation.qc.
References bot_strategytime, ERASEABLE, and time.
Referenced by bot_think(), havocbot_role_ast_defense(), havocbot_role_ast_offense(), havocbot_role_ctf_carrier(), havocbot_role_ctf_defense(), havocbot_role_ctf_escort(), havocbot_role_ctf_middle(), havocbot_role_ctf_offense(), havocbot_role_ctf_retriever(), havocbot_role_cts(), havocbot_role_dom(), havocbot_role_ft_freeing(), havocbot_role_ft_offense(), havocbot_role_generic(), havocbot_role_ka_carrier(), havocbot_role_ka_collector(), havocbot_role_kh_carrier(), havocbot_role_kh_defense(), havocbot_role_kh_freelancer(), havocbot_role_kh_offense(), havocbot_role_ons_offense(), and havocbot_role_race().
Definition at line 55 of file navigation.qc.
References autocvar_bot_ai_ignoregoal_timeout, bot_strategytime, goalentity, havocbot_goalrating_item_pickable_check_players(), ignoregoal, ignoregoaltime, IS_MOVABLE, origin, time, vdist, and vector().
Referenced by havocbot_movetogoal().
Definition at line 35 of file navigation.qc.
References bot_strategytime, and time.
Referenced by havocbot_movetogoal(), havocbot_role_ctf_escort(), havocbot_role_ctf_setrole(), havocbot_role_ka_carrier(), havocbot_role_ka_collector(), navigation_goalrating_timeout_force(), and navigation_unstuck().
Definition at line 49 of file navigation.qc.
References bot_strategytime, max(), and time.
Definition at line 28 of file navigation.qc.
References navigation_goalrating_timeout_expire().
Referenced by bot_think(), havocbot_ai(), havocbot_chooserole(), havocbot_movetogoal(), havocbot_role_ctf_retriever(), and havocbot_role_ctf_setrole().
Definition at line 19 of file navigation.qc.
References autocvar_bot_ai_strategyinterval, autocvar_bot_ai_strategyinterval_movingtarget, bot_strategytime, goalentity, IS_MOVABLE, and time.
Referenced by havocbot_role_ast_defense(), havocbot_role_ast_offense(), havocbot_role_ctf_carrier(), havocbot_role_ctf_defense(), havocbot_role_ctf_escort(), havocbot_role_ctf_middle(), havocbot_role_ctf_offense(), havocbot_role_ctf_retriever(), havocbot_role_cts(), havocbot_role_dom(), havocbot_role_ft_freeing(), havocbot_role_ft_offense(), havocbot_role_generic(), havocbot_role_ka_carrier(), havocbot_role_ka_collector(), havocbot_role_kh_carrier(), havocbot_role_kh_defense(), havocbot_role_kh_freelancer(), havocbot_role_kh_offense(), havocbot_role_ons_offense(), havocbot_role_race(), and navigation_unstuck().
Definition at line 1081 of file navigation.qc.
References g_waypoints, IL_EACH, IS_ONGROUND, navigation_markroutes_nearestwaypoints(), NULL, and vector().
Referenced by navigation_goalrating_start(), and waypoint_unreachable().
Definition at line 1053 of file navigation.qc.
References bound(), v, vector(), waypoint_gettravelcost(), and WAYPOINTFLAG_TELEPORT.
Definition at line 1171 of file navigation.qc.
References error(), g_waypoints, IL_EACH, NULL, and vector().
Referenced by waypoint_unreachable().
Definition at line 1024 of file navigation.qc.
References g_waypoints, and IL_EACH.
Referenced by navigation_markroutes().
Definition at line 846 of file navigation.qc.
References FLOAT_MAX, goalcurrent, goalcurrent_distance_2d, goalcurrent_distance_time, goalcurrent_distance_z, goalcurrent_prev, goalentity, goalentity_lock_timeout, goalstack01, goalstack02, goalstack03, goalstack04, goalstack05, goalstack06, goalstack07, goalstack08, goalstack09, goalstack10, goalstack11, goalstack12, goalstack13, goalstack14, goalstack15, goalstack16, goalstack17, goalstack18, goalstack19, goalstack20, goalstack21, goalstack22, goalstack23, goalstack24, goalstack25, goalstack26, goalstack27, goalstack28, goalstack29, goalstack30, goalstack31, and NULL.
Referenced by navigation_goalrating_end(), navigation_poptouchedgoals(), and navigation_shortenpath().
Definition at line 1629 of file navigation.qc.
References absmax, absmin, AI_STATUS_RUNNING, AI_STATUS_WAYPOINT_PERSONAL_GOING, AI_STATUS_WAYPOINT_PERSONAL_REACHED, aistatus, BOT_BUNNYHOP_WP_DETECTION_RANGE, boxesoverlap(), entity(), eZ, goalcurrent, goalstack01, goalstack02, goalstack03, IS_PLAYER, jumpheight_vec, jumppadcount, ladder_entity, lastteleporttime, navigation_poproute(), NULL, origin, random(), TELEPORT_USED, time, trace_fraction, vdist, vec2, vector(), velocity, view_ofs, vlen2, WAYPOINTFLAG_JUMP, WAYPOINTFLAG_PERSONAL, and WAYPOINTFLAG_TELEPORT.
Referenced by havocbot_movetogoal().
Definition at line 800 of file navigation.qc.
References FLOAT_MAX, goalcurrent, goalcurrent_distance_2d, goalcurrent_distance_time, goalcurrent_distance_z, goalcurrent_prev, goalentity, goalstack01, goalstack02, goalstack03, goalstack04, goalstack05, goalstack06, goalstack07, goalstack08, goalstack09, goalstack10, goalstack11, goalstack12, goalstack13, goalstack14, goalstack15, goalstack16, goalstack17, goalstack18, goalstack19, goalstack20, goalstack21, goalstack22, goalstack23, goalstack24, goalstack25, goalstack26, goalstack27, goalstack28, goalstack29, goalstack30, goalstack31, and NULL.
Referenced by havocbot_ai(), havocbot_movetogoal(), and navigation_routetogoal().
Definition at line 1220 of file navigation.qc.
References autocvar_bot_ai_navigation_jetpack, autocvar_bot_ai_navigation_jetpack_mindistance, CONTENT_LAVA, CONTENT_SLIME, CONTENT_SOLID, CONTENT_WATER, entity(), etos(), fabs(), FL_PARTIALGROUND, FLOAT_MAX, ftos(), g_waypoints, GetResource(), IL_EACH, IS_BOT_CLIENT, IS_ONGROUND, IS_PLAYER, items, LOG_DEBUG, MOVE_NORMAL, navigation_bestgoal, navigation_bestrating, navigation_findnearestwaypoint(), navigation_jetpack_goal, navigation_jetpack_point, NULL, origin, random(), time, trace_endpos, trace_fraction, vdist, vector(), vlen(), WATERLEVEL_WETFEET, waypoint_getlinearcost(), waypoint_gettravelcost(), waypointeditor_enabled, WAYPOINTFLAG_PERSONAL, and WAYPOINTFLAG_TELEPORT.
Referenced by havocbot_ctf_teamcount(), havocbot_goalrating_ast_targets(), havocbot_goalrating_ball(), havocbot_goalrating_ctf_droppedflags(), havocbot_goalrating_ctf_enemybase(), havocbot_goalrating_ctf_enemyflag(), havocbot_goalrating_ctf_ourbase(), havocbot_goalrating_ctf_ourstolenflag(), havocbot_goalrating_enemyplayers(), havocbot_goalrating_ft_freeplayers(), havocbot_goalrating_items(), havocbot_goalrating_kh(), havocbot_goalrating_ons_controlpoints_attack(), havocbot_goalrating_ons_generator_attack(), havocbot_moveto_refresh_route(), havocbot_role_cts(), and havocbot_role_race().
Definition at line 1429 of file navigation.qc.
References autocvar_bot_ai_strategyinterval_movingtarget, bot_navigation_movemode, checkpvs(), entity(), goalcurrent, goalentity, IS_MOVABLE, items, MAX_CHASE_DISTANCE, navigation_item_add_link, navigation_item_getlinknum, navigation_item_initlinks_ifneeded, navigation_item_iswalkablelink, navigation_jetpack_goal, navigation_pushroute(), NULL, origin, set_tracewalk_dest(), trace_ent, tracewalk(), tracewalk_dest, tracewalk_dest_height, vdist, vec2, vlen2, waypointeditor_enabled, WAYPOINTFLAG_PERSONAL, WAYPOINTFLAG_TELEPORT, wp_goal_prev0, wp_goal_prev1, and WPFLAGMASK_NORELINK.
Referenced by havocbot_movetogoal(), navigation_goalrating_end(), and navigation_unstuck().
Definition at line 1554 of file navigation.qc.
References bot_navigation_movemode, bot_tracewalk_time, checkpvs(), entity(), fabs(), goalcurrent, goalentity, goalstack01, IS_MOVABLE, LOG_DEBUG, max(), MAX_CHASE_DISTANCE, maxs, mins, navigation_poproute(), netname, next, origin, set_tracewalk_dest(), time, trace_ent, tracewalk(), tracewalk_dest, tracewalk_dest_height, vdist, vectoangles(), vector(), view_ofs, vlen2, WAYPOINTFLAG_JUMP, and WAYPOINTFLAG_TELEPORT.
Referenced by havocbot_movetogoal().
Definition at line 1907 of file navigation.qc.
References AI_STATUS_STUCK, aistatus, autocvar_bot_wander_enable, bot_navigation_movemode, bot_strategytoken, bot_waypoint_queue_bestgoal, bot_waypoint_queue_bestgoalrating, bot_waypoint_queue_goal, bot_waypoint_queue_owner, entity(), ftos(), g_waypoints, goalentity, IL_EACH, LOG_DEBUG, navigation_clearroute(), navigation_goalrating_timeout_expire(), navigation_goalrating_timeout_set(), navigation_routetogoal(), netname, NULL, origin, random(), set_tracewalk_dest(), tracewalk(), tracewalk_dest, tracewalk_dest_height, vlen2, and WAYPOINTFLAG_GENERATED.
Referenced by bot_think().
float navigation_waypoint_will_link | ( | vector | v, |
vector | org, | ||
entity | ent, | ||
vector | v2, | ||
float | v2_height, | ||
vector | o2, | ||
float | o2_height, | ||
float | walkfromwp, | ||
float | bestdist | ||
) |
Definition at line 895 of file navigation.qc.
References bot_navigation_movemode, trace_fraction, tracewalk(), and vdist.
Referenced by botframe_autowaypoints_fix_from(), and navigation_findnearestwaypoint_withdist_except().
Definition at line 244 of file navigation.qc.
Definition at line 119 of file navigation.qc.
References bound(), IS_MONSTER, IS_ONGROUND, IS_PLAYER, MOVE_NORMAL, trace_endpos, trace_startsolid, tracewalk_dest, tracewalk_dest_height, vec2, and vector().
Referenced by havocbot_movetogoal(), navigation_findnearestwaypoint_withdist_except(), navigation_get_really_close_waypoint(), navigation_routetogoal(), navigation_shortenpath(), and navigation_unstuck().
Definition at line 177 of file navigation.qc.
References bound(), tracewalk_dest, tracewalk_dest_height, and vector().
Referenced by waypoint_think().
bool tracewalk | ( | entity | e, |
vector | start, | ||
vector | m1, | ||
vector | m2, | ||
vector | end, | ||
float | end_height, | ||
float | movemode | ||
) |
Definition at line 273 of file navigation.qc.
References autocvar_bot_debug_tracewalk, bound(), DEBUG_NODE_FAIL, DEBUG_NODE_SUCCESS, DEBUG_NODE_WARNING, debugnode(), debugnodestatus(), debugresetnodes(), eZ, IN_LAVA, jumpheight_vec, jumpstepheightvec, MOVE_NOMONSTERS, NAV_SWIM_ONWATER, NAV_SWIM_UNDERWATER, NAV_WALK, navigation_checkladders(), normalize(), RESURFACE_LIMITED, stepheightvec, SUBMERGED, trace_endpos, trace_ent, trace_fraction, trace_startsolid, v, vec2, vector(), vlen(), and WETFEET.
Referenced by GameCommand_trace(), havocbot_movetogoal(), navigation_get_really_close_waypoint(), navigation_routetogoal(), navigation_shortenpath(), navigation_unstuck(), and navigation_waypoint_will_link().
float goalcounter |
Definition at line 2057 of file navigation.qc.
Referenced by debuggoalstack().
vector lastposition |
Definition at line 2058 of file navigation.qc.
Referenced by debuggoalstack().
float speed |
Definition at line 17 of file navigation.qc.