11 typedef unsigned long DWORD
;
14 #define ZeroMemory(S, N) memset((S), 0, (N))
19 // the number of commands in the
22 #define ATTACK_COMMAND 1
23 #define WANDER_COMMAND 2
24 #define MOVE_COMMAND 3
27 // use TAB to toggle between modes
29 #define THIRD_PERSON_MODE 1
30 #define FIRST_PERSON_MODE 2
35 #define CROSSHAIRS_SCALE 4.5f
36 #define CROSSHAIRS_GROWTH 1.3f
38 #define LOOKAT_OFFSET 5.0f
39 #define CAMERA_BOT_OFFSET 8.0f
40 #define CAMERA_HEIGHT 3.2f
42 #define RELEASE_OBJECT(x) \
48 // The multiplier for kills or
51 #define SCORE_NORMAL 2.0f
52 #define SCORE_KILL 10.0f
57 #define MAX_RAND 4096 // 4096?
58 #define MAX_STARS 1200 // 2000
59 #define STAR_RADIUS 710.0
60 #define STAR_ROT_SPEED 0.1f;
63 #define __straight_steps (MAX_STRAIGHT_STEPS-MIN_STRAIGHT_STEPS)
65 #define __go_home_steps_2 (MAX_STRAIGHT_STEPS_2-MIN_STRAIGHT_STEPS_2)
68 // based on how much food is avaible
69 // respawn so many ants
70 #define USE_FOOD_RESPAWN 0
72 #define FOOD_RESPAWN (ANT_RESPAWN * INITIAL_ANT_FOOD)
75 #define BEGIN_BOT glPushMatrix()
76 #define END_BOT glPopMatrix()
84 #define CHANGE_DIR_STATE 2
87 #define SET_TURN_STATE 6
88 #define SET_MOUNT_STATE 7
89 #define GENERATE_STATE 8
90 #define GENERATE_TURN 9
91 #define RECHECK_STATE 10
94 #define GO_MOVE_COMMAND 999
95 #define GO_ATTACK_COMMAND 998
96 #define GO_WANDER_COMMAND 997
97 #define EXPLODE_STATE 995
101 #define READY_STATE 2
104 #define GET_NEST_WIDTH (1.5f*nest.objects[0]->size[0])
105 #define GET_NEST_HWID (GET_NEST_WIDTH/2.0f)
106 #define NEST_FOOD_OBJECT nest.objects[0]->food
108 #define INVALID_BOT -1
112 typedef struct tagStaticBot
{
123 bool delete_flag
; // deleted from pheromone list
125 float heading
; // you can use rotation or heading
131 float travel
; // distance traveled
140 float old_y
; // for drawing a line strip
146 int owner
; // owner of this bullet
148 struct tagStaticBot
*next
;
150 } StaticBot
, *StaticBotPtr
;
152 // functions for static bot
153 typedef struct tagDriverSentinel
{
155 StaticBotPtr (*create
)(int bot_id
);
156 void (*destroy
)(StaticBotPtr b
);
157 void (*render
)(StaticBotPtr boid
);
158 void (*process
)(StaticBotPtr b
);
160 void (*generate
)(void);
161 void (*shutdown
)(void);
162 void (*drawall
)(void);
168 } DriverSentinel
, *DriverSentinelPtr
;
171 typedef struct tagDriverBots
{
175 float linearv
; // speed
176 float size
[3]; // scale
177 float heading
; // direction
178 float target_dir
; // target heading
182 int numSteps
; // how many steps ant has moved
185 int state
; // what is bot doing
186 int straightSteps
; // steps before changing direction
194 int gun_reset
; // delay befor firing
197 bool move_back
; // for move and turn
200 // camera helper variables
203 float look_h
; // look height, actually the y
206 int view_mode
; // first or third person
212 // the rectangle of the bot
213 // Note: you have to add
214 // the x,y to this value, but dont
215 // do to this variable, use temps
225 float crosshair_scale
;
227 // Add the fire ant bullets
228 //StaticBot bullets[MAX_BULLETS];
232 void (*run
)(struct tagDriverBots
*bot
);
241 } DriverBots
, *DriverBotPtr
;
243 void Super_LoadBots(void);
244 void Super_KillBots(void);
246 void Super_FireAnts(void);
247 void Super_KillFires(void);
250 void Reset_FireAnts(void);
251 void Player_Control(bool *keys
);
253 void LoadBotParms(DriverBotPtr bot_ptr
);
255 void Wander_Command(DriverBotPtr bot
);
256 void Move_Command(DriverBotPtr bot
);
257 void Attack_Command(DriverBotPtr bot
);
259 int GetStartState(int cmd
);
260 int GetLastState(int cmd
);
261 void Generate_Command(DriverBotPtr bot
, int cmd
);
263 void GenerateBots(void);
264 void ShutdownBots(void);
269 int BruteCheckFood(DriverBotPtr bot
);
270 void DropFood(DriverBotPtr bot
, int id
, float food_rate
);
272 void CreateAnts(int food
);
274 float FindAngle(float dir
, float x1
, float y1
, float x2
, float y2
);
276 void CheckRespawn(void);
278 void ActivatePheromone(float x
, float y
, float dir
);
280 DriverBotPtr
CreateBot(int bot_id
);
281 void DestroyBot(DriverBotPtr b
);
282 void GetAntFood(DriverBotPtr bot
);
283 void ResetBot(DriverBotPtr bot_ptr
);
285 void GenerateFireAnts(void);
286 void ShutdownFireAnts(void);
287 void DrawFireAnts(void);
288 void AnimFireAnts(void);
290 bool CheckSight(DriverBotPtr bot
, DriverBotPtr nme
);
292 void MoveFire0(int dir
, int turn
);
294 void PositionBot(DriverBotPtr bot
);
296 void AnimNetworkBots(void);
299 extern DriverSentinel nest
;
300 extern DriverSentinel garden
;
301 extern DriverSentinel trail_set
;