| 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/AIMain.h $ |
| 21 | * $Revision: 41 $ |
| 22 | * $Date: 5/17/99 6:06p $ |
| 23 | * $Author: Chris $ |
| 24 | * |
| 25 | * General AI functions for use in Descent III |
| 26 | * |
| 27 | * $Log: /DescentIII/main/AIMain.h $ |
| 28 | * |
| 29 | * 41 5/17/99 6:06p Chris |
| 30 | * Adding robot debug code |
| 31 | * |
| 32 | * 40 5/08/99 4:42p Chris |
| 33 | * |
| 34 | * 39 5/08/99 4:12p Chris |
| 35 | * Added AI hearing noises... version 1 |
| 36 | * |
| 37 | * 38 5/01/99 2:21a Chris |
| 38 | * Use the GF_SPEED_XXX stuff |
| 39 | * |
| 40 | * 37 4/18/99 5:38a Chris |
| 41 | * Drastically improved the find_random_room function and added the |
| 42 | * makenextroomlist function |
| 43 | * |
| 44 | * 36 3/12/99 12:16p Chris |
| 45 | * Blending primary and blend goals!!!!!! Awesome. |
| 46 | * |
| 47 | * 35 2/28/99 11:30p Chris |
| 48 | * FindObjOfType and OSIRIS controllable deaths |
| 49 | * |
| 50 | * 34 2/10/99 1:47p Matt |
| 51 | * Changed object handle symbolic constants |
| 52 | * |
| 53 | * 33 1/29/99 5:10p Chris |
| 54 | * Added an optional parent handle check for FindObjOfType |
| 55 | * |
| 56 | * 32 1/20/99 1:01a Chris |
| 57 | * Improved AI and OSIRIS intergration |
| 58 | * |
| 59 | * 31 1/11/99 2:14p Chris |
| 60 | * Massive work on OSIRIS and AI |
| 61 | * |
| 62 | * 30 12/15/98 6:05p Chris |
| 63 | * Improved the path system |
| 64 | * |
| 65 | * 29 12/15/98 4:34p Chris |
| 66 | * |
| 67 | * 28 12/03/98 12:24p Chris |
| 68 | * Improved new anim code for instant updating |
| 69 | * |
| 70 | * 27 12/01/98 4:31p Chris |
| 71 | * Checked in a massive amount of AI work. Improved flocking code. :) |
| 72 | * (Still hacked lightly). In addition, I am moving toward using the |
| 73 | * composite dir. :) |
| 74 | * |
| 75 | * 26 10/16/98 3:39p Chris |
| 76 | * Improved the object linking system and AI and physics |
| 77 | * |
| 78 | * 25 10/13/98 1:08p Chris |
| 79 | * Greatly improved the AI's use of paths. Improved visability checking |
| 80 | * algorithm. Probably needs a second pass for further cleanup. |
| 81 | * |
| 82 | * 24 10/06/98 6:19p Chris |
| 83 | * Improved OSIRIS/AI intergration |
| 84 | * |
| 85 | * 23 9/28/98 4:09p Chris |
| 86 | * Added birth animations |
| 87 | * |
| 88 | * 22 9/14/98 12:16p Chris |
| 89 | * Vastly improved the multiplayer code |
| 90 | * |
| 91 | * 21 8/19/98 12:10p Chris |
| 92 | * Improved coop behavior |
| 93 | * |
| 94 | * 20 8/10/98 12:16p Chris |
| 95 | * Added AI_NumHostileAlert |
| 96 | * |
| 97 | * 19 6/30/98 6:36p Chris |
| 98 | * Added rev .1 of multiplayer animations - BTW It is totally not done. |
| 99 | * |
| 100 | * 18 5/17/98 7:54p Chris |
| 101 | * Correctly integrated the goal system and circle distance stuff. Added |
| 102 | * support for "target goals". |
| 103 | * |
| 104 | * 17 5/04/98 4:04p Chris |
| 105 | * Minestone checkin' -- energy effect and more AI functionality |
| 106 | * |
| 107 | * 16 4/30/98 11:31a Chris |
| 108 | * Massive upgrades to the AI system |
| 109 | * |
| 110 | * 15 4/16/98 2:56p Chris |
| 111 | * Updated buddy support and intergrated scripting and AI |
| 112 | * |
| 113 | * 14 4/07/98 4:25p Chris |
| 114 | * Added support for buddy bot |
| 115 | * |
| 116 | * 13 3/31/98 4:23p Chris |
| 117 | * Added a new AIpath system |
| 118 | * |
| 119 | * 12 3/10/98 12:51p Chris |
| 120 | * Added a truely D2 style homing missile |
| 121 | * |
| 122 | * 11 2/06/98 5:51p Chris |
| 123 | * Added the ability turn robots on and off |
| 124 | * |
| 125 | * 10 1/29/98 3:29p Chris |
| 126 | * Major update to the AI system. |
| 127 | * |
| 128 | * 9 11/14/97 11:55p Chris |
| 129 | * Dodge goals are semi-functional |
| 130 | * |
| 131 | * 8 11/12/97 5:47p Chris |
| 132 | * Incremental improvements |
| 133 | * |
| 134 | * 7 11/12/97 10:43a Chris |
| 135 | * Incremental |
| 136 | * |
| 137 | * 6 8/05/97 12:17p Chris |
| 138 | * |
| 139 | * 5 7/15/97 7:29p Chris |
| 140 | * Added a sound for helicopter blades. |
| 141 | * |
| 142 | * 4 7/15/97 5:35p Chris |
| 143 | * New AI code |
| 144 | * |
| 145 | * 3 7/15/97 4:59p Chris |
| 146 | * added support for AI and animations |
| 147 | * |
| 148 | * $NoKeywords: $ |
| 149 | */ |
| 150 | |
| 151 | #ifndef AIMAIN_H_ |
| 152 | #define AIMAIN_H_cxx . . $ `Descent3/AIMain.h:152:9`! |
| 153 | |
| 154 | #include "object.h"cxx . . $ `<file>/Descent3/object.h`/ |
| 155 | #include "player.h"cxx . . $ `<file>/Descent3/player.h`/ |
| 156 | |
| 157 | #define AI_SOUND_SHORT_DISTcxx . . $ `Descent3/AIMain.h:157:9`! 60.0f |
| 158 | |
| 159 | extern int AI_NumRenderedcxx . . $ AI_NumRendered.; |
| 160 | extern int AI_RenderedListcxx . . $ AI_RenderedList.[MAX_OBJECTScxx . . $ `lib/object_external_struct.h:107:9`!]; |
| 161 | |
| 162 | extern int AI_NumHostileAlertcxx . . $ AI_NumHostileAlert.; // A rough number of alert/hostile robots |
| 163 | // that have seen the player recently |
| 164 | #ifdef _DEBUGcxx . . $ `<built-in>:482:9`! |
| 165 | extern bool AI_debug_robot_docxx . . $ AI_debug_robot_do.; |
| 166 | extern int AI_debug_robot_indexcxx . . $ AI_debug_robot_index.; |
| 167 | #endif |
| 168 | |
| 169 | // Is my buddy in the level? (no if the handle is invalid) |
| 170 | extern int Buddy_handlecxx . . $ Buddy_handle.[MAX_PLAYERScxx . . $ `Descent3/player_external_struct.h:86:9`!]; |
| 171 | |
| 172 | bool AINotifycxx . . $ AINotify(f32b5964aaa42c22).(objectcxx . . $ object# *obj, uint8_tcxx . . $ uint8_t# notify_type, void *info = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!); |
| 173 | void AIDoFramecxx . . $ AIDoFrame(419c470199a90a97).(objectcxx . . $ object# *obj); |
| 174 | void AIFrameAllcxx . . $ AIFrameAll(49f6e7a06ebc5aa8).(void); |
| 175 | bool AIInitcxx . . $ AIInit(cc53779520928514).(objectcxx . . $ object# *obj, uint8_tcxx . . $ uint8_t# ai_class, uint8_tcxx . . $ uint8_t# ai_type, uint8_tcxx . . $ uint8_t# ai_movement); |
| 176 | void AIInitAllcxx . . $ AIInitAll(49f6e7a06ebc5aa8).(void); |
| 177 | void AIPowerSwitchcxx . . $ AIPowerSwitch(674fac047436fc5b).(objectcxx . . $ object# *obj, bool f_on); |
| 178 | void AITurnTowardsDircxx . . $ AITurnTowardsDir(cd233addd15cf1e2).(objectcxx . . $ object# *obj, /*velocity *new_vel,*/ vectorcxx . . $ vector# *goal_dir /*, bool remain_level*/, float turn_rate); |
| 179 | void AIMoveTowardsDircxx . . $ AIMoveTowardsDir(cd233addd15cf1e2).(objectcxx . . $ object# *obj, vectorcxx . . $ vector# *dir, float scale = 1.0f); |
| 180 | bool AIMoveTowardsPositioncxx . . $ AIMoveTowardsPosition(e4ea9f4f5d132a1c).(objectcxx . . $ object# *obj, /*velocity *new_vel,*/ vectorcxx . . $ vector# *pos, float scale, bool stop_at_end_point, |
| 181 | vectorcxx . . $ vector# *mdir, bool *f_moved); |
| 182 | void AITurnTowardsPositioncxx . . $ AITurnTowardsPosition(835e87111e401cce).(objectcxx . . $ object# *obj, /*velocity *new_vel,*/ vectorcxx . . $ vector# *pos /*, bool remain_level*/); |
| 183 | bool AIFindHidePoscxx . . $ AIFindHidePos(5b8d3226dd1a19bc).(objectcxx . . $ object# *hide_obj, objectcxx . . $ object# *view_obj, vectorcxx . . $ vector# *hpos, int *hroom, float max_hide_time = 3.0f); |
| 184 | int AIFindRoomWithFlagcxx . . $ AIFindRoomWithFlag(174cacb9d899a77a).(objectcxx . . $ object# *obj, int flag); |
| 185 | objectcxx . . $ object# *AIFindObjOfTypecxx . . $ AIFindObjOfType(21432d3b7e9150b9).(objectcxx . . $ object# *obj, int type, int id, bool f_ignore_init_room, int parent_handle = OBJECT_HANDLE_NONEcxx . . $ `Descent3/object_external.h:156:9`!); |
| 186 | float AIFindDistcxx . . $ AIFindDist(6ac898ae218d302a).(vectorcxx . . $ vector# *s_pos, int s_roomnum, vectorcxx . . $ vector# *e_pos, int e_roomnum, int flags); |
| 187 | bool AIStatusCircleFramecxx . . $ AIStatusCircleFrame(fd8d6ff82ee13e7b).(objectcxx . . $ object# *obj, objectcxx . . $ object# *g_obj, float dist, float c_dist, int *status_reg); |
| 188 | bool AIObjEnemycxx . . $ AIObjEnemy(9fa7d4d2c8b4c2db).(objectcxx . . $ object# *obj, objectcxx . . $ object# *target); |
| 189 | bool AISetTargetcxx . . $ AISetTarget(9985ed114f2bfc78).(objectcxx . . $ object# *obj, int handle); |
| 190 | void AIDestroyObjcxx . . $ AIDestroyObj(419c470199a90a97).(objectcxx . . $ object# *obj); |
| 191 | bool AIObjFriendcxx . . $ AIObjFriend(9fa7d4d2c8b4c2db).(objectcxx . . $ object# *obj, objectcxx . . $ object# *target); |
| 192 | void AIUpdateAnimcxx . . $ AIUpdateAnim(419c470199a90a97).(objectcxx . . $ object# *obj); |
| 193 | bool AITurnTowardsMatrixcxx . . $ AITurnTowardsMatrix(4158910ac60c491b).(objectcxx . . $ object# *obj, float turn_rate, matrixcxx . . $ matrix# *g_orient); |
| 194 | int AIFindRandomRoomcxx . . $ AIFindRandomRoom(faebaf28fe240c5f).(objectcxx . . $ object# *obj, ai_framecxx . . $ ai_frame# *ai_info, goalcxx . . $ goal# *goal_ptr, int avoid_room, int min_depth, int max_depth, |
| 195 | bool f_check_path, bool f_cur_room_ok, int *depth); |
| 196 | int AIMakeNextRoomListcxx . . $ AIMakeNextRoomList(1df93256b606fe1f).(int roomnum, int *next_rooms, int max_rooms); |
| 197 | |
| 198 | #endif |