Magnetic Scrolls Data Structures?

#1

Hello. I am currently in the process of writing my own interpreter for classic Magnetic Scrolls Adventures such as “The Pawn” and “The Guild of Thieves”.

At the same time, i am reverse-engineering the original data structures, and trying to document them. Is there maybe something already available, somewhere online or offline, that would help me fill in the blanks?

1 Like
(jkj yuio) #2

Yes there is!

Presenting the original wallchart…

Byte #0; Noun States:

        ---------------------------------
        | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        ---------------------------------
          |   |   |   |   |   |   |   Plural
          |   |   |   |   |   |   Dead
          |   |   |   |   |   Broken
          |   |   |   |   Local Contents,
          |   |   |   |     The contents of such a container are `valid' when
          |   |   |   |     it is closed But may not be reachable as far as
          |   |   |   |     process is concerned.
          |   |   |   |     (See Transparent containers & X-Ray verbs).
          |   |   |   Open
          |   |   Closed
          |   Locked
          Lit
           (as a flame)

Byte #1;  Physical Characteristics

        ---------------------------------
        | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        ---------------------------------
          ------------:   -------------:
            Hardness            Strength

         0,     Void
         1,     Liquid
         2,     A Quantity (requires 'any' such as rice).
         3,     Can be cut with a `sharp' object.
         4,     Can be cut only with a `very sharp' object.
         5,     Normal (may be breakable).
         6-9,   Undefined.
         10,    Brittle; will break if used violently.
                         Can break if `drop'ed if required.
         11,    Tool for breaking other items.
         12,    Flexible, can be tied & used to tie other things.
         13-14, Undefined.
         15,    Unbreakable (and cannot be used for breaking).

Byte #2;  Size & Weight.

        ---------------------------------
        | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        ---------------------------------
         ------------:   ------------:
                Size           Weight

    The sizes of objects vary coarsely,
    approximates,
    0,      Void.
    1,      like a key or matchbook,
    2,      like a bottle or paperback,
    3       like a bag small box,
    4,  a chair
    5,  a person.
    6-14    not clearly defined. bed ~ 10
    15,     large

        Weight:
        person ~ 5

    If the object is a `room' the sizes mean the following,
    0,  Normal
    1,  Narrow Crevice (must drop all objects).
    2,  confined space (cubicle or booth, only 1 person at a time).
    3,  Low ceiling, no riding vehicles here.
    4-9,    Undefined.
    10, "Whack, you hit your head."
    11, "The `vehicle' stumbles."
    12, "Ridiculous to ride in there".
    13-15,  Undefined message type.

Byte #3;  Shape & Texture

        ---------------------------------
        | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        ---------------------------------
          :---    |   |   ------------:
      Sharpness   |   |             Texture
                  |   |
    0, Not Sharp  |   |     0,  Void.       7,   Clammy
    1, Blunt      |   |     1,  Smooth      8,   Soft
    2, Sharp      |   |     2,  Rough       9,   Hard
    3, Very Sharp |   |     3,  Hot         10,  Warm
              |   |     4,  Cold        11,  "`npc' doesn't like it"
             Wet  |     5,  Slippery    12,  Thorny
     Wet rooms are    |     6,  Furry       13,  Sticky
    feet in water     |             14,  Ice Cold
     like a stream    |                 15,  Crunchy.
              Movable

Byte #4; Data1


    ---------------------------------
    | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
    ---------------------------------
          |   |   |   |   |   |   |   Modified Quantity
      |   |   |   |   |   |   |     Something that is really plural but
          |   |   |   |   |   |   |     Singulared by an adjective, such as
          |   |   |   |   |   |   |     'a pair of trousers'
          |   |   |   |   |   |   |
          |   |   |   |   |   |   Description Only (Do not name the item)
      |   |   |   |   |   Short Look, no extras to description.
      |   |   |   |   Money
      |   |   |   Explored
      |   |   Npc's refuse to accept it (Rubbish)
      |   Object is an NPC.
    Lightable
       (lightable & lit  => a flame)
       (!lightable & lit => glowing)



Byte #5; Data2


    ---------------------------------
    | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
    ---------------------------------
      |   |   |   |   |   |   |   Pseudo
      |   |   |   |   |   |   Initial State Done
      |   |   |   |   |   A Lit Room
      |   |   |   |   Has a surface & can be sat on
      |   |   |   Force Adjective (eg Blue jeans)
      |   |   Force Plural
      |   |     For such things as uncountable nouns, ones taking
      |   |     any/some but not 'are' eg.
      |   |     there IS SOME furniture here.
      |   Has been given to the npc
      |    Who will give it back unless it has value or money.
    Another Noun
      There is another noun in the game with the same name.

The Location
 This is a 32 + 1 bit quantity most of which lives in bytes 6-9. However
 the pseudo bit is in byte #5.
 Format

byte#    6      7       8      9
       --------------------------------------------------
       |HEAD | Secondary Locator | High Byte | Low Byte |
       --------------------------------------------------

 Head
 This determines the relationship between the object and that which
 it is located to.

    ---------------------------------
    | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
    ---------------------------------
      |   |   |   |   |   |   |   Related
      |   |   |   |   |   |   Hidden, will automatically appear when
      |   |   |   |   |   |       related object is explored.
      |   |   |   |   |   Worn by player
      |   |   |   |   Intrinsic (hands, feet etc)
      |   |   |   |     NB: other npc's are assumed to also have these.
      |   |   |   Inseparable (a permanent feature)
      |   |   Contained
      |   A Room, bytes 8&9 contain the room#.
     Out, The object does not exist at present.

Secondary Locator, Byte #7

    This byte applies only to pseudos.
    Pseudos are items that are effectively related to many rooms
    simultaneously & shouldn't be movable by the player.

    In many cases the player can put things on pseudos & generally
    relate objects to them. In these cases the 'Secondary Locator'
    of such an object contains the room# of the pseudo instance,
    ie. it picks out one of the pseudo occurrences.

Data Field, Bytes 8&9

    These 16 bits can be either a noun#, room# or pointer as follows;

    Case                Description of bytes 8&9

    Item is simply located, Item is in room# 8&9.
    ie, byte #6 == 0

    Item is a room          8&9 contain the room# of the room.

    Item is a pseudo        8&9 point to a zero terminated list
                            of room#'s (possibly read only)

    Item is neither a room nor  8&9 contain the noun# of the object
    a pseudo and not simply     the item is in/on/near etc.
    located

Byte #10; Data3


    ---------------------------------
    | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
    ---------------------------------
      |   |   |   |   |   --------:
     Clothing Cover   |        Container Volume & flag
      |   |   |   |  Chest          capacity = vol -1
      |   |   |  Head
      |   |  Arms           The Volume must never reduce to zero,
      |  Groin          for otherwise the object is no longer
       Feet & Legs          a container.

       * bit 7 => no article for rooms (put in by Anita)

       GUI BITS
       * bit 6 "gui_show_map" => visible on map (only applies for rooms)

         eg squares of rainbow room in guild. need to show all on map
         before explored. NB: flag set in code not f23 for guild.

       * bit 5 "gui_show_inv" => visible on inventory bar override.

         eg keys in keyring in Jinxter. they are inseparable to suppress 
         description but need to show on inv. but (eg) jeans pocket in pawn 
         does not.

Byte #11, Data4


    ---------------------------------
    | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
    ---------------------------------
      :-------    :----   ----:   Worn By Npc
      |           |         Wearability
      |           |
      |           |        0,   Can't be worn
      |           |        1,   clothing (normal)
      |           |            For rooms this is no_article
          |           |        2-3, magical protection
      |           |
      |          Combustibility
      |           0,   non-flammable
      |           1,   burns away (like paper)
      |           2,   melts (like wax)
      |           3,   explodes.
      Edibility
       0,   not edible.   4,   edible
       1,   Fatal         5,   tasty
       2,   Poisoned      6,   Very tasty
       3,   become ill.   7,   magical (healing etc.)


Bytes #12,13; Fixtures

    -----------------------------------------------------------------
    | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
    -----------------------------------------------------------------
      |   |   ------------ Data Field -----------------------------
      |   |
      |   |
      |  mixing liquids (not implemented)
      |
      Fixed permanently, Cannot be untied.


This concludes the 14 bits of data associated with each object.
If the object is an npc, there is an additional 4 bytes of extended data.

Npc Data

Bytes 0&1

    Undefined.


Byte #2

    ---------------------------------
    | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
    ---------------------------------
      :------------   |   |   |   Sex
     Emotion          |   |   |     0, Female.
       0,  Null           |   |   |     1, Male.
       1,  Happy          |   |   |
       2,  Angry          |   |  Suppress Clothing
       3,  Violent        |  Animal
       4,  Asleep        No Article
       5,  Unconscious
       6,  Peaceful     11, Tired
       7,  Exited       12, Suffering
       8,  Friendly     13, Frightened
       9,  Drunk        14, Cheerful
       10, Sad          15, Mischievous


Byte #3

        ---------------------------------
        | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
        ---------------------------------
      :--------   |   |   |   |   Paused, from scripts & MoveNpc
      Spare.      |   |   |   |
                  |   |   |  Nice, will give you things except
                  |   |   |     clothing, money & valuables.
                  /   |   |
        Covetous     |  Non-pausable,
                      |        Npc is in a rush
                  |
              Quiet,
                 Produce no output from scripts.

Any specific questions, ask me at jkj@strandgames.com

Good luck!

3 Likes
#3

NICE! where is that one coming from?

(jkj yuio) #4

from the version of magnetic we’ve been using and originally from the tapes.