Classic Elite entity states
Upon launching from the Space Station the player is confronted by several entities, the planet ahead, the space station behind, and perhaps additional ships. The following description of each entity's state is specific to the BBC Disk Classic version of Elite, there are some variations in the other 8-bit versions.
Each entity has a state represented in 37 bytes. The first 9 bytes are the (x,y,z) coordinates to 23bit precision with the player at the origin. The next 18 bytes store a 9-member rotation matrix, with the positive unit vector scaled to 0x6000. A pointer of 2 bytes points to a heap that contains processed vertex data for display.
Single bytes represent the entity's speed, acceleration, remaining energy, and counters for roll and pitch actions currently underway.
The remaining 3 bytes represent the entity's A.I., which we shall refer to as the Attack, Behaviour and Visible States. Some bits serve more than one purpose if they are set.
|7||A.I. is active, use tactics. Missiles' trajectory updated 8 times more often than others.|
|6||Missile's target is player, or entity is more than mildly aggressive.|
|5,4,3,2,1||I.D. of Missile's target, or refinement to level of aggression.|
|0||Entity has an E.C.M. (Electronic Counter Measures) to destroy in-flight missiles.|
|7||Remove entity silently, too far away or entity is scooped cargo.|
|6||Entity is a Police vessel, destroying one affects your legal status.|
|5||Entity (Shuttle or Transporter) under Space Station protection, will launch cops.|
|4||Entity is docking, go to planet then to space station.|
|3||Pirate, attack player if not in space station safety zone, else fly away from player.|
|2||Entity is angry with player, accuracy of shooting determined by level of aggression.|
|1||Bounty hunter, attacks player if player's legal status is fugitive.|
|0||Peaceful trader, maybe attacks player if player's legal status is fugitive.|
|7||Terminate entity with a dust explosion|
|6||Entity is firing laser at player, or entity is exploding.|
|5||Display nodes of wire-frame or explosion, not a far-away dot.|
|4||Keep visible on scanner|
|3||Recent rendering to screen needs to be erased (draw with EOR operation again)|
|2,1,0||Number of missiles or thargons remaining within entity, maximum is 7.|
The arrangement of the bits is driven by the preferences of 6502 machine code. Direct bit tests exist for the highest bits, and the lower bits tend to be used to count small quantities.
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.