Targetware: Flight Model Development
Targetware ACM File Guide
PART REFERENCE: Flex Gun
Flex guns are computer-controlled guns that will fire at enemy aircraft, ships, or ground targets. Despite the name, flex guns are not just hand held weapons, in Targetware terminology, a "flex gun" refers to any AI-controlled weapon, including 16" BB guns. Flex guns are like other guns, in terms of specifying the physical characteristics of the gun and rounds, but have additional code detailing what the gun is allowed to shoot at, and what limitations apply to it's accuracy, range, tracking speed, etc. For Flexguns, the "group = " line is very important. It allows you to gang single guns together to form a group that will fire as one. This is useful if you need to make a turret with 2 .50s in it for a B-17, or an RAF bomber with 4 .303s in a turret.
Basic Settings
mount_angle = horizontal, vertical: angles at which the gun is mounted. "180,0" would be for a rear-facing gun.
track_left = Amount, in degrees, the gun can track to the left, from its original mounted heading.
track_right = Limit on movement to right.
track_up = Limit on upward movement.
track_down = Limit on downward movement.
track_rate = Tracking speed, in degrees per second.
track_distance = Distance in meters at which the gun will open fire on targets.
Controlling Accuracy
Four factors go into controlling how accurate a computer gunner will be: track_interval, track_error, track_range_error, and track_lag. Mod designers will be balancing these four factors to get the desired behaviour out of their computer gunners.
track_interval = The time in seconds between updating the tracking algorithm.
track_error = The error, in degrees, in measuring bearing and elevation.
track_range_error = A linear error metric such that range is estimated as:
(1 / (1 + track_range_error)) * range <= estimate <= (1 + track_range_error) * range
track_lag = The theta component of the kalman filter, such that 0 < theta <= 1
A "perfect" gunner would have an interval of 0, 0 track error, 0 track range error, and a track lag of 1.0. The default accuracy settings are as below:
track_interval = 0.5
track_error = 1.0
track_range_error = 0.1
track_lag = 0.5
Sample Flexgun Part
To illustrate the settings described above, let's look at a flex gun part used in an actual Targetware mod. In this case, this is one of the rear .30s from the SBD-3. Note that the group (2) set here matches the group set in part 23, which is the right-hand gun in the SBD mount. The #include statement at the top of the part description saves us from having to list every last detail of the .30 calibre gun, we only have to put down the settings that are specific to the SBD tail gun.
[Part 22]
#include _guns/uk_cal303_browning.acm
name = Left Tail Gun
type = flexgun
parent = aft fuselage
location = -0.1, -5.4, 1.0
group = 2
max_ammo = 1000
belt = 4 API, 1 APIT
mount_angle = 180, 0
track_left = 65
track_right = 65
track_up = 60
track_down = 5
track_rate = 90
track_distance = 1000
track_interval = 0.5
track_error = 2.0
track_range_error = 0.3
track_lag = 0.5
|