]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/server/pathlib/pathlib.qh
- rename sys_ticrate global to sys_frametime, and premultiply it with slowmo (fixes...
[divverent/nexuiz.git] / data / qcsrc / server / pathlib / pathlib.qh
1 .entity path_next;
2 .entity path_prev;
3
4 #define inwater(point) (pointcontents(point) == CONTENT_WATER)
5 #define medium spawnshieldtime
6
7 #define PLIB_FORWARD '0 1 0'
8 //#define PLIB_BACK    '0 -1 0'
9 #define PLIB_RIGHT   '1 0 0'
10 //#define PLIB_LEFT    '-1 0 0'
11
12 #define DEBUGPATHING
13 #ifdef DEBUGPATHING
14 void pathlib_showpath(entity start);
15 void pathlib_showpath2(entity path);
16 #endif
17
18 entity openlist;
19 entity closedlist;
20 entity goal_node;
21
22 .float is_path_node;
23 .float pathlib_node_g;
24 .float pathlib_node_h;
25 .float pathlib_node_f;
26
27 float pathlib_open_cnt;
28 float pathlib_closed_cnt;
29 float pathlib_made_cnt;
30 float pathlib_merge_cnt;
31 float pathlib_searched_cnt;
32 float pathlib_bestopen_seached;
33 float pathlib_bestcash_hits;
34 float pathlib_bestcash_saved;
35 float pathlib_gridsize;
36 float pathlib_movecost;
37 float pathlib_movecost_diag;
38 float pathlib_movecost_waterfactor;
39 float pathlib_foundgoal;
40
41 float pathlib_starttime;
42 #define pathlib_maxtime 5
43
44 entity best_open_node;
45
46 vector tile_check_up;
47 vector tile_check_down;
48 float  tile_check_size;
49 float      tile_check_cross(vector where);
50 float      tile_check_plus(vector where);
51 float      tile_check_star(vector where);
52 var float  tile_check(vector where);
53
54 float  movenode_stepsize;
55 vector movenode_stepup;
56 vector movenode_maxdrop;
57 vector movenode_boxup;
58 vector movenode_boxmax;
59 vector movenode_boxmin;
60 float  pathlib_movenode_goodnode;
61
62 vector     pathlib_wateroutnode(vector start, vector end);
63 vector     pathlib_swimnode(vector start, vector end);
64 vector     pathlib_flynode(vector start, vector end);
65 vector     pathlib_walknode(vector start, vector end, float doedge);
66 var vector pathlib_movenode(vector start, vector end, float doedge);
67
68 float      pathlib_expandnode_star(entity node, vector start, vector goal);
69 float      pathlib_expandnode_box(entity node, vector start, vector goal);
70 float      pathlib_expandnode_octagon(entity node, vector start, vector goal);
71 var float  pathlib_expandnode(entity node, vector start, vector goal);
72
73 float      pathlib_g_static(entity parent, vector to, float static_cost);
74 float      pathlib_g_static_water(entity parent, vector to, float static_cost);
75 float      pathlib_g_euclidean(entity parent, vector to, float static_cost);
76 float      pathlib_g_euclidean_water(entity parent, vector to, float static_cost);
77 var float  pathlib_cost(entity parent, vector to, float static_cost);
78
79 float      pathlib_h_manhattan(vector a, vector b);
80 float      pathlib_h_diagonal(vector a, vector b);
81 float      pathlib_h_euclidean(vector a,vector b);
82 float      pathlib_h_diagonal2(vector a, vector b);
83 float      pathlib_h_diagonal3(vector a, vector b);
84 float      pathlib_h_diagonal2sdp(vector preprev, vector prev, vector point, vector end);
85 var float  pathlib_heuristic(vector from, vector to);
86
87 var float  pathlib_makenode(entity parent,vector start, vector to, vector goal,float cost);
88 var float  buildpath_nodefilter(vector n,vector c,vector p);
89
90
91 #ifdef DEBUGPATHING
92 #include "debug.qc"
93 #endif
94
95 #include "utility.qc"
96 #include "movenode.qc"
97 #include "costs.qc"
98 #include "expandnode.qc"
99 #include "main.qc"