User Tools

Site Tools


falcon4:file_formats:cam_trn_tac:uni_file

Falcon 4 .UNI file

.UNI File Format

Raw (compressed contents)

FieldData TypeWidth (in bytes)Description
CompressedSize Signed 32-bit integer4Size, in bytes, of the compressed data to follow (includes space for the NumUnits and UncompressedSize fields)
NumUnits Signed 16-bit integer2Number of unit records in the data that follows
UncompressedSizeSigned 32-bit integer4Size, in bytes, of the data that follows, when it's uncompressed
DATAbyte[](CompressedSize-6) bytesLZSS-compressed binary data.

Uncompressed contents of the DATA field

FieldData TypeWidth (in bytes)DescriptionVersions
unitRecords[]UnitRecord[NumUnits] All

Structures Used

UnitRecord structure

FieldData TypeWidth (in bytes)DescriptionVersions
unitTypesigned 16-bit integer2 subtract 100 from this value to find the index into the Falcon classtable records, for this unit All
Data[] byte array content and length depends on the type of unit defined in the classtable, at the index specified by (unitType -100), and the file version in-use. All

For each unit record, you will need to retrieve the corresponding class table entry from the class table file in order to interpret the data that follows in that unit record's data buffer in the .UNI file.

After retrieving a unit's classtable entry, read the vuClassData.classInfo[0] value, which will tell you the Domain (air=2, land=3, or sea=4) that this unit belongs to.

Then, check the unit's classtable entry's vuClassData.classInfo[2] value, which will tell you the type of unit:

 Air domain:
   vuClassData.classInfo[2]=1  -- this is a Flight
   vuClassData.classInfo[2]=2  -- this is a Package
   vuClassData.classInfo[2]=3  -- this is a Squadron
 Land domain:
   vuClassData.classInfo[2]=1  -- this is a Battalion
   vuClassData.classInfo[2]=2  -- this is a Brigade
 Sea domain:
   vuClassData.classInfo[2]=1  -- this is a Task Force

Once you know what type of unit it is, you can use the appropriate structure (Flight, Package, Squadron, Battalion, Brigade, or TaskForce) to interpret the data that follows the “unitType”.

Immediately following the data for that unit, is another “UnitType”/Data[] pair. This continues until you have read “NumUnits” records from the file.

Note: this information is valid for versions up to about version 71. Details for subsequent versions are currently not documented

Flight structure

FieldData TypeWidth (in bytes)DescriptionVersions
idVU_ID8 All
entityType unsigned 16-bit integer 2 All
x Signed 16-bit integer 2 All
y Signed 16-bit integer 2 All
z single-precision 32-bit floating point 4 >=70
spotTime unsigned 32-bit integer 4 All
spotted signed 16-bit integer 2 All
baseFlags signed 16-bit integer 2 All
owner byte 1 All
campId signed 16-bit integer 2 All
last_check unsigned 32-bit integer 4 All
roster Signed 32-bit integer 4 All
unit_flags Signed 32-bit integer 4 All
dest_x Signed 16-bit integer 2 All
dest_y Signed 16-bit integer 2 All
target_idVU_ID8 All
cargo_idVU_ID8 > 1
moved byte 1 All
losses byte 1 All
tactic byte 1 All
current_wp unsigned 16-bit integer 2 > = 71
current_wp byte 1 < 71
name_id Signed 16-bit integer 2 All
reinforcement Signed 16-bit integer 2 All
numWaypoints unsigned 16-bit integer 2 > = 71
numWaypoints byte 1 < 71
waypoints[] Waypoint[numWaypoints] All
pos_z single-precision 32-bit floating point 4 All
fuel_burnt Signed 32-bit integer 4 if Version < 65, this value is present but is meaningless so zero it out All
last_move unsigned 32-bit integer 4 All
last_combat unsigned 32-bit integer 4 All
time_on_target unsigned 32-bit integer 4 All
mission_over_time unsigned 32-bit integer 4 All
mission_target Signed 16-bit integer 2 All
use_loadout byte 1 8 thru 23
loadout LoadoutArray 8 thru 23
weapon[] array of Signed 16-bit integer * 16 32 < 18
weapon[] byte[16] 16 18 thru 23
weapons[] byte[16] 16 18 thru 23
loadouts byte 1 > = 24
loadout[] LoadoutStruct[loadouts] > = 24
mission byte 1 All
old_mission byte 1 > 65
last_direction byte 1 All
priority byte 1 All
mission_id byte 1 All
dummy byte 1 < 14
eval_flags byte 1 < 14
mission_context byte 1 > 65
package VU_ID 8 All
squadron VU_ID 8 All
requester VU_ID 8 > 65
slots[] byte[4] 4 All
pilots[] byte[4] 4 All
plane_stats[] byte[4] 4 All
player_slots[] byte[4] 4 All
last_player_slot byte 1 All
callsign_id byte 1 All
callsign_num byte 1 All

Squadron structure

FieldData TypeWidth (in bytes)DescriptionVersions
idVU_ID8 All
entityType unsigned 16-bit integer 2 All
x Signed 16-bit integer 2 All
y Signed 16-bit integer 2 All
z single-precision 32-bit floating point 4 >=70
spotTime unsigned 32-bit integer 4 All
spotted signed 16-bit integer 2 All
baseFlags signed 16-bit integer 2 All
owner byte 1 All
campId signed 16-bit integer 2 All
last_check unsigned 32-bit integer 4 All
roster Signed 32-bit integer 4 All
unit_flags Signed 32-bit integer 4 All
dest_x Signed 16-bit integer 2 All
dest_y Signed 16-bit integer 2 All
target_idVU_ID8 All
cargo_idVU_ID8 > 1
moved byte 1 All
losses byte 1 All
tactic byte 1 All
current_wp unsigned 16-bit integer 2 > = 71
current_wp byte 1 < 71
name_id Signed 16-bit integer 2 All
reinforcement Signed 16-bit integer 2 All
numWaypoints unsigned 16-bit integer 2 > = 71
numWaypoints byte 1 < 71
waypoints[] Waypoint[numWaypoints] All
fuel Signed 32-bit integer4 All
specialty byte1 All
stores[] byte[200] 200 < 69
stores[] byte[220] 220 69 thru 71 (inclusive)
stores[] byte[600] 600 > = 72
pilots[] Pilot[36] < 29
pilots[] Pilot[48] > = 29
schedule[] array of Signed 32-bit integer * 16 4 * 16 = 64 bytes All
airbase_id VU_ID 8 All
hot_spot VU_ID 8 All
junk VU_ID 8 6 thru 15
rating[] byte[16]16 All
aa_kills Signed 16-bit integer2 All
ag_kills Signed 16-bit integer2 All
as_kills Signed 16-bit integer2 All
an_kills Signed 16-bit integer2 All
missions_flown Signed 16-bit integer2 All
mission_score Signed 16-bit integer2 All
total_losses byte 1 All
pilot_losses byte 1 >= 9
squadron_patch byte 1 < 45

Package structure

FieldData TypeWidth (in bytes)DescriptionVersions
idVU_ID8 All
entityType unsigned 16-bit integer 2 All
x Signed 16-bit integer 2 All
y Signed 16-bit integer 2 All
z single-precision 32-bit floating point 4 >=70
spotTime unsigned 32-bit integer 4 All
spotted signed 16-bit integer 2 All
baseFlags signed 16-bit integer 2 All
owner byte 1 All
campId signed 16-bit integer 2 All
last_check unsigned 32-bit integer 4 All
roster Signed 32-bit integer 4 All
unit_flags Signed 32-bit integer 4 All
dest_x Signed 16-bit integer 2 All
dest_y Signed 16-bit integer 2 All
target_idVU_ID8 All
cargo_idVU_ID8 > 1
moved byte 1 All
losses byte 1 All
tactic byte 1 All
current_wp unsigned 16-bit integer 2 > = 71
current_wp byte 1 < 71
name_id Signed 16-bit integer 2 All
reinforcement Signed 16-bit integer 2 All
numWaypoints unsigned 16-bit integer 2 > = 71
numWaypoints byte 1 < 71
waypoints[] Waypoint[numWaypoints] All
elements byte1 All
element[] VU_ID[elements] (elements * 8) bytes All
interceptor VU_ID 8 All
awacs VU_ID 8 > = 7
jstar VU_ID 8 > = 7
ecm VU_ID 8 > = 7
tanker VU_ID 8 > = 7
wait_cycles byte 1 All
flights byte 1 All
wait_for Signed 16-bit integer 2 All
iax Signed 16-bit integer 2 All
iay Signed 16-bit integer 2 All
eax Signed 16-bit integer 2 All
eay Signed 16-bit integer 2 All
bpx Signed 16-bit integer 2 All
bpy Signed 16-bit integer 2 All
tpx Signed 16-bit integer 2 All
tpy Signed 16-bit integer 2 All
takeoff unsigned 32-bit integer 4 All
tp_time unsigned 32-bit integer 4 All
caps Signed 16-bit integer 2 All
requests Signed 16-bit integer 2 All
threat_stats Signed 16-bit integer 2 < 35
responses Signed 16-bit integer 2 All
num_ingress_waypoints byte 1 All
ingress_waypoints[] Waypoint[num_ingress_waypoints All
num_egress_waypoints byte 1 All
egress_waypoints[] Waypoint[num_egress_waypoints All
mis_request MissionRequest All

Brigade structure

FieldData TypeWidth (in bytes)DescriptionVersions
idVU_ID8 All
entityType unsigned 16-bit integer 2 All
x Signed 16-bit integer 2 All
y Signed 16-bit integer 2 All
z single-precision 32-bit floating point 4 >=70
spotTime unsigned 32-bit integer 4 All
spotted signed 16-bit integer 2 All
baseFlags signed 16-bit integer 2 All
owner byte 1 All
campId signed 16-bit integer 2 All
last_check unsigned 32-bit integer 4 All
roster Signed 32-bit integer 4 All
unit_flags Signed 32-bit integer 4 All
dest_x Signed 16-bit integer 2 All
dest_y Signed 16-bit integer 2 All
target_idVU_ID8 All
cargo_idVU_ID8 > 1
moved byte 1 All
losses byte 1 All
tactic byte 1 All
current_wp unsigned 16-bit integer 2 > = 71
current_wp byte 1 < 71
name_id Signed 16-bit integer 2 All
reinforcement Signed 16-bit integer 2 All
numWaypoints unsigned 16-bit integer 2 > = 71
numWaypoints byte 1 < 71
waypoints[] Waypoint[numWaypoints] All
orders byte 1 All
division Signed 16-bit integer 2 All
aobj VU_ID 8 All
elements byte 1 All
element[] VU_ID[elements] (elements * 8) bytes All

Battalion structure

FieldData TypeWidth (in bytes)DescriptionVersions
idVU_ID8 All
entityType unsigned 16-bit integer 2 All
x Signed 16-bit integer 2 All
y Signed 16-bit integer 2 All
z single-precision 32-bit floating point 4 >=70
spotTime unsigned 32-bit integer 4 All
spotted signed 16-bit integer 2 All
baseFlags signed 16-bit integer 2 All
owner byte 1 All
campId signed 16-bit integer 2 All
last_check unsigned 32-bit integer 4 All
roster Signed 32-bit integer 4 All
unit_flags Signed 32-bit integer 4 All
dest_x Signed 16-bit integer 2 All
dest_y Signed 16-bit integer 2 All
target_idVU_ID8 All
cargo_idVU_ID8 > 1
moved byte 1 All
losses byte 1 All
tactic byte 1 All
current_wp unsigned 16-bit integer 2 > = 71
current_wp byte 1 < 71
name_id Signed 16-bit integer 2 All
reinforcement Signed 16-bit integer 2 All
numWaypoints unsigned 16-bit integer 2 > = 71
numWaypoints byte 1 < 71
waypoints[] Waypoint[numWaypoints] All
orders byte 1 All
division Signed 16-bit integer 2 All
aobj VU_ID 8 All
last_move unsigned 32-bit integer 4 All
last_combat unsigned 32-bit integer 4 All
parent_id VU_ID 8 All
last_obj VU_ID 8 All
supplybyte 1 All
fatiguebyte 1 All
moralebyte 1 All
headingbyte 1 All
final_headingbyte 1 All
dummybyte 1 < 15
positionbyte 1 All

TaskForce structure

FieldData TypeWidth (in bytes)DescriptionVersions
idVU_ID8 All
entityType unsigned 16-bit integer 2 All
x Signed 16-bit integer 2 All
y Signed 16-bit integer 2 All
z single-precision 32-bit floating point 4 >=70
spotTime unsigned 32-bit integer 4 All
spotted signed 16-bit integer 2 All
baseFlags signed 16-bit integer 2 All
owner byte 1 All
campId signed 16-bit integer 2 All
last_check unsigned 32-bit integer 4 All
roster Signed 32-bit integer 4 All
unit_flags Signed 32-bit integer 4 All
dest_x Signed 16-bit integer 2 All
dest_y Signed 16-bit integer 2 All
target_idVU_ID8 All
cargo_idVU_ID8 > 1
moved byte 1 All
losses byte 1 All
tactic byte 1 All
current_wp unsigned 16-bit integer 2 > = 71
current_wp byte 1 < 71
name_id Signed 16-bit integer 2 All
reinforcement Signed 16-bit integer 2 All
numWaypoints unsigned 16-bit integer 2 > = 71
numWaypoints byte 1 < 71
waypoints[] Waypoint[numWaypoints] All
orders byte 1 All
supply byte 1 All

MissionRequest structure

FieldData TypeWidth (in bytes)DescriptionVersions
requesterIDVU_ID8 All
targetIDVU_ID8 All
secondaryIDVU_ID8 All
pakIDVU_ID8 All
whobyte1 All
vsbyte1 All
padding[]byte[2]2 necessary so data lands on an Int32 boundary All
totunsigned 32-bit integer4 All
txSigned 16-bit integer2 All
tySigned 16-bit integer2 All
flagsunsigned 32-bit integer4 All
capsSigned 16-bit integer2 All
target_numSigned 16-bit integer2 All
speedSigned 16-bit integer2 All
match_strengthSigned 16-bit integer2 All
prioritySigned 16-bit integer2 All
tot_typebyte1 All
action_typebyte1 All
missionbyte1 All
aircraftbyte1 All
contextbyte1 All
roe_checkbyte1 All
delayedbyte1 > = 35
start_blockbyte1 > = 35
final_blockbyte1 > = 35
slots[]byte[4]4 > = 35
min_tobyte1 > = 35
max_tobyte1 > = 35
morepadding[]byte[3]3 necessary so data lands on an Int32 boundary> = 35

Pilot structure

FieldData TypeWidth (in bytes)DescriptionVersions
pilot_idSigned 16-bit integer2 All
pilot_skill_and_ratingbyte1 low nibble=skill; hi nibble = rating All
pilot_statusbyte1 All
aa_killsbyte1 All
ag_killsbyte1 All
as_killsbyte1 All
an_killsbyte1 All
missions_flownSigned 16-bit integer2 > = 48

LoadoutArray structure

FieldData TypeWidth (in bytes)DescriptionVersions
Stores[]LoadoutStruct[5] 5 * 32 = 160 bytes All

LoadoutStruct structure

FieldData TypeWidth (in bytes)DescriptionVersions
WeaponID[]byte[16]16 All
WeaponCount[]byte[16]16 All

Waypoint structure

FieldData TypeWidth (in bytes)DescriptionVersions
havesbyte1 All
GridXSigned 16-bit integer2 All
GridYSigned 16-bit integer2 All
GridZSigned 16-bit integer2 All
Arriveunsigned 32-bit integer4 All
Actionbyte1 All
RouteActionbyte1 All
Formationbyte1 All
FlagsSigned 16-bit integer2 All
TargetIDVU_ID8only present if “haves” <> 0 All
TargetBuildingbyte1only present if “haves” <> 0, else set value=255 All
Departunsigned 32-bit integer4only present if “haves” <> 0, else set to same val as “Arrive” All

VU_ID structure

FieldData TypeWidth (in bytes)Description
num_unsigned 32-bit integer4
creator_unsigned 32-bit integer4
falcon4/file_formats/cam_trn_tac/uni_file.txt · Last modified: 2024/07/31 08:45 by snakeman

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

All PMC web site download services are temporarily suspended until web site yearly fees have been recovered, want to download addons/mods? Then Support PMC.

If you are grateful for all the work PMC has done in the past 25 years, use Support PMC page.