Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
pathlib.qh
Go to the documentation of this file.
1#pragma once
2
3#ifndef DEBUGPATHING
4 #define DEBUGPATHING 0
5#endif
6
8.entity path_next;
9.entity path_prev;
10
11#define inwater(point) (pointcontents(point) == CONTENT_WATER)
12
13const vector PLIB_FORWARD = '0 1 0';
14//#define PLIB_BACK '0 -1 0'
15const vector PLIB_RIGHT = '1 0 0';
16//#define PLIB_LEFT '-1 0 0'
17
20
23
29
41
55
57const float pathlib_maxtime = 60;
58
60
64bool tile_check_cross(entity this, vector where);
65bool tile_check_plus(entity this, vector where);
66bool tile_check_star(entity this, vector where);
67var bool tile_check(entity this, vector where);
68
76
77vector pathlib_wateroutnode(entity this, vector start, vector end, float doedge);
78vector pathlib_swimnode(entity this, vector start, vector end, float doedge);
79vector pathlib_flynode(entity this, vector start, vector end, float doedge);
80vector pathlib_walknode(entity this, vector start, vector end, float doedge);
81var vector pathlib_movenode(entity this, vector start, vector end, float doedge);
82
83//float pathlib_expandnode_starf(entity node, vector start, vector goal);
84float pathlib_expandnode_star(entity node, vector start, vector goal);
85float pathlib_expandnode_box(entity node, vector start, vector goal);
86//float pathlib_expandnode_octagon(entity node, vector start, vector goal);
87var float pathlib_expandnode(entity node, vector start, vector goal);
88
89float pathlib_g_static(entity parent, vector to, float static_cost);
90float pathlib_g_static_water(entity parent, vector to, float static_cost);
91float pathlib_g_euclidean(entity parent, vector to, float static_cost);
92float pathlib_g_euclidean_water(entity parent, vector to, float static_cost);
93var float pathlib_cost(entity parent, vector to, float static_cost);
94
100float pathlib_h_diagonal2sdp(vector preprev, vector prev, vector point, vector end);
101float pathlib_h_none(vector preprev, vector prev) { return 0; }
102var float pathlib_heuristic(vector from, vector to);
103
104var bool pathlib_makenode(entity parent,vector start, vector to, vector goal,float cost);
106
108
entity parent
Definition animhost.qc:7
#define BIT(n)
Only ever assign into the first 24 bits in QC (so max is BIT(23)).
Definition bits.qh:8
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
limitations: NULL cannot be present elements can only be present once a maximum of IL_MAX lists can e...
prev
Definition all.qh:71
#define IL_NEW()
const float pathlib_node_edgeflag_forwardright
Definition pathlib.qh:38
float pathlib_g_euclidean(entity parent, vector to, float static_cost)
Definition costs.qc:16
float pathlib_node_c
Definition pathlib.qh:28
float pathlib_movecost_diag
Definition pathlib.qh:52
vector movenode_boxup
Definition pathlib.qh:72
var bool buildpath_nodefilter(vector n, vector c, vector p)
float pathlib_expandnode_star(entity node, vector start, vector goal)
Definition expandnode.qc:96
entity openlist
Definition pathlib.qh:18
float pathlib_h_manhattan(vector a, vector b)
Manhattan heuristic means we expect to move up, down left or right No diagonal moves expected.
Definition costs.qc:34
const float pathlib_maxtime
Definition pathlib.qh:57
const vector PLIB_FORWARD
Definition pathlib.qh:13
var bool tile_check(entity this, vector where)
float pathlib_foundgoal
Definition pathlib.qh:54
vector movenode_maxdrop
Definition pathlib.qh:71
float pathlib_merge_cnt
Definition pathlib.qh:45
var vector pathlib_movenode(entity this, vector start, vector end, float doedge)
bool pathlib_movenode_goodnode
Definition pathlib.qh:75
float pathlib_searched_cnt
Definition pathlib.qh:46
var float pathlib_wpp_waypointcallback(entity wp, entity wp_prev)
float pathlib_node_h
Definition pathlib.qh:26
IntrusiveList g_pathlib_nodes
Definition pathlib.qh:109
const float pathlib_node_edgeflag_backright
Definition pathlib.qh:36
var float pathlib_cost(entity parent, vector to, float static_cost)
entity pathlib_list
Definition pathlib.qh:7
vector tile_check_up
Definition pathlib.qh:61
var float pathlib_heuristic(vector from, vector to)
float pathlib_h_diagonal2sdp(vector preprev, vector prev, vector point, vector end)
This heuristic consider both straight and diagonal moves, But has a separate cost for diagonal moves.
Definition costs.qc:98
float pathlib_starttime
Definition pathlib.qh:56
float pathlib_g_euclidean_water(entity parent, vector to, float static_cost)
Definition costs.qc:21
const float pathlib_node_edgeflag_forward
Definition pathlib.qh:33
const float pathlib_node_edgeflag_left
Definition pathlib.qh:31
var bool pathlib_makenode(entity parent, vector start, vector to, vector goal, float cost)
bool is_path_node
Definition pathlib.qh:24
bool tile_check_cross(entity this, vector where)
Definition utility.qc:43
float pathlib_node_f
Definition pathlib.qh:27
entity goal_node
Definition pathlib.qh:21
const float pathlib_node_edgeflag_forwardleft
Definition pathlib.qh:37
float pathlib_open_cnt
Definition pathlib.qh:42
const float pathlib_node_edgeflag_right
Definition pathlib.qh:32
var float pathlib_expandnode(entity node, vector start, vector goal)
float pathlib_g_static(entity parent, vector to, float static_cost)
Definition costs.qc:3
const float pathlib_node_edgeflag_unknown
Definition pathlib.qh:30
float pathlib_node_g
Definition pathlib.qh:25
vector pathlib_walknode(entity this, vector start, vector end, float doedge)
Definition movenode.qc:88
entity path_prev
Definition pathlib.qh:9
float pathlib_node_edgeflags
Definition pathlib.qh:40
float pathlib_h_diagonal3(vector a, vector b)
Definition costs.qc:122
const float pathlib_node_edgeflag_backleft
Definition pathlib.qh:35
bool tile_check_star(entity this, vector where)
Definition utility.qc:206
const vector PLIB_RIGHT
Definition pathlib.qh:15
entity closedlist
Definition pathlib.qh:19
const float pathlib_node_edgeflag_back
Definition pathlib.qh:34
const float pathlib_node_edgeflag_none
Definition pathlib.qh:39
float pathlib_expandnode_box(entity node, vector start, vector goal)
float pathlib_movecost_waterfactor
Definition pathlib.qh:53
vector movenode_stepup
Definition pathlib.qh:70
float pathlib_h_diagonal(vector a, vector b)
This heuristic consider both straight and diagonal moves to have the same cost.
Definition costs.qc:49
float pathlib_bestcash_saved
Definition pathlib.qh:49
entity path_next
Definition pathlib.qh:8
float pathlib_movecost
Definition pathlib.qh:51
float pathlib_h_euclidean(vector a, vector b)
This heuristic only considers the straight line distance.
Definition costs.qc:65
vector pathlib_wateroutnode(entity this, vector start, vector end, float doedge)
Definition movenode.qc:11
float pathlib_bestopen_searched
Definition pathlib.qh:47
float pathlib_h_diagonal2(vector a, vector b)
This heuristic consider both straight and diagonal moves, but has a separate cost for diagonal moves.
Definition costs.qc:74
float pathlib_bestcash_hits
Definition pathlib.qh:48
float pathlib_h_none(vector preprev, vector prev)
Definition pathlib.qh:101
float pathlib_gridsize
Definition pathlib.qh:50
vector pathlib_flynode(entity this, vector start, vector end, float doedge)
Definition movenode.qc:65
vector movenode_boxmin
Definition pathlib.qh:74
entity best_open_node
Definition pathlib.qh:59
float pathlib_made_cnt
Definition pathlib.qh:44
bool tile_check_plus(entity this, vector where)
Definition utility.qc:77
float tile_check_size
Definition pathlib.qh:63
vector tile_check_down
Definition pathlib.qh:62
entity start_node
Definition pathlib.qh:22
vector movenode_boxmax
Definition pathlib.qh:73
float movenode_stepsize
Definition pathlib.qh:69
float pathlib_closed_cnt
Definition pathlib.qh:43
vector pathlib_swimnode(entity this, vector start, vector end, float doedge)
Definition movenode.qc:45
float pathlib_g_static_water(entity parent, vector to, float static_cost)
Definition costs.qc:8
vector
Definition self.qh:92
#define STATIC_INIT(func)
during worldspawn
Definition static.qh:32