X-Wing Mission Information (XWI) File Format

This is some documentation for the X-Wing (classic) mission information file format.

FieldLengthTypeDescription
Version16 bitsintegerAlways 2
Mission Time Limit16 bitsintegerIn minutes
End event16 bitsinteger0 = Rescued
1 = Captured (or Clear Laser Towers)
5 = Hit Exhaust Port
??16 bits??0
Mission Location16 bitsint0 = deep space
1 = death star surface
Completion Message 164 bytesstringpad with zeros
Completion Message 264 bytesstring
Completion Message 364 bytesstring
Number of flight groups16 bitsinteger
Number of objects16 bitsinteger

And then for each flight group:

FieldLengthTypeDescription
Designation16 bytesstringpad with zeros. "Red", "Alpha", etc
Cargo16 bytesstringpad with zeros
Special Cargo16 bytesstringpad with zeros
Special Ship Number16 bitsinteger0 = one, 1 = two, etc
Flight Group Type16 bitsinteger0 = None
1 = X-Wing
2 = Y-Wing
3 = A-Wing
4 = TIE Fighter
5 = TIE Interceptor
6 = TIE Bomber
7 = Gunboat
8 = Transport
9 = Shuttle
10 = Tug
11 = Container
12 = Frieghter
13 = Calamari Cruiser
14 = Nebulon B Frigate
15 = Corellian Corvette
16 = Imperial Star Destroyer
17 = TIE Advanced
18 = B-Wing
Craft IFF16 bitsinteger0 = Default
1 = Rebel
2 = Imperial
3 = Neutral
Craft Status16 bitsinteger0 = Normal
1 = No Missiles
2 = Half Missiles
3 = No Shields
Number in wave16 bitsinteger
Number of waves16 bitsinteger0 = one, 1 = two, etc
Arrival event16 bitsintegerwhen to arrive 0 = Mission start
1 = arrival FG arrives
2 = arrival FG destroyed
3 = arrival FG attacked
4 = arrival FG boarded
5 = arrival FG identified
6 = arrival FG disabled
Arrival delay16 bitsinteger1 = one minute, 2D = 2 minutes, 30 seconds.. hmm, strange encoding
Arrival FG16 bitsintegerArrival event relating to FG.
Mothership16 bitsinteger0xffff for none
Arrive by hyperspace16 bitsboolean
Depart by hyperspace16 bitsboolean
Start1 X16 bitsfixed pointvalue * 160
Waypoint1 X16 bitsfixed point
Waypoint2 X16 bitsfixed point
Waypoint3 X16 bitsfixed point
Start2 X16 bitsfixed point
Start3 X16 bitsfixed point
Hyperspace X16 bitsfixed point
Start1 Y16 bitsfixed point
Waypoint1 Y16 bitsfixed point
Waypoint2 Y16 bitsfixed point
Waypoint3 Y16 bitsfixed point
Start2 Y16 bitsfixed point
Start3 Y16 bitsfixed point
Hyperspace Y16 bitsfixed point
Start1 Z16 bitsfixed point
Waypoint1 Z16 bitsfixed point
Waypoint2 Z16 bitsfixed point
Waypoint3 Z16 bitsfixed point
Start2 Z16 bitsfixed point
Start3 Z16 bitsfixed point
Hyperspace Z16 bitsfixed point
Start1 Enabled16 bitsbooleanset if corresponding value included in flight path
Waypoint1 Enabled16 bitsboolean(thanks to Luke Benstead for these values)
Waypoint2 Enabled16 bitsboolean
Waypoint3 Enabled16 bitsboolean
Start2 Enabled16 bitsboolean
Start3 Enabled16 bitsboolean
Hyperspace Enabled16 bitsboolean
Formation16 bitsinteger0 = Vic
1 = Finger Four
2 = Line Astern
3 = Line Abreast
4 = Echelon Right
5 = Echelon Left
6 = Double Astern
7 = Diamond
8 = Stacked
9 = Spread
10 = Hi-Lo
11 = Spiral
Player pos16 bitsintegerposition in the fighter group (eg 1, 2, etc)
Craft AI16 bitsinteger0 = Rookie, 1 = Officer, 2 = Veteran, 3 = Ace, 4 = Top Ace
Order16 bitsinteger0 = Hold steady
1 = Fly home
2 = Circle & Ignore
3 = Fly Once & Ignore
4 = Circle & Evade
5 = Fly once & Evade
6 = Close Escort
7 = Loose Escort
8 = Attack Escorts
9 = Attack Pri and Sec targets
10 = Attack enemies (Fighters, TRNs, SHUs)
11 = Rendezvous
12 = Disabled
13 = Board to deliver
14 = Board to take
15 = Board to exchange
16 = Board to capture
17 = Board to destroy
18 = Disable Pri and Sec Targets
19 = Disable all (Fighters, TRNs, SHUs)
20 = Attack Transports
21 = Attack freighters (includes CRVs)
22 = Attack starships
23 = Attack satelites and mines
24 = Disable frieghters (includes CRVs)
25 = Disable starships
26 = Starship sit and fire
27 = Starship fly dance
28 = Starship circle
29 = Starship await return
30 = Starship await launch
31 = Starship await boarding
Dock Time or Throttle16 bitsintegerdepending on Order (Dock Time is in minutes)
Craft Color16 bitsinteger0 = Red, 1 = Gold, 2 = Blue
??16 bits??0
Objective16 bitsinteger0 = none
1 = all destroyed
2 = all survive
3 = all captured
4 = all docked
5 = Special craft destroyed
6 = Special craft survive
7 = Special craft captured
8 = Special craft docked
9 = 50% destroyed
10 = 50% survive
11 = 50% captured
12 = 50% docked
13 = all identified
14 = Special craft identifed
15 = 50% identified
16 = Arrive
Primary target16 bitsinteger0xffff for no target
Secondary target16 bitsinteger

And then for each Object:

FieldLengthTypeDescription
Designation16 bytesstringpad with zeros, "Red", "Alpha", etc
??16 bytes??
??16 bytes??
??16 bits??0
Object Type16 bitsinteger18 = Mine1
19 = Mine2
20 = Mine3
21 = Mine4
22 = Satellite
23 = Nav Buoy
24 = Probe
25 = ??
26 = Asteroid1
27 = Asteroid2
28 = Asteroid3
29 = Asteroid4
30 = Asteroid5
31 = Asteroid6
32 = Asteroid7
33 = Asteroid8
34 = Rock World
35 = Gray Ring World
36 = Gray World
37 = Brown World
38 = Gray World II
39 = Planet & Moon
40 = Gray Crescent
41 = Orange Crescent 1
42 = Orange Crescent 2
43 = Orange Crescent 3
44 = Orange Crescent 4
45 = Orange Crescent 5
46 = Orange Crescent 6
47 = Orange Crescent 7
48 = Orange Crescent 8
49 = Death Star
Object IFF16 bitsinteger0 = none, 1 = Rebel, 2 = Imperial, 3 = Neutral
Form / Objective16 bitsinteger0 = Flat, 1 = On Edge, 2 = Broadside, 3 = Scattered, (or with 4 = must be destroyed)
Number of Objects16 bitsinteger
Position X16 bitsfixed pointvalue * 160
Position Y16 bitsfixed point
Position Z16 bitsfixed point
??16 bits??0
??16 bits??0x40
??16 bits??0

As you can see, there's still a bit more to go.

Here is some C++ code for reading these in:

xwinglib.cpp and xwinglib.h.

Enjoy.


QuantumG
<< back to my home page