Classic Elite ships wireframe

From Elite Wiki
Revision as of 04:13, 10 June 2018 by DrBeeb (talk | contribs) (Created page with "In Classic Elite the ship geometries are limited to convex hulls to aid in rendering the wire-frame graphics as quickly as possible with hidden line removal. Each vertex is us...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In Classic Elite the ship geometries are limited to convex hulls to aid in rendering the wire-frame graphics as quickly as possible with hidden line removal. Each vertex is usually associated with 4 faces, each edge joining 2 vertices is associated with 2 faces. The maximum number of faces is 14, as is the case for the asteroid model. Face 15 is reserved to indicate a vertex is always visible regardless of the objection's orientation, e.g. more than 4 faces meet at that vertex. The (time consuming) 3D projection calculations for that vertex should always be performed, if the vertex is close enough to the player, else if the face is not visible then further tests are done to see if any visible face is associated with that vertex. An edge is only rendered if both faces associated with it are visible.

Ship data file format

An initial header of 20 bytes is followed by the vertex data, in groups of 6 bytes, then the edge data in groups of 4 bytes, and finally the face normal data in groups of 4 bytes.

Byte (in Hex) Ship header information (example ship)
03 hi nibble is cargo type if scooped (0 is not scoopable). lo nibble is max pieces of debris if destroyed.
E9 lo byte of ship area for target hit decision
07 hi byte of ship area for target hit decision
86 lo byte of offset to edge data.
F2 lo byte of offset to face data.
5D maximum size of heap reserved for processed line plotting data (1+4*max visible edges)
00 vertex id for laser gun (*4), used for firing laser lines
1A number of vertices(*4 + 6), used for explosion dust origin(s)
72 number of vertices*6, used for vertex loop counter
1B number of edges
2C lo byte of bounty (in units of 0.1 Cr) if awarded
01 hi byte of bounty (in units of 0.1 Cr) if awarded
28 number of faces*4, used for face loop counter
1E distance away when wireframe rendering replaced by large dot
A0 Maximum ship energy
1E Maximum ship speed
00 hi byte of offset to edge data.
00 hi byte of offset to face data.
01 Scale factor for ship size when calculating whether face normal is visible
22 Laser firepower*8 plus maximum number (7) of missiles.

Each vertex has 6 bytes of data.

Byte X ! Byte Z | Byte S | Byte F1 | Byte F2
00 0E 6C 5F 01 59
...

Source code for the BBC tape and TUBE versions of BBC Elite can be found at Ian Bell's web site and were used to disassemble and interpret the Disk version described here.