Subject:      Knightlore - And Farewell...
From:         stuart@mirkwood.win-uk.net (Stuart Knight)
Date:         1996/09/18
Message-Id:   <345@mirkwood.win-uk.net>
Reply-To:     stuart@mirkwood.win-Uk.net (Stuart Knight)
Newsgroups:   comp.sys.sinclair
  Article Segment 1 of 2
  (Get All 2 Segments)


Greetings All.

I am leaving the UK in the next few days, to embark on a new job
opportunity "Down Under" in Oz.

Whilst packing up my house, I came accross some notes I wrote 10-12
years ago regarding the game Knightlore. 

They describe the method by which the room layout data is stored,
and how to change it, to redesign each location to whatever you
would like.

As a parting gesture to this group (for the short-term anyway - I
will be back on-line A.S.A.P) I thought I would share these
ramblings with the Sinclair Community.

** This is quite hard to explain and may need a couple of read thrus
to fully understand it ** 

The data describing the layout of the rooms begins at position
25176, and is variable length for each room.  The room description
is first, followed by the room number, codes detailing the exits,
colour and the size of the screen. The code 255 marks the end of a
room description, the next byte being the beginning of the
description for another room.  The room numbers start at 1 and
increase by one for each room.

Room Layouts - Description
--------------------------

The layout of each room can be imagined as overlayed on 4 chess
boards (on top of each other, or an 8x8x4 3d array for the techies)
with each square numbered. 0 to 7 down the lower left-hand side to
bottom middle, 8 to 15 in the next row.......the final row from top
middle down top right to right middle being 56 to 63. 

I hope the following does not get mis-formatted on transmission:

                                 56
                              48    57
                           40    49    58
                        32    41    50    59
                     24    33    42    51    60
                  16    25    34    43    52    61 
               08    17    26    34    44    53    62
            00    09    18    27    35    45    54    63
               01    10    19    28    36    46    55   
                  02    11    20    29    37    47
                     03    12    21    30    38
                        04    13    22    31
                           05    14    23
                              06    15
                                 07

Each room can be up to 4 levels high, for each level, 64 is added
to the above positional values. Thus middle left subsequent levels
would be 64, 128, 192 respectively.

The available objects
---------------------

The codes for each of the objects (in no real order) are as follows:

0       Solid Block
24      Jungle Block
128     "Mobile" Block
168     Collapsing Block

40      Impaler (Spike!)
32      Gargoyle
48      Chest
56      Table

208     Portcullis \ = orientation on screen  
216     Portcullis / = orientation on screen

200     Magic Spell
184     Roving Ball

72      Ghost
104     Knight - Moving Around
64      Knight - Moving Back and forth

16      Bouncing Ball
176     Exploding Block
144     Falling Spike Ball ("conker") 
152     Spike ball ("conker")

80      Flame - Moving back and forth
224     Bouncing ball
8       Static Flame
88      Block 5 or 6 Levels up from placed position (creates a form
        of ceiling)
112     Sliding Blocks - Up and Down
120     Sliding Blocks - Side to Side

There are others which I can't decipher from my notes.

Now the real interesting bit
----------------------------

To fully describe the room layout the object code, followed by it's
position, need to be listed, followed by the next object, position
grouping.  If more than one object is required add the number of
ADDITIONAL items required to the object number then list ALL of
the locations. eg (object number + extras)

[A maximum of eight objects (object number + 7) can be placed at a
time with this scenario, otherwise there would be confusion on
interpretation, as to which object is required. 

Re-read the above and follow the few examples below.

Requirement                     Code Sequence
Place a chest in potion 21      48(code for chest) 21(position).
Place a gargoyle in pos 55      32(code for gargoyle), 55(pos).
Place 2 tables at 35 and 36     57(56 + 1), 35,36
Place 4 Impalers at 3,4,59,60   43(40 + 3), 3,4,59,60

Proof of 8 object limit on each description.

Place 9 Jungle blocks at 0 - 7  (24 + 8), 0,1,2,3,4,5,6,7

As can be seen the combined object + extras would = 32 which would
be interpreted as a gargoyle.  The rest of the sequence would then
be completely unexpected, and could even crash the game if the
magic value of 255, is included in an unintended list of object
positions. SO BE CAREFULL 


Any unlisted postions will be blank.

Certain objects have gravity acting on them so that if they are
placed at a level where there is nothing underneath to support it,
then it will fall to level 1.


Have fun experimenting!!

Maybe speak to you again soon, (my link goes next monday....) 

--
Stuart Knight       e-mail: stuart@mirkwood.win-uk.net


