WARNING: OSBOLETE-LY FABULOUS
You've been warned.
This week I created a sequential data file containing the Spinward Marches using BASIC. The file consists of single encoded strings, separated by newlines, with fixed-position data: the mainworld name comes last. Here's a brief form of how the file was created (a Perl script generated the BASIC code, which I then copy-pasted into the VICE emulator running Commodore 64 ROMs).
The data is, in order: coordinates; P and GG counts; UWP; bases (two characters mandatory, where a space means 'no base'); and world name.
Here, coordinates are compressed, and represent the sector location, offset from a remote (0,0), where Stinj Tianz is (11,11), and hex position within that sector. Sector (16,15 = GxFx) is the Spinward Marches. Hex position is in base-40 (0-9, A-Z, @=37, #=38, $=39). This lets me calculate hex distances without having to deal with borders.
(Yes, I went way overboard with the coordinates. Sue me. If GDW had simply gone with 8x8 subsectors the problem would be more tractable).
Extraction of these strings is purely positional. The only tricky extraction is the world name, which is retrieved via:
Ship class data, meanwhile, is similarly encoded, using the QSP for starters, but also including some additional metrics.
The data here starts with the QSP (e.g. A-BS11), then the TL of the ship (9), then offset metrics for crew comfort, passenger demand, and fighting effectiveness, which is a WAG meant to approximate the ability to fight and take a punch.
You've been warned.
This week I created a sequential data file containing the Spinward Marches using BASIC. The file consists of single encoded strings, separated by newlines, with fixed-position data: the mainworld name comes last. Here's a brief form of how the file was created (a Perl script generated the BASIC code, which I then copy-pasted into the VICE emulator running Commodore 64 ROMs).
Code:
100 ns = 463
110 f$ = "0:stars,seq,write"
120 gosub 200 : rem create starchart
130 ns = 18
140 f$ = "0:ships,seq,write"
150 gosub 200 : rem create ship catalog
199 end
200 open 2,8,2, f$
210 for i = 1 to ns
220 read uwp$
230 print# 2, uwp$
240 next
250 close 2
299 return
1000 data GJFA 03 A788899-C NS Regina
[I]... and so on for 462 more worlds ...[/I]
Here, coordinates are compressed, and represent the sector location, offset from a remote (0,0), where Stinj Tianz is (11,11), and hex position within that sector. Sector (16,15 = GxFx) is the Spinward Marches. Hex position is in base-40 (0-9, A-Z, @=37, #=38, $=39). This lets me calculate hex distances without having to deal with borders.
(Yes, I went way overboard with the coordinates. Sue me. If GDW had simply gone with 8x8 subsectors the problem would be more tractable).
Extraction of these strings is purely positional. The only tricky extraction is the world name, which is retrieved via:
Code:
na$ = left$( uwp$, len(uwp$)-22 )
Code:
2000 data A-BS11-9 111 Trader
2010 data S-AA22-B 202 Scout
... 16 more entries ...