The 6502 Elites do not store their galaxies. Each of the eight galaxies has 256
systems, and all of them, with their names, positions and details, are worked out from
three 16-bit numbers, the seeds, which the commander file holds. This is how
the explorer draws the chart of a 6502 commander
file. Below, s0, s1 and s2 are the seeds,
with _lo and _hi for their bytes.
Seeds and galaxies
The seeds of system 0 of the first galaxy are 5A4A 0248 B753 (the system
is Tibedied). The seeds of the next galaxy are those with every one of the six bytes
rotated left by one bit (bit 7 comes round to bit 0); after eight galactic jumps they are
back at the start.
Twisting turns the seeds of one system into those of the next one: the new s0 is s1, the new s1 is s2, and the new s2 is the sum s0 + s1 + s2, all as 16-bit numbers. The game twists four times from one system to the next, so system n has the seeds reached by 4n twists from system 0.
What the seeds say
| Value | Rule |
|---|---|
| Position | x = s1_hi; y = s0_hi (the chart draws y halved, 0 to 127) |
| Government | (s1_lo AND %00111000) / 8, 0 to 7 |
| Economy | s0_hi AND 7; if the government is 0 or 1, OR 2 into it. Bit 2 set means agricultural |
| Tech level | (economy EOR 7) + (s1_hi AND 3) + government / 2, rounded up; shown as one more |
| Population | tech level × 4 + economy + government + 1, in hundreds of millions (shown with one decimal in billions), using the tech level before the one is added |
| Productivity | ((economy EOR 7) + 3) × (government + 4) × population × 8, in millions of credits |
| Average radius | ((s2_hi AND 15) + 11) × 256 + s1_hi, in kilometres |
| Species | Human Colonials when bit 7 of s2_lo is clear; otherwise four words, below |
| Value | Government | Economy |
|---|---|---|
| 0 | Anarchy | Rich Industrial |
| 1 | Feudal | Average Industrial |
| 2 | Multi-government | Poor Industrial |
| 3 | Dictatorship | Mainly Industrial |
| 4 | Communist | Mainly Agricultural |
| 5 | Confederacy | Rich Agricultural |
| 6 | Democracy | Average Agricultural |
| 7 | Corporate State | Poor Agricultural |
Species
Four words, each of which can be empty. Size: (s2_hi >> 2) AND 7, where 0 is Large, 1 Fierce, 2 Small and 3 to 7 nothing. Colour: (s2_hi >> 5) AND 7: Green, Red, Yellow, Blue, Black, Harmless, and 6, 7 nothing. Look: (s0_hi EOR s1_hi) AND 7: Slimy, Bug-Eyed, Horned, Bony, Fat, Furry, and 6, 7 nothing. Kind: (colour number + (s2_hi AND 3)) AND 7: Rodents, Frogs, Lizards, Lobsters, Birds, Humanoids, Felines, Insects. (When the colour word is empty the colour number still takes part in the sum.)
Names
A name is three pairs of letters, or four when bit 6 of s0_lo is set. For each pair take s2_hi AND 31; if it is 0 the pair is skipped, otherwise it is the pair at that place in this list, and then the seeds are twisted once. The first letter of the name is a capital.
0 AL, 1 LE, 2 XE, 3 GE, 4 ZA, 5 CE, 6 BI, 7 SO, 8 US, 9 ES, 10 AR, 11 MA, 12 IN,
13 DI, 14 RE, 15 A?, 16 ER, 17 AT, 18 EN, 19 BE, 20 RA, 21 LA, 22 VE, 23 TI, 24 ED,
25 OR, 26 QU, 27 AN, 28 TE, 29 IS, 30 RI, 31 ON. The question mark is not
printed: the pair 15 is just “A”.
The first eight systems of galaxy 1
| # | Name | x, y | Government | Economy | Tech | Population | Radius |
|---|---|---|---|---|---|---|---|
| 0 | Tibedied | 2, 90 | Feudal | Poor Industrial | 9 | 3.6 billion | 4610 km |
| 1 | Qube | 152, 205 | Corporate State | Rich Agricultural | 7 | 3.7 billion | 5528 km |
| 2 | Leleer | 77, 243 | Dictatorship | Mainly Industrial | 8 | 3.5 billion | 3149 km |
| 3 | Biarge | 83, 208 | Multi-government | Rich Industrial | 12 | 4.7 billion | 4435 km |
| 4 | Xequerin | 180, 131 | Communist | Mainly Industrial | 7 | 3.2 billion | 3508 km |
| 5 | Tiraor | 172, 176 | Communist | Rich Industrial | 10 | 4.1 billion | 4780 km |
| 6 | Rabedira | 69, 249 | Multi-government | Average Industrial | 9 | 3.6 billion | 3909 km |
| 7 | Lave | 20, 173 | Dictatorship | Rich Agricultural | 5 | 2.5 billion | 4116 km |
The y in the table is the second number of the file’s position (QQ1), the one the generator calls s0_hi. Lave, where a new commander starts, is at 20, 173 as the default commander file says. The explorer’s test checks these eight against the generator.
The market
Each good has a base price, an economic factor, a unit, a base quantity and a mask (the game’s QQ23 table):
| # | Good | Base price | Factor | Unit | Base quantity | Mask |
|---|---|---|---|---|---|---|
| 0 | Food | 19 | −2 | t | 6 | 1 |
| 1 | Textiles | 20 | −1 | t | 10 | 3 |
| 2 | Radioactives | 65 | −3 | t | 2 | 7 |
| 3 | Slaves | 40 | −5 | t | 226 | 31 |
| 4 | Liquor/Wines | 83 | −5 | t | 251 | 15 |
| 5 | Luxuries | 196 | 8 | t | 54 | 3 |
| 6 | Narcotics | 235 | 29 | t | 8 | 120 |
| 7 | Computers | 154 | 14 | t | 56 | 3 |
| 8 | Machinery | 117 | 6 | t | 40 | 7 |
| 9 | Alloys | 78 | 1 | t | 17 | 31 |
| 10 | Firearms | 124 | 13 | t | 29 | 7 |
| 11 | Furs | 176 | −9 | t | 220 | 63 |
| 12 | Minerals | 32 | −1 | t | 53 | 3 |
| 13 | Gold | 97 | −1 | kg | 66 | 7 |
| 14 | Platinum | 171 | −2 | kg | 55 | 31 |
| 15 | Gem-Stones | 45 | −1 | g | 250 | 15 |
| 16 | Alien Items | 53 | 15 | t | 192 | 7 |
With the system’s economy number e (0 to 7 as in the table above) and the random byte r from the commander file, all in single bytes: the change is e × |factor|; the price is (base price + (r AND mask) + change, or minus it when the factor is negative) × 4, in tenths of a credit; the quantity is base quantity + (r AND mask) − change (plus it when the factor is negative), made 0 if it came out negative as a signed byte, then kept to 6 bits (at most 63). Alien Items always have a quantity of 0. The game works these out on arriving in a system and stores the quantities in the commander file at 53 to 69.
For Lave (economy 5) with r = 0 this gives Food 16 t, Textiles 15 t, Radioactives 17 t, Minerals 58 t and Gold 7 kg, as the default commander file’s market has; the other bytes of that file’s market are not what this arithmetic gives with r = 0, and the explorer shows both columns.
Distance and the chart
The distance between two systems, in tenths of a light year, is 4 × the square root of (dx² + dy²), with dx the difference of the x coordinates and dy half the difference of the y values. The hyperdrive reaches 7.0 light years. The explorer’s chart draws every system as a dot (one chart unit is three pixels), rings the present system and draws the circle of 7 light years round it.
Sources
- Galaxy and system seeds, Twisting the system seeds, Generating system data, Generating system names and Market item prices and availability – Mark Moxon’s deep dives
- The BBC Micro cassette source on github.com/markmoxon: the TT54 twist routine, the QQ16 pair table, the QQ23 market table and the TT151 and GVL arithmetic