Wing Commander
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
smart.c File Reference

Collision avoidance, formation flying and manoeuvre selection. More...

#include "wc1.h"
#include <dos.h>
#include <process.h>

Go to the source code of this file.

Functions

unsigned int steer_away_from_object (short obj, short other, short amount)
void steer_away_from_predicted_object (short obj, short other, short predictionTicks, short amount)
void prevent_collision (short obj)
short handle_collisions (short obj)
int regulate_turn (short obj)
unsigned int select_target (short obj)
unsigned int veer_random (short obj, short amount)
unsigned int offset_location (short obj, const ShortVector *offset, FixedVector *location)
unsigned int compute_formation_destination (short leader, const ShortVector *offset, FixedVector *destination)
unsigned int control_speed (short obj, unsigned short range, int desiredSpeed)
unsigned int chase_location (short obj, const FixedVector *destination, short reference)
unsigned int goto_location (short obj, const FixedVector *destination)
unsigned int goto_formation (short obj, const FixedVector *destination, short leader)
unsigned int maintain_formation (short obj)
unsigned int reset_stress (short obj)
short stress_morale (short obj)
enum ShipManeuver any_defense (short obj)
enum ShipManeuver pick_regular_maneuver (short obj, int event)
enum ShipManeuver pick_from_list (const ManeuverChoice *choice, short obj)
enum ShipManeuver pick_kilrathi_maneuver (short obj, int event)
unsigned int process_maneuver_node (short obj, int event)
void handle_stress (short obj, int event)
void intelligence_events (short obj)
unsigned int chase_speed (short obj, short range)

Variables

FixedVector aShipRightVector [64]
FixedVector aShipUpVector [64]
FixedVector aShipFwdVec [64]
HazardField * pActiveHazardField
signed char acPlayerComponentDamageList [9]
signed char abFlightPathList [MISSION_OBJECTIVE_COUNT]
FixedVector aShipVelocity [SPACE_OBJECT_COUNT]
short anYawTarget [16]

Detailed Description

Collision avoidance, formation flying and manoeuvre selection.

Address range 433ac0-434ccf. The ordered MacsBug symbols of the Super Wing Commander smart unit corroborate the boundary: its final routine is chase_speed, immediately followed by the random unit.

Definition in file smart.c.

Function Documentation

◆ any_defense()

◆ chase_location()

◆ chase_speed()

unsigned int chase_speed ( short obj,
short range )

◆ compute_formation_destination()

unsigned int compute_formation_destination ( short leader,
const ShortVector * offset,
FixedVector * destination )

◆ control_speed()

unsigned int control_speed ( short obj,
unsigned short range,
int desiredSpeed )

◆ goto_formation()

◆ goto_location()

◆ handle_collisions()

short handle_collisions ( short obj)

◆ handle_stress()

void handle_stress ( short obj,
int event )

◆ intelligence_events()

◆ maintain_formation()

◆ offset_location()

◆ pick_from_list()

◆ pick_kilrathi_maneuver()

◆ pick_regular_maneuver()

◆ prevent_collision()

◆ process_maneuver_node()

◆ regulate_turn()

◆ reset_stress()

unsigned int reset_stress ( short obj)

◆ select_target()

◆ steer_away_from_object()

◆ steer_away_from_predicted_object()

◆ stress_morale()

short stress_morale ( short obj)

◆ veer_random()

Variable Documentation

◆ abFlightPathList

◆ acPlayerComponentDamageList

◆ anYawTarget

◆ aShipFwdVec

◆ aShipRightVector

◆ aShipUpVector

◆ aShipVelocity

◆ pActiveHazardField