Debian Codegraph @

Descent3/aistruct.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/main/aistruct.h $
21 * $Revision: 112 $
22 * $Date: 10/23/99 2:43a $
23 * $Author: Chris $
24 *
25 * This header is for AI structures
26 *
27 * $Log: /DescentIII/main/aistruct.h $
28 *
29 * 112 10/23/99 2:43a Chris
30 * Added the PutObjectOnObject AI Goal
31 *
32 * 111 5/09/99 8:11p Chris
33 * Made the whole see/hear distintion work (mostly)
34 *
35 * 110 5/08/99 4:12p Chris
36 * Added AI hearing noises... version 1
37 *
38 * 109 4/10/99 6:39p Matt
39 * Only save the designer-editable AI data in the Object_info array,
40 * instead of the whole ai_frame structure. This saves 3200 bytes per
41 * Object_info entry, which is about 2 MB overall.
42 *
43 * 108 4/09/99 10:33a Chris
44 * Improvements to Freud
45 *
46 * 107 4/08/99 3:35p Chris
47 * Improved the Fear factor in Freud
48 *
49 * 106 4/06/99 11:05p Chris
50 * Goal unique id's
51 *
52 * 105 4/02/99 10:18a Chris
53 * We can now mess with the Object_info anim stuff
54 *
55 * 104 3/30/99 4:32p Chris
56 * Moved subtype to the main goal sturct (from goal_info). Made move
57 * relative object vec finishable. (Like get behind player)
58 *
59 * 103 3/27/99 12:29p Chris
60 * Fixed problems with assigned lower priority goals that used paths (it
61 * would confuse the bot because the .path field was getting updated for
62 * the new goal even though it was lower priority)
63 *
64 * 102 3/22/99 10:58a Chris
65 * Awareness code was tweaked. Multisafe stuff added for objects.
66 *
67 * 101 3/17/99 5:23p Chris
68 * Fixed problems with low-priority paths
69 *
70 * 100 3/03/99 7:20p Jeff
71 * save/restore some ai path information
72 *
73 * 99 3/03/99 10:51a Chris
74 * Got rid of goal_ptr
75 *
76 * 98 2/17/99 1:21a Chris
77 * Updated the AI movement algorithm, fixed many bugs, added the
78 * last_dodge_dir vector so that robots can dodge the vauss and the like
79 *
80 * 97 2/15/99 9:03p Chris
81 * Added the base FOV off UVEC code and converted all the turrets
82 *
83 * 96 2/09/99 9:58a Chris
84 * Massive BOA update :) Terrain happy now. Vis happy now. Sound happy
85 * now.
86 *
87 * 95 1/25/99 7:43a Chris
88 * Added the GUID (Goal Unique Id) and added the ability for weapon
89 * batteries to always fire exactly forward.
90 *
91 * 94 1/24/99 8:17p Chris
92 * Updated AI and OSIRIS. Externalized fireball constants for spew and
93 * sparks. Added CreateRandomSparks to OSIRIS, renamed a bunch of AI
94 * Notify names to use underscores. Fixed a memory access leak in the
95 * matcen effect code.
96 *
97 * 93 1/22/99 6:53p Chris
98 * Fixed LoadandBind Aux notify problems, fixed static path problems,
99 * fixed AIF_FORCE_AWARE Problems, improved path code
100 *
101 * 92 1/18/99 9:05a Chris
102 * Improved OSIRIS, AI, and ATTACH system, changed wiggle code, changed
103 * attach code for rad attaches, and added the AIG_ATTACH_OBJ goal
104 *
105 * 91 1/15/99 5:58p Chris
106 *
107 * 90 1/11/99 2:14p Chris
108 * Massive work on OSIRIS and AI
109 *
110 * 89 12/28/98 3:28p Chris
111 * Added aistruct_external.h
112 *
113 * 88 12/16/98 3:55p Chris
114 * Improved the sickles
115 *
116 * 87 12/14/98 12:03a Chris
117 * Turning and orientation are done in one (minus a few hacks) spot
118 *
119 * 86 12/13/98 9:18p Chris
120 * Improved influence values for in-code goals (10000 to 1.0). Added
121 * GF_ORIENT stuff. :)
122 *
123 * 85 12/11/98 1:57p Chris
124 * Improved wall walking code
125 *
126 * 84 12/03/98 5:45p Chris
127 * I just added full code support for OSIRIS/DLL controlled goals,
128 * enablers, and influence levels. :)
129 *
130 * 83 12/03/98 12:04p Chris
131 * Further de-hacked flocking and other major AI systems
132 *
133 * 82 12/02/98 5:51p Chris
134 * Added the start of scripted goals and scripted influence
135 *
136 * 81 12/01/98 6:04p Chris
137 * Made the goal flags look like a short (as the data element is a short)
138 *
139 * 80 12/01/98 4:31p Chris
140 * Checked in a massive amount of AI work. Improved flocking code. :)
141 * (Still hacked lightly). In addition, I am moving toward using the
142 * composite dir. :)
143 *
144 * 79 11/19/98 8:26p Chris
145 * Starting to add generic team avoidance code
146 *
147 * 78 11/18/98 3:59p Chris
148 * I added the avoid goal. I also improved the AIs for Evader1 and
149 * Evader2 by utilizing this goal when the target is well within the
150 * circle distance.
151 *
152 * 77 11/11/98 6:31p Chris
153 * AIF_DISABLE_FIRING and AIF_DISABLE_MELEE are now functional
154 *
155 * 76 11/06/98 11:39a Chris
156 * Robots with flamethrowers and Omega cannons work in single player
157 *
158 * 75 10/14/98 6:55p Chris
159 * Added turret change direction sounds and level goal ability to toggle
160 * auto level end
161 *
162 * 74 10/13/98 1:08p Chris
163 * Greatly improved the AI's use of paths. Improved visability checking
164 * algorithm. Probably needs a second pass for further cleanup.
165 *
166 * 73 10/09/98 7:47p Chris
167 * Added ObjSetDeadFlag
168 *
169 * 72 9/16/98 4:31p Chris
170 * Added target by distance
171 *
172 * 71 8/19/98 6:24p Chris
173 * Added more unused water support
174 *
175 * 70 8/17/98 4:56p Chris
176 * Added a new goal flag
177 *
178 * 69 8/15/98 6:11p Chris
179 * Added 13 new fields. AI fire spread works.
180 *
181 * 68 7/28/98 5:04p Chris
182 * Added some new multiplayer support (for dodging and targetting)
183 *
184 * 67 7/24/98 6:06p Chris
185 * Initial robot leading code -- needs multiple wb support
186 *
187 * 66 7/01/98 4:35p Chris
188 * More multiplayer sync issues
189 *
190 * 65 7/01/98 10:58a Chris
191 * Working on multiplayer AI stuff
192 *
193 * 64 6/30/98 6:36p Chris
194 * Added rev .1 of multiplayer animations - BTW It is totally not done.
195 *
196 * 63 6/26/98 2:52p Chris
197 * AI now reports when it updates its orientation
198 *
199 * 62 5/26/98 9:34a Chris
200 * Added XZ distances for circle dist. :)
201 *
202 * 61 5/18/98 8:06p Chris
203 * Made melee attacks closer to what I want in terms of functionality
204 *
205 * 60 5/18/98 12:40p Chris
206 * Added a new flag (F_BLINE_IF_SEE_GOAL)
207 *
208 * 59 5/17/98 9:07p Chris
209 * Fixed melee attacks. Thanks to Ala. :)
210 *
211 * 58 5/17/98 7:54p Chris
212 * Correctly integrated the goal system and circle distance stuff. Added
213 * support for "target goals".
214 *
215 * 57 5/15/98 2:58p Chris
216 * More on the big AI update
217 *
218 * 56 5/14/98 3:01p Chris
219 * More new AI code
220 *
221 * 55 5/14/98 12:21p Chris
222 * Updating AI system... Incomplete
223 *
224 * 54 5/12/98 3:51p Chris
225 * Oops
226 *
227 * 53 5/12/98 3:46p Chris
228 * Added some notify/goal system stuff and orientation to velocity
229 *
230 * 52 5/11/98 4:39p Chris
231 * Improved AI system (goals have notifies and are more flexable).
232 *
233 * 51 5/07/98 6:01p Chris
234 * More AI/OSIRIS stuff...
235 *
236 * 50 5/04/98 4:04p Chris
237 * Minestone checkin' -- energy effect and more AI functionality
238 *
239 * 49 5/03/98 7:02p Chris
240 * Improved sound support for AI system
241 *
242 * 48 5/03/98 6:03p Chris
243 * Added sound support to the animation system
244 *
245 * 47 5/01/98 3:41p Chris
246 *
247 * 46 5/31/98 3:05p Chris
248 * Allowed death anims (fixed problem with ctype union of CT_DEBRIS and
249 * CT_AI)
250 *
251 * 45 4/30/98 11:31a Chris
252 * Massive upgrades to the AI system
253 *
254 * 44 4/22/98 9:43p Chris
255 * More AI improvements
256 *
257 * 43 4/21/98 11:25a Chris
258 * Improving GET_TO_OBJ goal
259 *
260 * 42 4/19/98 9:56p Chris
261 * AI system is integrated with OSIRIS. Path system is integrated with
262 * the AI system. Bugs will ensue.
263 *
264 * 41 4/16/98 2:56p Chris
265 * Updated buddy support and intergrated scripting and AI
266 *
267 * 40 4/13/98 7:38p Chris
268 * Added more support for a 'real' AI.
269 *
270 * 39 3/31/98 4:23p Chris
271 * Added a new AIpath system
272 *
273 * 38 3/25/98 11:02a Chris
274 * version 1.0 of the new AI ranged firing code.
275 *
276 * 37 3/23/98 10:03a Chris
277 * Added independant wb animations
278 *
279 * 36 3/17/98 12:14p Chris
280 * Fixed bug with bumping player causing awareness
281 *
282 * 35 3/17/98 11:27a Chris
283 * Added object bump notifies for AI
284 *
285 * 34 3/03/98 5:02p Chris
286 * Added a status register to the ai_frame. Also, I enabled a bunch of
287 * the fields from the AI Dialog. In addiition, I tweaked how melee
288 * attacks work and animate.
289 *
290 * 33 3/02/98 6:56p Chris
291 * Changed melee_dist to melee_damage
292 *
293 * 32 3/02/98 4:16p Chris
294 * Added 14 new fields to the AI Settings Dialog/page.
295 *
296 * 31 2/27/98 7:23p Chris
297 * Started to add new AI fields -- no way near complete
298 *
299 * 30 2/16/98 11:19p Chris
300 * Added support for melee robots
301 *
302 * 29 2/16/98 1:05p Chris
303 * Added some Flinch support
304 *
305 * 28 2/16/98 2:47a Chris
306 * Massive improvements to the animation system and the AI
307 *
308 * 27 2/11/98 7:00p Chris
309 * Removed priority (changed to influence) and added activation_level
310 *
311 * 26 2/10/98 4:45p Chris
312 * Incremental changes: Made a new node_orient heuristic. Removed some
313 * bad fields from the ai_info struct.
314 *
315 * 25 2/10/98 12:14a Chris
316 * Improving the awareness system. Re-enabled super dodging. Added the
317 * auto-fluctuate speed flag (allows some diversity). Enabled FOV
318 * information.
319 *
320 * 24 2/06/98 5:51p Chris
321 * Added the ability turn robots on and off
322 *
323 * 23 2/06/98 4:19p Chris
324 * Added a boat load of path stuff
325 *
326 * 22 2/06/98 2:15a Chris
327 * Activated the max_velocity, max_delta_velocity, and max_turn_rate
328 * fields for AI objects.
329 *
330 * 21 2/02/98 8:15p Chris
331 * Updated the AI system
332 *
333 * 20 1/30/98 2:19p Chris
334 * More improvements (target vis stuff and setting of the AIN_ALWAYS_ON is
335 * now done correctly)
336 *
337 * 19 1/29/98 3:29p Chris
338 * Major update to the AI system.
339 *
340 * 18 1/20/98 4:40p Chris
341 * Fixed some visability stuff.
342 *
343 * 17 1/19/98 10:04a Matt
344 * Added new object handle system
345 *
346 * 16 1/14/98 7:57p Chris
347 * Improving the awareness system
348 *
349 * 15 11/17/97 5:59p Chris
350 * Allowed some thief stuff
351 *
352 * 14 11/14/97 11:55p Chris
353 * Dodge goals are semi-functional
354 *
355 * 13 11/12/97 5:47p Chris
356 * Incremental improvements
357 *
358 * 12 10/28/97 12:25p Chris
359 * Added support for initial class, type, and movement types. Starting to
360 * flush out the AI structure
361 *
362 * 11 10/05/97 5:29a Chris
363 * Fixed problems at ubytes cause when setting then to -1 (made them
364 * chars)
365 *
366 * 10 9/18/97 1:26p Matt
367 * Moved next_movement from object struct to ai_frame
368 *
369 * 9 8/05/97 12:17p Chris
370 *
371 * 8 7/30/97 1:31p Chris
372 * Made helicopters slightly more interesting.
373 *
374 * 7 7/29/97 12:20p Chris
375 * Incremental improvements. Fixed a memory bug.
376 *
377 * 6 7/28/97 1:19p Chris
378 * Expanding the AI system
379 *
380 * 5 7/15/97 7:29p Chris
381 * Added a sound for helicopter blades.
382 *
383 * 4 7/15/97 5:35p Chris
384 * New AI code
385 *
386 * 3 7/15/97 4:59p Chris
387 * added support for AI and animations
388 *
389 * $NoKeywords: $
390 */
391
392 #ifndef AISTRUCT_H_
393 #define AISTRUCT_H_cxx . . $ `Descent3/aistruct.h:393:9`!
394
395 #include "pstypes.h"cxx . . $ `<file>/lib/pstypes.h`/
396 #include "vecmat.h"cxx . . $ `<file>/lib/vecmat.h`/
397 #include "aistruct_external.h"cxx . . $ `<file>/Descent3/aistruct_external.h`/
398 #include "room.h"cxx . . $ `<file>/Descent3/room.h`/
399
400 //-------------------------------------------------
401 // GLOBAL Info and Constants for AI
402 //-------------------------------------------------
403
404 #define AI_INVALID_INDEXcxx . . $ `Descent3/aistruct.h:404:9`! -1
405
406 // AI system state.
407
408 #define AISTAT_ENABLEDcxx . . $ `Descent3/aistruct.h:408:9`! 1
409 #define AISTAT_DISABLEDcxx . . $ `Descent3/aistruct.h:409:9`! 2
410
411 extern char AI_Statuscxx . . $ AI_Status.;
412
413 // Last know player info -- might make it a [MAX_PLAYERS]
414
415 extern vectorcxx . . $ vector# ai_lkplayer_poscxx . . $ ai_lkplayer_pos.;
416 extern vectorcxx . . $ vector# ai_lkplayer_velocitycxx . . $ ai_lkplayer_velocity.;
417 extern float ai_lkplayer_timecxx . . $ ai_lkplayer_time.;
418
419 #define MAX_AI_INIT_CLASSEScxx . . $ `Descent3/aistruct.h:419:9`! 3
420 extern const char *const Ai_class_stringscxx . . $ Ai_class_strings.[MAX_AI_INIT_CLASSEScxx . . $ `Descent3/aistruct.h:419:9`!];
421
422 #define MAX_AI_INIT_TYPEScxx . . $ `Descent3/aistruct.h:422:9`! 9
423 extern const char *const Ai_type_stringscxx . . $ Ai_type_strings.[MAX_AI_INIT_TYPEScxx . . $ `Descent3/aistruct.h:422:9`!];
424
425 #define MAX_AI_INIT_MOVEMENT_TYPEScxx . . $ `Descent3/aistruct.h:425:9`! 4
426 extern const char *const Ai_movement_type_stringscxx . . $ Ai_movement_type_strings.[MAX_AI_INIT_MOVEMENT_TYPEScxx . . $ `Descent3/aistruct.h:425:9`!];
427
428 #define MAX_AI_INIT_MOVEMENT_SUBTYPEScxx . . $ `Descent3/aistruct.h:428:9`! 7
429 extern const char *const Ai_movement_subtype_flying_stringscxx . . $ Ai_movement_subtype_flying_strings.[MAX_AI_INIT_MOVEMENT_SUBTYPEScxx . . $ `Descent3/aistruct.h:428:9`!];
430 extern const char *const Ai_movement_subtype_walking_stringscxx . . $ Ai_movement_subtype_walking_strings.[MAX_AI_INIT_MOVEMENT_SUBTYPEScxx . . $ `Descent3/aistruct.h:428:9`!];
431
432 extern float AI_last_time_room_noise_alert_timecxx . . $ AI_last_time_room_noise_alert_time.[MAX_ROOMScxx . . $ `Descent3/room.h:377:9`! + 8];
433
434 //-------------------------------------------------
435 // AI Class, Type, and Action indices
436 //-------------------------------------------------
437
438 // AI Class -- make sure to update MAX_AI_CLASSES if you add a new class
439
440 #define AIC_STATICcxx . . $ `Descent3/aistruct.h:440:9`! 0
441 #define AIC_PURE_PATHcxx . . $ `Descent3/aistruct.h:441:9`! 1
442 #define AIC_AIS_FULLcxx . . $ `Descent3/aistruct.h:442:9`! 2
443 // #define AIC_DYNAMIC 3
444 // #define AIC_AIS_MOVEMENT 4
445 // #define AIC_AIS_FIRING 5
446
447 // AI Action -- What is it doing?
448
449 #define AID_SLEEPINGcxx . . $ `Descent3/aistruct.h:449:9`! 0
450 #define AID_ATTACKING_OBJcxx . . $ `Descent3/aistruct.h:450:9`! 1
451 #define AID_WANDERINGcxx . . $ `Descent3/aistruct.h:451:9`! 2
452 #define AID_NOT_THINKINGcxx . . $ `Descent3/aistruct.h:452:9`! 3
453 #define AID_CHASE_OBJECTcxx . . $ `Descent3/aistruct.h:453:9`! 4
454 #define AID_RUN_FROM_OBJECTcxx . . $ `Descent3/aistruct.h:454:9`! 5
455 #define AID_HIDEcxx . . $ `Descent3/aistruct.h:455:9`! 6
456 #define AID_FOLLOW_PATHcxx . . $ `Descent3/aistruct.h:456:9`! 7
457 #define AID_OPEN_DOORcxx . . $ `Descent3/aistruct.h:457:9`! 8
458
459 //-------------------------------------------------
460 // Notification structures
461 //-------------------------------------------------
462
463 struct ain_seecxx . . $ ain_see# {
464 bool f_use_fovcxx . . $ ain_see#f_use_fov.;
465 float max_distcxx . . $ ain_see#max_dist.;
466 };
467
468 struct ain_hearcxx . . $ ain_hear# {
469 bool f_directly_playercxx . . $ ain_hear#f_directly_player.;
470 float max_distcxx . . $ ain_hear#max_dist.;
471 float hostile_levelcxx . . $ ain_hear#hostile_level.; // 0 - 1
472 float curiosity_levelcxx . . $ ain_hear#curiosity_level.;
473 };
474
475 //-------------------------------------------------
476 // Path Structures
477 //-------------------------------------------------
478
479 #define MAX_JOINED_PATHScxx . . $ `Descent3/aistruct.h:479:9`! 5
480
481 // Allow for linked paths
482
483 #define AIP_STATICcxx . . $ `Descent3/aistruct.h:483:9`! 0
484 #define AIP_DYNAMICcxx . . $ `Descent3/aistruct.h:484:9`! 1
485 #define AIP_MOVE_LISTcxx . . $ `Descent3/aistruct.h:485:9`! 2
486
487 struct ai_path_infocxx . . $ ai_path_info# {
488 uint16_tcxx . . $ uint16_t# cur_pathcxx . . $ ai_path_info#cur_path.;
489 uint16_tcxx . . $ uint16_t# cur_nodecxx . . $ ai_path_info#cur_node.;
490
491 uint16_tcxx . . $ uint16_t# num_pathscxx . . $ ai_path_info#num_paths.;
492
493 int goal_uidcxx . . $ ai_path_info#goal_uid.; // which goal generated this path
494 int goal_indexcxx . . $ ai_path_info#goal_index.;
495
496 // Used by all paths
497 uint8_tcxx . . $ uint8_t# path_idcxx . . $ ai_path_info#path_id.[MAX_JOINED_PATHScxx . . $ `Descent3/aistruct.h:479:9`!];
498 uint8_tcxx . . $ uint8_t# path_typecxx . . $ ai_path_info#path_type.[MAX_JOINED_PATHScxx . . $ `Descent3/aistruct.h:479:9`!];
499
500 // Used for static game paths
501 uint16_tcxx . . $ uint16_t# path_start_nodecxx . . $ ai_path_info#path_start_node.[MAX_JOINED_PATHScxx . . $ `Descent3/aistruct.h:479:9`!];
502 uint16_tcxx . . $ uint16_t# path_end_nodecxx . . $ ai_path_info#path_end_node.[MAX_JOINED_PATHScxx . . $ `Descent3/aistruct.h:479:9`!];
503 uint16_tcxx . . $ uint16_t# path_flagscxx . . $ ai_path_info#path_flags.[MAX_JOINED_PATHScxx . . $ `Descent3/aistruct.h:479:9`!];
504 };
505
506 // Used for predefined move lists (off of normal static paths)
507 struct ai_move_pathcxx . . $ ai_move_path# {
508 vectorcxx . . $ vector# poscxx . . $ ai_move_path#pos.;
509 matrixcxx . . $ matrix# orientcxx . . $ ai_move_path#orient.;
510
511 int16_tcxx . . $ int16_t# path_idcxx . . $ ai_move_path#path_id.;
512 };
513
514 struct path_informationcxx . . $ path_information# {
515 int path_idcxx . . $ path_information#path_id.;
516 int start_nodecxx . . $ path_information#start_node.;
517 int next_nodecxx . . $ path_information#next_node.;
518 int end_nodecxx . . $ path_information#end_node.;
519 };
520
521 // Goal Ender Structure
522
523 struct goal_enablercxx . . $ goal_enabler# {
524 char enabler_typecxx . . $ goal_enabler#enabler_type.;
525
526 unioncxx . . $ goal_enabler#$anonymous_type_0# {
527 float float_valuecxx . . $ goal_enabler#$anonymous_type_0#float_value.;
528 float timecxx . . $ goal_enabler#$anonymous_type_0#time.;
529 char movement_typecxx . . $ goal_enabler#$anonymous_type_0#movement_type.;
530 int flagscxx . . $ goal_enabler#$anonymous_type_0#flags.; // Flags that enable/disable this goal
531 float distcxx . . $ goal_enabler#$anonymous_type_0#dist.;
532 int awarenesscxx . . $ goal_enabler#$anonymous_type_0#awareness.;
533 };
534
535 float percent_enablecxx . . $ goal_enabler#percent_enable.;
536 float check_intervalcxx . . $ goal_enabler#check_interval.;
537 float last_check_timecxx . . $ goal_enabler#last_check_time.;
538
539 char bool_next_enabler_opcxx . . $ goal_enabler#bool_next_enabler_op.;
540
541 };
542
543 //-------------------------------------------------
544 // Goal Structures
545 //-------------------------------------------------
546
547 // MAX of 32 goal types unless the bitfield is made wider.
548
549 // I wonder if goals can be classified. If so, we could reserve X goal for class a, and Y goal slots for class b
550 // plus it would make sure the our slots do not fill up in bad or degenerate ways.
551
552 struct gi_firecxx . . $ gi_fire# {
553 int16_tcxx . . $ int16_t# cur_wbcxx . . $ gi_fire#cur_wb.; // for ranged attack
554 uint8_tcxx . . $ uint8_t# cur_maskcxx . . $ gi_fire#cur_mask.; // for ranged attack
555 uint8_tcxx . . $ uint8_t# melee_numbercxx . . $ gi_fire#melee_number.; // this could be union'ed but it makes this struct word aligned
556 };
557
558 struct g_steercxx . . $ g_steer# {
559 float min_distcxx . . $ g_steer#min_dist.;
560 float max_distcxx . . $ g_steer#max_dist.;
561 float max_strengthcxx . . $ g_steer#max_strength.;
562 };
563
564 struct g_floatscxx . . $ g_floats# {
565 float fp1cxx . . $ g_floats#fp1.;
566 float fp2cxx . . $ g_floats#fp2.;
567 float fp3cxx . . $ g_floats#fp3.;
568 };
569
570 struct g_wander_extracxx . . $ g_wander_extra# {
571 int avoid_handlecxx . . $ g_wander_extra#avoid_handle.;
572 char min_roomscxx . . $ g_wander_extra#min_rooms.;
573 char max_roomscxx . . $ g_wander_extra#max_rooms.;
574 char flagscxx . . $ g_wander_extra#flags.;
575 char mine_indexcxx . . $ g_wander_extra#mine_index.; // Used for if this object accidently goes on to the terrain
576 };
577
578 #define GAF_ALIGNEDcxx . . $ `Descent3/aistruct.h:578:9`! 0x01
579 #define GAF_SPHEREcxx . . $ `Descent3/aistruct.h:579:9`! 0x02
580 #define GAF_TEMP_CLEAR_AUTOLEVELcxx . . $ `Descent3/aistruct.h:580:9`! 0x04
581 #define GAF_TEMP_CLEAR_ROBOT_COLLISIONScxx . . $ `Descent3/aistruct.h:581:9`! 0x08
582 #define GAF_TEMP_POINT_COLLIDE_WALLScxx . . $ `Descent3/aistruct.h:582:9`! 0x10
583
584 struct g_attachcxx . . $ g_attach# {
585 float radcxx . . $ g_attach#rad.;
586 int16_tcxx . . $ int16_t# flagscxx . . $ g_attach#flags.;
587 char parent_apcxx . . $ g_attach#parent_ap.;
588 char child_apcxx . . $ g_attach#child_ap.;
589 };
590
591 struct g_static_pathcxx . . $ g_static_path# {
592 int16_tcxx . . $ int16_t# start_nodecxx . . $ g_static_path#start_node.;
593 int16_tcxx . . $ int16_t# end_nodecxx . . $ g_static_path#end_node.;
594 int16_tcxx . . $ int16_t# cur_nodecxx . . $ g_static_path#cur_node.;
595 };
596
597 struct goal_infocxx . . $ goal_info# {
598 unioncxx . . $ goal_info#$anonymous_type_1# {
599 int handlecxx . . $ goal_info#$anonymous_type_1#handle.;
600 int roomnumcxx . . $ goal_info#$anonymous_type_1#roomnum.;
601 int f_actionscxx . . $ goal_info#$anonymous_type_1#f_actions.;
602 int idcxx . . $ goal_info#$anonymous_type_1#id.; // Type of CUSTOM -- Id determines which one it was
603 // Also used as the Path ID for static path followers
604 };
605
606 unioncxx . . $ goal_info#$anonymous_type_2# {
607 float timecxx . . $ goal_info#$anonymous_type_2#time.;
608 vectorcxx . . $ vector# veccxx . . $ goal_info#$anonymous_type_2#vec.;
609 vectorcxx . . $ vector# poscxx . . $ goal_info#$anonymous_type_2#pos.;
610 g_floatscxx . . $ g_floats# fscxx . . $ goal_info#$anonymous_type_2#fs.; // goal floats or a vector
611 };
612
613 unioncxx . . $ goal_info#$anonymous_type_3# {
614 g_steercxx . . $ g_steer# dist_infocxx . . $ goal_info#$anonymous_type_3#dist_info.;
615 g_attachcxx . . $ g_attach# attach_infocxx . . $ goal_info#$anonymous_type_3#attach_info.;
616 g_wander_extracxx . . $ g_wander_extra# wander_extra_infocxx . . $ goal_info#$anonymous_type_3#wander_extra_info.;
617 g_static_pathcxx . . $ g_static_path# static_path_infocxx . . $ goal_info#$anonymous_type_3#static_path_info.;
618 void *scripted_data_ptrcxx . . $ goal_info#$anonymous_type_3#scripted_data_ptr.;
619 };
620
621 };
622
623 // Goal structure
624 struct goalcxx . . $ goal# {
625 uint32_tcxx . . $ uint32_t# typecxx . . $ goal#type.;
626 char subtypecxx . . $ goal#subtype.;
627 uint8_tcxx . . $ uint8_t# activation_levelcxx . . $ goal#activation_level.;
628 float creation_timecxx . . $ goal#creation_time.;
629
630 float min_influencecxx . . $ goal#min_influence.;
631 unioncxx . . $ goal#$anonymous_type_4# {
632 float influencecxx . . $ goal#$anonymous_type_4#influence.;
633 float max_influencecxx . . $ goal#$anonymous_type_4#max_influence.;
634 };
635
636 float ramp_influence_distscxx . . $ goal#ramp_influence_dists.[4]; // Sorted by distance
637
638 goal_infocxx . . $ goal_info# g_infocxx . . $ goal#g_info.;
639
640 char num_enablerscxx . . $ goal#num_enablers.;
641 goal_enablercxx . . $ goal_enabler# enablercxx . . $ goal#enabler.[MAX_ENABLERS_PER_GOALcxx . . $ `Descent3/aistruct_external.h:131:9`!];
642
643 float circle_distancecxx . . $ goal#circle_distance.;
644 int status_regcxx . . $ goal#status_reg.;
645
646 float start_timecxx . . $ goal#start_time.;
647 float next_path_timecxx . . $ goal#next_path_time.; // used of goals with paths associated with them
648
649 float dist_to_goalcxx . . $ goal#dist_to_goal.;
650
651 vectorcxx . . $ vector# vec_to_targetcxx . . $ goal#vec_to_target.;
652 float next_check_see_target_timecxx . . $ goal#next_check_see_target_time.;
653 vectorcxx . . $ vector# last_see_target_poscxx . . $ goal#last_see_target_pos.;
654 float last_see_target_timecxx . . $ goal#last_see_target_time.;
655 float next_target_update_timecxx . . $ goal#next_target_update_time.;
656
657 int flagscxx . . $ goal#flags.;
658 int guidcxx . . $ goal#guid.; // Designer assigned
659
660 int goal_uidcxx . . $ goal#goal_uid.; // used by the AI system for paths
661
662 vectorcxx . . $ vector# set_fveccxx . . $ goal#set_fvec.;
663 vectorcxx . . $ vector# set_uveccxx . . $ goal#set_uvec.;
664
665 bool usedcxx . . $ goal#used.;
666 };
667
668 #define OBJGOALcxx . . $ `Descent3/aistruct.h:668:9`!(x) \
669 (((goal *)x)->type & (AIG_GET_AWAY_FROM_OBJ | AIG_HIDE_FROM_OBJ | AIG_GET_TO_OBJ | AIG_ATTACH_TO_OBJ | \
670 AIG_FIRE_AT_OBJ | AIG_MELEE_TARGET | AIG_GUARD_OBJ | AIG_DODGE_OBJ | AIG_MOVE_AROUND_OBJ | \
671 AIG_MOVE_RELATIVE_OBJ_VEC | AIG_MOVE_RELATIVE_OBJ | AIG_GET_AROUND_OBJ | AIG_AVOID_OBJ | \
672 AIG_COHESION_OBJ | AIG_ALIGN_OBJ | AIG_PLACE_OBJ_ON_OBJ))
673 #define COMPLETEATOBJcxx . . $ `Descent3/aistruct.h:673:9`!(x) (((goal *)x)->type & (AIG_GET_TO_OBJ))
674 #define POSGOALcxx . . $ `Descent3/aistruct.h:674:9`!(x) (((goal *)x)->type & (AIG_WANDER_AROUND | AIG_GUARD_AREA | AIG_GET_TO_POS | AIG_GET_AROUND_POS))
675 #define TARGETONLYGOALcxx . . $ `Descent3/aistruct.h:675:9`!(x) (((goal *)x)->type & (AIG_MELEE_TARGET))
676 #define COMPLETEATPOScxx . . $ `Descent3/aistruct.h:676:9`!(x) (((goal *)x)->type & (AIG_WANDER_AROUND | AIG_GET_TO_POS))
677
678 struct notifycxx . . $ notify# {
679 unioncxx . . $ notify#$anonymous_type_5# {
680 int obj_handlecxx . . $ notify#$anonymous_type_5#obj_handle.;
681 int goal_numcxx . . $ notify#$anonymous_type_5#goal_num.;
682 };
683
684 unioncxx . . $ notify#$anonymous_type_6# {
685 vectorcxx . . $ vector# poscxx . . $ notify#$anonymous_type_6#pos.;
686 int movement_typecxx . . $ notify#$anonymous_type_6#movement_type.;
687 int anim_typecxx . . $ notify#$anonymous_type_6#anim_type.;
688 int attack_numcxx . . $ notify#$anonymous_type_6#attack_num.;
689 int enabler_numcxx . . $ notify#$anonymous_type_6#enabler_num.;
690 };
691
692 float timecxx . . $ notify#time.;
693 };
694
695 struct ain_weapon_hit_infocxx . . $ ain_weapon_hit_info# {
696 int parent_handlecxx . . $ ain_weapon_hit_info#parent_handle.;
697 int weapon_handlecxx . . $ ain_weapon_hit_info#weapon_handle.;
698 int hit_facecxx . . $ ain_weapon_hit_info#hit_face.;
699 int hit_subobjectcxx . . $ ain_weapon_hit_info#hit_subobject.;
700 float hit_damagecxx . . $ ain_weapon_hit_info#hit_damage.;
701 vectorcxx . . $ vector# hit_pntcxx . . $ ain_weapon_hit_info#hit_pnt.;
702 };
703
704 //-------------------------------------------------
705 // AI awareness scale
706 //-------------------------------------------------
707
708 //-------------------------------------------------
709 // AI Sounds
710 //-------------------------------------------------
711
712 #define MAX_AI_SOUNDScxx . . $ `Descent3/aistruct.h:712:9`! 5
713
714 #define AI_MEM_DEPTHcxx . . $ `Descent3/aistruct.h:714:9`! 5
715
716 struct ai_memcxx . . $ ai_mem# {
717 // Computed at end of memory frame
718 float shieldscxx . . $ ai_mem#shields.;
719 int16_tcxx . . $ int16_t# num_enemiescxx . . $ ai_mem#num_enemies.;
720 int16_tcxx . . $ int16_t# num_friendscxx . . $ ai_mem#num_friends.;
721
722 // Incremented during the memory frame
723 int16_tcxx . . $ int16_t# num_times_hitcxx . . $ ai_mem#num_times_hit.;
724 int16_tcxx . . $ int16_t# num_enemy_shots_firedcxx . . $ ai_mem#num_enemy_shots_fired.;
725 int16_tcxx . . $ int16_t# num_hit_enemycxx . . $ ai_mem#num_hit_enemy.;
726 int16_tcxx . . $ int16_t# num_enemy_shots_dodgedcxx . . $ ai_mem#num_enemy_shots_dodged.;
727 };
728
729 //-------------------------------------------------
730 // AI tracking information
731 //-------------------------------------------------
732
733 //-------------------------------------------------
734 // AI framework per robot
735 //-------------------------------------------------
736
737 struct ai_framecxx . . $ ai_frame# {
738 char ai_classcxx . . $ ai_frame#ai_class.; // Static, DLL, Soar, Flock, and other will be here -- chrishack
739 char ai_typecxx . . $ ai_frame#ai_type.; // Used for some coded types
740
741 ai_path_infocxx . . $ ai_path_info# pathcxx . . $ ai_frame#path.;
742
743 float max_velocitycxx . . $ ai_frame#max_velocity.;
744 float max_delta_velocitycxx . . $ ai_frame#max_delta_velocity.;
745 float max_turn_ratecxx . . $ ai_frame#max_turn_rate.;
746 float max_delta_turn_ratecxx . . $ ai_frame#max_delta_turn_rate.;
747
748 float attack_vel_percentcxx . . $ ai_frame#attack_vel_percent.;
749 float flee_vel_percentcxx . . $ ai_frame#flee_vel_percent.;
750 float dodge_vel_percentcxx . . $ ai_frame#dodge_vel_percent.;
751
752 float circle_distancecxx . . $ ai_frame#circle_distance.;
753 float dodge_percentcxx . . $ ai_frame#dodge_percent.;
754
755 float melee_damagecxx . . $ ai_frame#melee_damage.[2];
756 float melee_latencycxx . . $ ai_frame#melee_latency.[2];
757
758 int soundcxx . . $ ai_frame#sound.[MAX_AI_SOUNDScxx . . $ `Descent3/aistruct.h:712:9`!]; // AI sounds,
759 float last_sound_timecxx . . $ ai_frame#last_sound_time.[MAX_AI_SOUNDScxx . . $ `Descent3/aistruct.h:712:9`!];
760 int16_tcxx . . $ int16_t# last_played_sound_indexcxx . . $ ai_frame#last_played_sound_index.;
761
762 char movement_typecxx . . $ ai_frame#movement_type.;
763 char movement_subtypecxx . . $ ai_frame#movement_subtype.;
764
765 char animation_typecxx . . $ ai_frame#animation_type.;
766 char next_animation_typecxx . . $ ai_frame#next_animation_type.;
767
768 char next_movementcxx . . $ ai_frame#next_movement.; // For queueing actions :)
769 char current_wb_firingcxx . . $ ai_frame#current_wb_firing.;
770 char last_special_wb_firingcxx . . $ ai_frame#last_special_wb_firing.;
771
772 goalcxx . . $ goal# goalscxx . . $ ai_frame#goals.[MAX_GOALScxx . . $ `Descent3/aistruct_external.h:178:9`!];
773
774 // Standard memory
775 int target_handlecxx . . $ ai_frame#target_handle.;
776 float next_target_update_timecxx . . $ ai_frame#next_target_update_time.;
777
778 float dist_to_target_actualcxx . . $ ai_frame#dist_to_target_actual.;
779 float dist_to_target_perceivedcxx . . $ ai_frame#dist_to_target_perceived.;
780 vectorcxx . . $ vector# vec_to_target_actualcxx . . $ ai_frame#vec_to_target_actual.;
781 vectorcxx . . $ vector# vec_to_target_perceivedcxx . . $ ai_frame#vec_to_target_perceived.;
782
783 float next_check_see_target_timecxx . . $ ai_frame#next_check_see_target_time.;
784 vectorcxx . . $ vector# last_see_target_poscxx . . $ ai_frame#last_see_target_pos.;
785 float last_see_target_timecxx . . $ ai_frame#last_see_target_time.;
786 float last_hear_target_timecxx . . $ ai_frame#last_hear_target_time.;
787
788 // int rand_val;
789 // float next_rand_time;
790
791 float weapon_speedcxx . . $ ai_frame#weapon_speed.;
792
793 float next_melee_timecxx . . $ ai_frame#next_melee_time.;
794 float last_render_timecxx . . $ ai_frame#last_render_time.; // Last time I was rendered -- BAD IN MULTIPLAYER -- chrisnote
795 float next_flinch_timecxx . . $ ai_frame#next_flinch_time.; // Next valid time to flinch
796
797 int status_regcxx . . $ ai_frame#status_reg.;
798
799 int flagscxx . . $ ai_frame#flags.;
800 int notify_flagscxx . . $ ai_frame#notify_flags.; // Agent is only notified of some event types
801
802 // Normalized movement and facing information
803 vectorcxx . . $ vector# movement_dircxx . . $ ai_frame#movement_dir.;
804 vectorcxx . . $ vector# rot_thrust_vectorcxx . . $ ai_frame#rot_thrust_vector.;
805
806 float fovcxx . . $ ai_frame#fov.;
807
808 int anim_sound_handlecxx . . $ ai_frame#anim_sound_handle.; // Goes with Animation sounds which can loop -- not for AI sounds
809
810 float avoid_friends_distancecxx . . $ ai_frame#avoid_friends_distance.;
811
812 float frustrationcxx . . $ ai_frame#frustration.;
813 float curiousitycxx . . $ ai_frame#curiousity.;
814 float life_preservationcxx . . $ ai_frame#life_preservation.;
815 float agressioncxx . . $ ai_frame#agression.;
816
817 // Current emotional levels
818 float cur_frustrationcxx . . $ ai_frame#cur_frustration.;
819 float cur_curiousitycxx . . $ ai_frame#cur_curiousity.;
820 float cur_life_preservationcxx . . $ ai_frame#cur_life_preservation.;
821 float cur_agressioncxx . . $ ai_frame#cur_agression.;
822
823 // X Second memory
824 float mem_time_till_next_updatecxx . . $ ai_frame#mem_time_till_next_update.;
825 ai_memcxx . . $ ai_mem# memorycxx . . $ ai_frame#memory.[AI_MEM_DEPTHcxx . . $ `Descent3/aistruct.h:714:9`!];
826
827 float fire_spreadcxx . . $ ai_frame#fire_spread.;
828 float night_visioncxx . . $ ai_frame#night_vision.;
829 float fog_visioncxx . . $ ai_frame#fog_vision.;
830 float lead_accuracycxx . . $ ai_frame#lead_accuracy.;
831 float lead_variencecxx . . $ ai_frame#lead_varience.;
832 float fight_teamcxx . . $ ai_frame#fight_team.;
833 float fight_samecxx . . $ ai_frame#fight_same.;
834 float hearingcxx . . $ ai_frame#hearing.;
835 float roamingcxx . . $ ai_frame#roaming.;
836 float leadershipcxx . . $ ai_frame#leadership.;
837 float coop_samecxx . . $ ai_frame#coop_same.;
838 float coop_teamcxx . . $ ai_frame#coop_team.;
839
840 float biased_flight_importancecxx . . $ ai_frame#biased_flight_importance.;
841 float biased_flight_mincxx . . $ ai_frame#biased_flight_min.;
842 float biased_flight_maxcxx . . $ ai_frame#biased_flight_max.;
843
844 vectorcxx . . $ vector# last_dodge_dircxx . . $ ai_frame#last_dodge_dir.;
845 float dodge_till_timecxx . . $ ai_frame#dodge_till_time.;
846
847 float awarenesscxx . . $ ai_frame#awareness.;
848
849 matrixcxx . . $ matrix# saved_orientcxx . . $ ai_frame#saved_orient.;
850
851 };
852
853 // Etern'ed functions that depend of aistruct stuff
854
855 #include "object_external.h"cxx . . $ `<file>/Descent3/object_external.h`/
856 #include "room.h"cxx . . $ `<file>/Descent3/room.h`/
857
858 #define MAX_DYNAMIC_PATHScxx . . $ `Descent3/aistruct.h:858:9`! 50
859 #define MAX_NODEScxx . . $ `Descent3/aistruct.h:859:9`! 50
860
861 class ai_dynamic_pathcxx . . $ ai_dynamic_path# {
862 public:
863 ai_dynamic_pathcxx . . $ ai_dynamic_path#ai_dynamic_path(49f6e7a06ebc5aa8).() {
864 num_nodescxx . . $ ai_dynamic_path#num_nodes. = 0;
865 use_countcxx . . $ ai_dynamic_path#use_count. = 0;
866 owner_handlecxx . . $ ai_dynamic_path#owner_handle. = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!;
867 };
868
869 vectorcxx . . $ vector# poscxx . . $ ai_dynamic_path#pos.[MAX_NODEScxx . . $ `Descent3/aistruct.h:859:9`!];
870 int roomnumcxx . . $ ai_dynamic_path#roomnum.[MAX_NODEScxx . . $ `Descent3/aistruct.h:859:9`!];
871
872 int16_tcxx . . $ int16_t# num_nodescxx . . $ ai_dynamic_path#num_nodes.;
873 int16_tcxx . . $ int16_t# use_countcxx . . $ ai_dynamic_path#use_count.;
874
875 int owner_handlecxx . . $ ai_dynamic_path#owner_handle.;
876 };
877
878 extern ai_dynamic_pathcxx . . $ ai_dynamic_path# AIDynamicPathcxx . . $ AIDynamicPath.[MAX_DYNAMIC_PATHScxx . . $ `Descent3/aistruct.h:858:9`!];
879 extern int AIAltPathcxx . . $ AIAltPath.[MAX_ROOMScxx . . $ `Descent3/room.h:377:9`!];
880 extern int AIAltPathNumNodescxx . . $ AIAltPathNumNodes.;
881
882 #endif