Elite's crazy tokenized string routine
xania.org
xania.org
It turned out Bedlam packed strings into contiguous bytes of ram, but using 5 bits per character. Byte 1 had all of character 1 in the lower 5 bits and the first 3 bits of character 2 in the upper 3 bits, and so on. Of course with only 32 values the character set was a bit odd. As I recall you had most letters but not Z or Q,the numbers 0,1, and 3, a period, comma, and space. Something like that. The routine to unpack the characters was quite small, just used shifts to build an offset into a table containing the ASCII values.
The games also ran in a somewhat ingenious "virtual machine", with all the game logic being expressed through sets of very tightly encoded high level rules rather than implemented directly in assembly. In the Android port, I literally load the original ROM into an array and then just process these same rules verbatim using a java implementation of the VM. Kind of amazing to me how portable yet efficient the design is.
Like this game you describe here, the Z-Machine also stored characters in less than one byte, packing three characters (plus an extra control bit) into two bytes (http://inform-fiction.org/zmachine/standards/z1point1/sect03...)
A small side-effect, however: Bell & Braben had to try several galaxy seeds in Elite before they happened upon one that didn't generate the planet Arse!
Lots of things of the era did things like this, of course. 8-bit BASICs would often tokenise on input to reduce memory consumption and the amount of lexing needed during the interpreting.
Even as late as the PlayStation, similar things were still very common practice: take a look at the English translations of Final Fantasy 7 through 9, or Chrono Cross, for excellent examples of the type of thing, which (if I recall correctly? It's been a few years!) don't use ASCII (but map to offsets in the tilesets), use control characters to handle colours and the like, sometimes have digraphs and in the case of Chrono Cross, due to a lack of disc space (caused by English text being bigger than Japanese text of an equivalent meaning), the localisation team got highly creative and made an accent engine for the 44 or so different characters so that quite a lot of the lines could be reused and changed on-the-fly (as the 'developer ending' documents).
It always surprises me when you see such extreme space saving efforts, especially on machines where you would expect the processing overhead to be high. I've noticed that as the tech improved this concept remains important because I/O bandwidth is so often the real limiting factor. Things like piping input/output through gzip can actually speed batch processes up dramatically.
Doom 1+2 (including all the data) can be entirely loaded into modern high end CPU cache.
Here is a video with interviews of the orginal developers that discuss the extreme need for byte savings: https://www.youtube.com/watch?v=Rapa3VfUWfs
Of course you guys know David Braben is one of principle founders of the Raspberry Pi foundation.
I have a write up on how it worked here: http://blog.rabidgremlin.com/2015/01/14/procedural-content-g...
Anyone other Acorners remember Repton? Also a cool game. You had to wait 10 minutes for the game to load off a cassestte though!
The beeb was and still is the peak of computing for me. I capitalised on lots of them being chucked out from my school in the early to mid 1990s. Must have had about 30 of them and piles of disk drives and hundreds of disks but alas they're all gone via ebay now.
Occasionally I fire up BeebEm but that's it now :(
Can't get disks or cassettes to load (still got all the Acornsoft and Superior stuff), but I plan on linking it up to something like a Pi and add a custom file system to be able to load stuff up again. Interested if anyone already has mananged this.
Also you can now get ethernet! (BBC Master 128 only) http://www.sprow.co.uk/bbc/masternet.htm
My operating system uses LZW compression.