ILLUMINATOR (part 1 of 2)
by Alan Davis
from ZX Computing January 1987

Alan Davis unveils a versatile character designer and outlines the
first step towards illuminated text displays.


[NOTE: In the file "capitals:a" in ILLUMINA.TAP, I've only defined large ]
[versions of the letters A, E, M and T. Also, the character set in the   ]
[file "chars:a" is not the one shown in the magazine (it's actually taken]
[from the game "Crusoe" by Automata), although I have redefined the      ]
[characters for the decorative effects used in the demo.             JimG]


Even if you have only a slight interest in the world of adventure
games, you could hardly have failed to encounter the great "TEXT"
versus "GRAPHICS' debate. To illustrate or not to illustrate - that is
the question! At one extreme we have the "text-only" purist who
dismisses the notion of "graphic- enhanced" games on principle, and at
the other extreme we find the philosophy that "a picture is worth a
thousand words" - and so the fewer words the better!

Most of us, I suspect, fall somewhere in the middle - because
naturally the situation isn't as simple as the extremists would have
us believe. When you play a well-written text adventure such as
"Castle Blackstar'; with its evocative descriptions and intricate
plot, who needs pictures? Contrariwise, who would now want to play a
version of "The Hobbit" without those wonderfully atmospheric
illustrations? The loss would be intolerable.

In a world where merit is always recognised and rewarded, there would
be room for all styles to rub along together, but alas - we don't live
in such a world. Ever since the tablet of stone was found on some
remote mountain top, inscribed with the commandment "GRAPHIC
ADVENTURES SELL BEST" on one side and "ANY OLD GRAPHICS WILL DO" on
the other, we've seen a rapid decline in the development of the pure
text game. And one unfortunate consequence of this is that, like it or
not, the adventurer's Spectrum now spends a fair bit of time (and lots
of memory) displaying pretty dreadful pictures. (Did you ever meet
anyone who wasn't grateful that the graphics in "Emerald Isle" can be
switched off?)


Text effects

Now this is a great shame, because the potential of the pure text
adventure is far from being played out. But even the most diehard text
purist must surely admit that a TV screen full of text isn't the most
attractive sight around. The standard Spectrum character set is
extremely crude and stark. (Imagine reading a novel which was printed
using the Spectrum font! It doesn't bear thinking about, does it?) Of
course many adventure authors use a redesigned character set for just
this reason - though in a large number of cases even this concession
to eye-appeal has been neglected.

Far back in the dim mists of time - about a couple of years ago - an
adventure appeared under the Games Workshop banner which seemed to
open up a new venue for the pure text game. It was called "Tower of
Despair'; and it was written (to the astonishment of all who saw it
for the first time) with the Quill. It was a pretty good adventure in
its own right, but what captured everyone's imagination was its
presentation - which tried to produce the effect of illuminated
manuscript using a combination of decorated initial letters and a very
beautiful script. I understand that it was quite successful
commercially at the time, but as far as I'm aware, no one has since
developed the idea to any extent (if you've found any others, perhaps
you could drop me a line and let me know?)

Well, a two-year wait is long enough; if no one else is going to try
it, we'd better do it ourselves! After all, so many adventures are
designed around a fantasy world with a medieval or Anglo-Saxon
flavour, that we could hardly find a more appropriate kind of
presentation than by simulating illuminated manuscript. Who knows -
perhaps we can breathe a bit of life back into the old text adventure
yet? (Of course the use of a display utility even though we're
starting with adventures in mind.) [sic - the previous sentence
doesn't make sense. JimG]

Before tackling the actual computing problems, I went in search of
inspiration by looking at reproductions of the genuine article. I
spent some time poring over the Lindisfarne Gospels, which are
masterpieces of illuminated script about 1200 years old. (You can see
the original manuscripts in the British Museum). From this experience
I can confidently say that If you were hoping to copy THAT on your
Spectrum, then forget it! It was clear that I'd have to lower my
sights quite a bit! However, eventually I did arrive at a number of
definite and realistic program design aims which can be summarised as
follows:

1. Tower of Despair was really a bit of a cheat; it had to be, simply
because of the Quill's limitations. The effect of illuminated initials
was achieved just by printing graphic symbols in various colours
around an ordinary capital letter. Now we can do better than this
because, free of the Quill's limitations, we can design large and
detailed initial letter shapes, store them in memory, and then print
them with a specially written machine code routine.

2. The illuminated initials should be large enough to produce their
decorative effect - but not so large that either a ridiculous amount
of memory is needed to store them, or that too little space is left on
screen for the main body of text. I settled for squares 16 pixels (2
character squares) wide - so that 26 capital letters can be stored in
a total of 832 bytes (26 letters at 32 bytes each).

3. The machine code printing routine should be readily accessible from
within a BASIC program so that once a BASIC string variable (z$) has
been defined, the first letter is automatically printed as an
illuminated capital (with an option to switch to "normal" capitals if
required). The routine should then continue to print the rest of the
string in characters of normal size, word-wrapping at the ends of
lines.

4. The word-wrapping process should be flexible enough to allow
decorated borders of any width to be permanently displayed without the
text overprinting them; and for the same reason, a routine should be
available for clearing selected areas of screen within any such
borders.

5. It should be possible to alter the INK, PAPER, and BRIGHT
attributes for the capitals separately from the main text.

This design brief would result in a flexible utility which could be
used from within a BASIC adventure program with a minimum amount of
fuss. Once the initial parameters are decided upon, such as width of
decorated border and sizes of text windows, you can just get on with
writing your game knowing that the bread-and-butter business of
printing and arranging your text will be looked after automatically.
If the end product falls a bit short of the Lindisfarne Gospels, it's
nevertheless much more atmospheric and attractive than a typical
screen from your average text adventure!


Capitals

Sounds promising? Then let's make a start. The first essential job is
to design our 26 enlarged decorated initial letters within their 16x16
pixel squares, and store them as a series of bytes above RAMTOP. If
you want to do this on graph paper, work out the numbers, and POKE
them in yourself then fine. Off you go and we'll see you again in a
year or two perhaps ... We mere mortals are going to use the
ILLUMINATOR program in Listing 1, and do it all in a couple of hours
instead! OK?

Listing 1, by the way, isn't just a utility for designing large
decorated initials - it can also do service as an ordinary character
designer at the press of a key. Of course you may well have a program
for redesigning characters already, but since you'll need to change
the normal character set to a style which "goes well" with your
special capitals, it obviously makes sense to have the two facilities
available together in a single program for both practical and
aesthetic reasons.

To get a working copy of the program, type In Listing 1 and save it so
that it will auto-run from line 1000. (I suggest you omit the REM
statements in your version). Notice that lines 635, 640, and 1000
contain microdrive SAVE and LOAD commands (fast storage is a great
advantage when working with this kind of utility). If you're
restricted to tape cassettes, you'll need to change these to the usual
tape commands, of course - which just means omitting the *"m";1; part
in each case. Note also that in line 52 it is DOUBLE spaces which are
used in the PRINT statements, The program isn't of much interest in
itself - its value lies purely in its role as a development tool.

In addition to Listing 1, you'll also need a saved copy of the boring
old Spectrum character set. To get one, just type in Listing 2 and
then RUN. If you're working from tapes rather than drives, you'll need
to change line 50, and then save the bytes immediately following the
main program (Listing 1) so that they'll be loaded automatically (see
line 1000).

Once you have the program loaded in and running, it will initially
enter "CHARACTER DESIGNER" mode (Figure 1) [see ILLUM_11.GIF]. If you
press ENTER, it will go into "ILLUMINATOR" mode (Figure 2) [see
ILLUM_12.GIF] - and indeed you can switch between the two modes at
will at any time. Key identifications are given on screen (the same in
both modes) but limited screen space requires these to be brief, and a
little further explanation is called for.

Movement of the little flashing cursor around the grid is achieved
using keys Q, A, O, and P. SPACE will toggle the pixel on and off at
the current cursor position. The results of your artistic efforts will
be shown at their normal size in the little box below the main grid,
and if you get in such a mess that you need to start again, then key C
will wipe the slate clean.


Illuminated cursor

When you're satisfied with your design, press key X to enter "insert"
mode. A bright cursor will appear at screen bottom, and you can move
it - again using keys Q, A, O, and P - to the letter or character you
want the shape to represent. (The cursor will "wrap around" at the
left and right edges to speed up the selection process). Pressing
SPACE will insert the new shape, and ENTER allows you to quit if you
change your mind. If you want to fiddle with an existing shape, you
can transfer it to the grid by pressing key Z, and it's then a matter
of moving the bright cursor to the letter or character you want to
pick up, and pressing SPACE, in just the same way.

Once you've finished, you can save your shapes by pressing key S.
You'll be asked to type a single identifying letter (say "a") so that
your shapes can be saved as either "chars:a" CODE 64000,768 or
"capitals:a" CODE 62976,832; depending on which mode you're in. Notice
that you do need to save the normal characters and the big capitals
separately - saving one does NOT save the other as well! You can load
in a set of characters or capitals (to make additions or alterations)
using key L - and again you'll be asked to specify an identifying
letter. (If you already have a library of character sets saved under
another name, and want to modify one of those from within ILLUMINATOR,
then BREAK; load in your old character set bytes at 64000; and then
restart with GO TO 1010).

In ILLUMINATOR mode there isn't room to display all the large initials
on screen - and so the letters you see at screen bottom are just the
normal capitals, However, you'll very reasonably want to review what
you've done at intervals. To do this just press key Z and whizz the
bright cursor along the row of letters. As the cursor passes over each
letter in turn, the appropriate illuminated version will obligingly
present itself in the small box for inspection.

Finally - perhaps for new readers, or those who've never felt inclined
to try designing letter shapes before - if inspiration fails you,
DON'T GIVE UP! I've given in Figure 3 [see ILLUM_13.GIF] some
suggested shapes for the enlarged capitals, printed off at double size
- and if you're stuck for a set of vaguely "archaic" normal
characters, you might get some ideas from Figure 1. If all else falls,
you can always start with these. Incidentally, the funny shapes you
see scattered around among the letters at the bottom of Figure 1 are
designs I've experimented with in order to make decorative borders and
text dividers. I'll be offering a few suggestions about that next
month, but of course our main concern will be with the machine code
routine which is going to transform this month's artistic dabblings
into masterpieces of illuminated script ...


--
Another Fine Product transcribed by:
Jim Grimwood, Weardale, England (http://www.users.globalnet.co.uk/~jimg/)
--
