It's always a speed vs memory tradeoff, and the Spectrum illustrated that like no other machine (even within the ROM itself - witness the infamous seven byte square root routine). Obviously certain more plodding games (strategy, text adventures, etc) relied less on speed and more on size, hence Speccy programmers being able to see a joke in this XKCD [http://www.xkcd.com/1275] that I'm pretty sure wasn't intended (short version: "int PI" was tokenised and expressible in two bytes, while the number 3 would have needed five bytes of floating point to store). More action-oriented games couldn't have used those sorts of optimisations, because "int PI" is after all a calculation and every calculation adds more time.IndieForever said:Back in the '80s I wrote a lot of those text-only adventure games for the Spectrum. We used quite a clever little system that scanned through all the text the writer had created looking for repeating patterns or common words: the, ing, you, look, walk, etc., etc. We then replaced those multi-character words or partial words with a one-character replacement so that when the game was reading through the text data and found a non-alphabetical code, it looked it up in an array and replaced that code with the letters. Clever use of this system could get more text into 48k than should actually have been possible, but damn, it was slow come time to throw it up onto the screen:
Because we didn't know how long a given line of text was going to be at any one time due to these characters, and the fact that we had a fixed width screen, we had to generate the line in memory and then figure out if the last word would wrap onto the next line. If it did, we saved it, backtracked, deleted that word and then added it into the buffer for the next line and so on. This is no big deal on your 2.5Ghz PC. It is a massive deal on a 2.5Mhz Spectrum!
I know that was a bit rambling, but I thought the more technically-minded (and perhaps older!) readers would appreciate an explanation of why 'TEH OPTIMIZINGS!' means different things, at different times to different people, and not necessarily why installs seem bloated sometimes.
Talking of time, I don't know if you've seen the disassembly of the Spectrum classic Knight Tyme [http://community.dur.ac.uk/philip.anderson/disassemblies/knight-tyme-48k/maps/all.html]; there's two sections (here [http://community.dur.ac.uk/philip.anderson/disassemblies/knight-tyme-48k/asm/43196.html] and here [http://community.dur.ac.uk/philip.anderson/disassemblies/knight-tyme-48k/asm/44061.html]) that illustrate your word encoding idea perfectly.