|
Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
|
|
#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/mutators/mutator/status_effects/_mod.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) |
Variables | |
| float | goalcounter |
| vector | lastposition |
| float | speed |
| #define MAX_CHASE_DISTANCE 700 |
Definition at line 55 of file navigation.qc.
Referenced by navigation_routetogoal(), and navigation_shortenpath().
| #define NAV_SWIM_ONWATER 1 |
Definition at line 267 of file navigation.qc.
Referenced by tracewalk().
| #define NAV_SWIM_UNDERWATER 2 |
Definition at line 268 of file navigation.qc.
Referenced by tracewalk().
| #define NAV_WALK 0 |
Definition at line 266 of file navigation.qc.
Referenced by tracewalk().
| #define RESURFACE_LIMITED | ( | org, | |
| lim ) |
Definition at line 1874 of file navigation.qc.
References entity(), g_bot_dodge, g_waypoints, IL_EACH, and vector.
Referenced by bot_serverframe().
Definition at line 2062 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, org, origin, and vector.
Referenced by havocbot_moveto(), and havocbot_movetogoal().
Definition at line 2019 of file navigation.qc.
References debuglastnode, entity(), IS_PLAYER, NULL, and vector.
Referenced by tracewalk().
Definition at line 2034 of file navigation.qc.
References DEBUG_NODE_FAIL, DEBUG_NODE_SUCCESS, DEBUG_NODE_WARNING, and vector.
Referenced by tracewalk().
| void debugresetnodes | ( | ) |
Definition at line 104 of file navigation.qc.
References bound(), dest, entity(), org, and vector.
Referenced by havocbot_ai(), havocbot_bunnyhop(), havocbot_moveto(), and havocbot_movetogoal().
Definition at line 204 of file navigation.qc.
References entity(), IS_PLAYER, SUBMERGED, SUBMERGED_NO, SUBMERGED_UNDEFINED, SUBMERGED_YES, vector, 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 224 of file navigation.qc.
References boxesoverlap(), entity(), g_ladders, IL_EACH, org, PL_MAX_CONST, PL_MIN_CONST, trace_fraction, vec2, and vector.
Referenced by tracewalk().
Definition at line 751 of file navigation.qc.
References entity(), 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 77 of file navigation.qc.
References bot_basewaypoint, entity(), navigation_dynamicgoal, nearestwaypoint, nearestwaypointtimeout, and time.
Referenced by ctf_DelayedFlagSetup(), ka_SpawnBalls(), kh_Key_Spawn(), PutPlayerInServer(), tka_SpawnBalls(), and W_ThrowNewWeapon().
Definition at line 87 of file navigation.qc.
References entity(), nearestwaypoint, nearestwaypointtimeout, and time.
Referenced by ctf_Handle_Throw(), ka_DropEvent(), ka_RespawnBall(), kh_Key_Detach(), tka_DropEvent(), and tka_RespawnBall().
Definition at line 96 of file navigation.qc.
References bot_basewaypoint, entity(), nearestwaypoint, and nearestwaypointtimeout.
Referenced by ctf_RespawnFlag(), ka_TouchEvent(), kh_Key_Attach(), and tka_TouchEvent().
Definition at line 1012 of file navigation.qc.
References autocvar_g_waypointeditor_auto, entity(), navigation_findnearestwaypoint_withdist_except(), NULL, and WAYPOINTFLAG_PROTECTED.
Referenced by waypoint_remove_fromeditor(), and waypoint_unreachable().
| entity navigation_findnearestwaypoint_withdist_except | ( | entity | ent, |
| float | walkfromwp, | ||
| float | bestdist, | ||
| entity | except ) |
Definition at line 919 of file navigation.qc.
References boxesoverlap(), entity(), g_waypoints, IL_EACH, IS_BOT_CLIENT, vector, waypointeditor_enabled, WAYPOINTFLAG_JUMP, and WAYPOINTFLAG_TELEPORT.
Referenced by navigation_findnearestwaypoint().
Definition at line 1784 of file navigation.qc.
References AI_STATUS_RUNNING, aistatus, BOT_BUNNYHOP_WP_DETECTION_RANGE, entity(), g_waypoints, goalcurrent, goalcurrent_prev, IL_EACH, NULL, vdist, WAYPOINTFLAG_JUMP, and WAYPOINTFLAG_TELEPORT.
Referenced by navigation_goalrating_start().
Definition at line 1846 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, origin, and STAT.
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(), havocbot_role_race(), havocbot_role_tka_carrier(), and havocbot_role_tka_collector().
Definition at line 1831 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(), havocbot_role_race(), havocbot_role_tka_carrier(), and havocbot_role_tka_collector().
Definition at line 44 of file navigation.qc.
References bot_strategytime, entity(), 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(), havocbot_role_race(), havocbot_role_tka_carrier(), and havocbot_role_tka_collector().
Definition at line 56 of file navigation.qc.
References autocvar_bot_ai_ignoregoal_timeout, autocvar_sv_maxspeed, bot_strategytime, entity(), goalentity, havocbot_goalrating_item_pickable_check_players(), ignoregoal, ignoregoaltime, IS_MOVABLE, origin, time, vdist, and vector.
Referenced by havocbot_movetogoal().
Definition at line 36 of file navigation.qc.
References bot_strategytime, entity(), and time.
Referenced by havocbot_movetogoal(), havocbot_role_ctf_escort(), havocbot_role_ctf_setrole(), havocbot_role_ka_carrier(), havocbot_role_ka_collector(), havocbot_role_tka_carrier(), havocbot_role_tka_collector(), navigation_goalrating_timeout_force(), and navigation_unstuck().
Definition at line 50 of file navigation.qc.
References bot_strategytime, entity(), max(), and time.
Definition at line 29 of file navigation.qc.
References entity(), and 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 20 of file navigation.qc.
References autocvar_bot_ai_strategyinterval, autocvar_bot_ai_strategyinterval_movingtarget, bot_strategytime, entity(), 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(), havocbot_role_tka_carrier(), havocbot_role_tka_collector(), and navigation_unstuck().
Definition at line 1082 of file navigation.qc.
References entity(), g_waypoints, IL_EACH, IS_ONGROUND, navigation_markroutes_nearestwaypoints(), NULL, and vector.
Referenced by navigation_goalrating_start(), and waypoint_unreachable().
Definition at line 1054 of file navigation.qc.
References bound(), entity(), vector, waypoint_gettravelcost(), and WAYPOINTFLAG_TELEPORT.
Definition at line 1172 of file navigation.qc.
References entity(), error, g_waypoints, IL_EACH, NULL, and vector.
Referenced by waypoint_unreachable().
Definition at line 1025 of file navigation.qc.
References entity(), g_waypoints, and IL_EACH.
Referenced by navigation_markroutes().
Definition at line 847 of file navigation.qc.
References entity(), 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 1630 of file navigation.qc.
References absmax, absmin, AI_STATUS_RUNNING, AI_STATUS_WAYPOINT_PERSONAL_GOING, AI_STATUS_WAYPOINT_PERSONAL_REACHED, aistatus, autocvar_sv_maxspeed, 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(), STAT, 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 801 of file navigation.qc.
References entity(), 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 1221 of file navigation.qc.
References CONTENT_LAVA, CONTENT_SLIME, CONTENT_SOLID, CONTENT_WATER, entity(), FL_PARTIALGROUND, FLOAT_MAX, g_waypoints, IL_EACH, IS_ONGROUND, IS_PLAYER, NULL, STAT, trace_endpos, tracebox_hits_trigger_hurt(), vdist, WATERLEVEL_WETFEET, waypoint_getlinearcost(), and WAYPOINTFLAG_TELEPORT.
Referenced by 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 1430 of file navigation.qc.
References autocvar_bot_ai_strategyinterval_movingtarget, bot_navigation_movemode, checkpvs(), entity(), goalcurrent, goalentity, IS_MOVABLE, IT_JETPACK, 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, PL_MAX_CONST, PL_MIN_CONST, set_tracewalk_dest(), STAT, trace_ent, tracewalk(), tracewalk_dest, tracewalk_dest_height, vdist, vec2, vector, 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 1555 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 1908 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(), FOREACH_ENTITY_RADIUS, 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(), STAT, 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 896 of file navigation.qc.
References bot_navigation_movemode, entity(), org, PL_MAX_CONST, PL_MIN_CONST, trace_fraction, tracewalk(), vdist, and vector.
Referenced by botframe_autowaypoints_fix_from().
Definition at line 120 of file navigation.qc.
References bound(), entity(), IS_MONSTER, IS_ONGROUND, IS_PLAYER, MOVE_NORMAL, org, PL_MAX_CONST, PL_MIN_CONST, trace_endpos, trace_startsolid, tracewalk_dest, tracewalk_dest_height, vec2, and vector.
Referenced by havocbot_movetogoal(), navigation_routetogoal(), navigation_shortenpath(), and navigation_unstuck().
Definition at line 178 of file navigation.qc.
References bound(), entity(), org, 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 274 of file navigation.qc.
References autocvar_bot_debug_tracewalk, bound(), DEBUG_NODE_FAIL, DEBUG_NODE_SUCCESS, DEBUG_NODE_WARNING, debugnode(), debugnodestatus(), debugresetnodes(), entity(), eZ, IN_LAVA, jumpheight_vec, jumpstepheightvec, MOVE_NOMONSTERS, NAV_SWIM_ONWATER, NAV_SWIM_UNDERWATER, NAV_WALK, navigation_checkladders(), normalize(), org, RESURFACE_LIMITED, stepheightvec, SUBMERGED, trace_endpos, trace_ent, trace_fraction, trace_startsolid, vec2, vector, vlen(), and WETFEET.
Referenced by GameCommand_trace(), havocbot_movetogoal(), navigation_routetogoal(), navigation_shortenpath(), navigation_unstuck(), navigation_waypoint_will_link(), and waypoint_think().
| float goalcounter |
Definition at line 2058 of file navigation.qc.
Referenced by debuggoalstack().
| vector lastposition |
Definition at line 2059 of file navigation.qc.
Referenced by debuggoalstack().
| float speed |
Definition at line 18 of file navigation.qc.