Difference between revisions of "Myst RLST resources"

From A look inside The Link @ wiki
Jump to: navigation, search
(corrected case studies to use resource IDs)
(Type 11)
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Myst}}
 
{{Myst}}
  
These contain Myst's hotspot descriptions.
+
These contain Myst's hotspot descriptions. Hotspots come in several "types" and depending on their type their action can be simple or very complex.
  
The data is a list of records, each record describing one of the hotspots:
+
RLST data is a list of records, each record describing one of the hotspots:
 
{| class="structure"
 
{| class="structure"
 
|short||record_count
 
|short||record_count
Line 28: Line 28:
 
|variable||additional data
 
|variable||additional data
 
|}
 
|}
*''type'' seems to specify the hotspot action in a wide sense. Every value between 0 and 14 except for 9 has been observed. See below for the meaning.
+
*''type'' specifies the hotspot action in a wide sense. Every value between 0 and 14 except for 9 has been observed. See below for the meaning of each type.
*''flags'' seems to be a bit field. Observed values are 0, 1, 2, 3, 5, 6 and 8. Bit 3 is suspected to flag Zip Mode hotspots.
+
*''flags'' seems to be a bit field. Observed values are 0, 1, 2, 3, 4, 5, 8 and 10 (4 variable bits). The value seems related to when the hotspot actions should be executed. For example, regular clickable hotspots usually have bit 1 set while hotspots that run background movies (e.g. the Channelwood windmill) have ''flags'' = 0. Bit 0 seems to indicate whether hotspot subimages are to be drawn (at least for type 8 hotspots). Hotspots with bit 2 set usually don't have any other bits set (except bit 0, encountered only twice). Bit 3 is suspected to flag Zip Mode hotspots.
*The following 4 fields define the hotspot rectangle. Note that "weird" rectangles are found, like (-32000, -32000, 32000, 32000).
+
*(''left'', ''top'', ''right'', ''bottom'') is the hotspot rectangle in pixels. Note that weird rectangles are found, like (-32000, -32000, 32000, 32000).
 
*''destination'' contains a destination card ID for hotspots that change card, or zero.
 
*''destination'' contains a destination card ID for hotspots that change card, or zero.
*Additional data follows when ''type'' > 3 (complex hotspots), clearly representing lists of actions to perform. We have yet to figure out how to calculate the length of those complex records.
+
*Additional data follows for some types, describing actions to perform. See below.
  
 
==Hotspot types==
 
==Hotspot types==
Types from 0 to 4 are associated with "simple" hotspots that usually just change card. In these cases, ''type'' indicates the movement direction: forward, left, right, down and up respectively. There is no additional data in the hotspot record for these simple cases.
+
===Types 0 to 4 and 14===
 +
"Simple" hotspots that just change card. There is no additional data in the hotspot record. Types 0 to 4 define the movement direction (forward, left, right, down and up respectively) while the purpose of type 14 is not yet clear. It is used prevalently near linking books.
  
Type 5 hotspots seems to define some sort of action list to execute when the hotspot is clicked. The additional data takes this form:
+
===Type 5===
 +
Type 5 hotspots have a simple script attached to them, which is executed when the hotspot is activated. See the [[Myst_scripts|page about scripts]] for the structure of scripts.
  
{num_actions} [opcode (var_index) {num_values} [values]]
+
===Type 6===
 +
Type 6 hotspots have a script like type 5 ones, but they also play a video when activated. The record starts with a full type 5 record. Then comes a zero-terminated string (C string) which defines the path to the video file within the Myst CD-ROM, without extension. Backslashes are used to separate directories, as usual in Windows. After the string, the input stream position should be padded to the next 2-byte boundary. Finally come 7 shorts:
 +
{| class="structure"
 +
|short||left
 +
|-
 +
|short||top
 +
|-
 +
|short||loop
 +
|-
 +
|short||u0
 +
|-
 +
|short||u1
 +
|-
 +
|short||u2
 +
|-
 +
|short||u3
 +
|}
 +
''left'' and ''top'' specify the movie position. Sometimes they misteriously exceed the correct position by 10000, so one has to take them modulo 10000 to get "safe" values. ''loop'' is 0 for movies that are to be played once, 1 for movies that must loop. The unknown fields are usually 0 or 1 but ''u3'' is found with 125 in one case. ''u0'' seems fixed to 1.
  
See the [[Myst_scripts|page about scripts]] for more info.
+
===Type 7===
 +
Type 7 record serves as some kind of switch statement: it runs a script from a list indexed by the value of a variable:
  
Type 6 hotspots play a video when activated. The record starts with a full type 5 record. Then comes a zero-terminated string (C string) which defines the path to the video file without extension. Note that after the string is read, input stream position should be padded to the next 2-byte boundary. Finally come 7 shorts whose purpose is still unknown.
+
(var_index) {num_cases} [record_type <record_data>]
  
Type 7 record serves as some kind of switch statement, executing one of several action lists (or cases) indexed by the value of a variable:
+
Each case itself begins with a record type (always 5 or 6) and contains the data you would find in a hotspot record of that type, excluding the standard block common to all types.
  
(var_index} {num_cases} [record_type <record_data>]
+
===Type 8===
 
+
Type 8 record is like type 7, but additionally it specifies a list of pictures to draw over main WDIB. The particular picture is chosen depending on the value of variable. This record includes the type 7 record at start.
Each case itself begins with a record type, followed by additional record contents (without common prefix). Only type 5 and 6 records used in a switch statement have been observed.
+
 
+
Type 8 record specifies a list of subimages to draw over main WDIB. Particular subimage is chosen depending on the value of variable. This record also includes type 7 record at start (which in turn includes type 5 record and more).
+
  
 
  <type_7_record> (var_index) {num_subs} [wdib_id <rectangle>]
 
  <type_7_record> (var_index) {num_subs} [wdib_id <rectangle>]
Line 57: Line 74:
 
Here, each subimage record defines a source WDIB ID and a source rectangle inside this WDIB. Rectangle is defined in the usual (''left'', ''top'', ''right'', ''bottom'') format, with one exception: empty rectangle is defined as the single short -1. This is probably the case when source rectangle equals destination rectangle. Also, ''wdib_id'' itself can be -1, this probably means original WDIB for this card should be used as source WDIB.
 
Here, each subimage record defines a source WDIB ID and a source rectangle inside this WDIB. Rectangle is defined in the usual (''left'', ''top'', ''right'', ''bottom'') format, with one exception: empty rectangle is defined as the single short -1. This is probably the case when source rectangle equals destination rectangle. Also, ''wdib_id'' itself can be -1, this probably means original WDIB for this card should be used as source WDIB.
  
The remaining types are being investigated.
+
===Type 10===
 +
Type 10 hotspots implement slider-like controls. The record structure is:
 +
{| class="structure"
 +
|variable||type 8 block
 +
|-
 +
|short||kind
 +
|-
 +
|short||left
 +
|-
 +
|short||right
 +
|-
 +
|short||top
 +
|-
 +
|short||bottom
 +
|-
 +
|short||u0
 +
|-
 +
|short||u1
 +
|-
 +
|short||u2
 +
|-
 +
|short||u3
 +
|-
 +
|short||u4
 +
|-
 +
|unsigned short||count0
 +
|-
 +
|short||list0[count0]
 +
|-
 +
|unsigned short||count1
 +
|-
 +
|short||list1[count1]
 +
|-
 +
|unsigned short||count2
 +
|-
 +
|short||list2[count2]
 +
|-
 +
|unsigned short||count3
 +
|-
 +
|short||list3[count3]
 +
|}
 +
''kind'' is a small number (0-3) and seems to describe what kind of control this is. ''left'', ''right'', ''top'' and ''bottom'' look like coordinates and probably specify the area available to the control (e.g. for sliders). The values in the final lists look like sound IDs.
 +
 
 +
A few cases:
 +
* Myst island, card 4500: planetarium sliders, ''kind'' = 2
 +
* Myst island, card 4530: spaceship sliders, ''kind'' = 2
 +
* Selenitic Age, card 1147: sliders for accessing the mazerunner, ''kind'' = 2
 +
 
 +
===Type 11===
 +
Type 11 hotspots implement controls that you click and hold or drag, like some of the levers. The record structure is similar to type 10 records, but lacks the last list:
 +
{| class="structure"
 +
|variable||type 8 block
 +
|-
 +
|short||kind
 +
|-
 +
|short||left
 +
|-
 +
|short||right
 +
|-
 +
|short||top
 +
|-
 +
|short||bottom
 +
|-
 +
|short||u0
 +
|-
 +
|short||u1
 +
|-
 +
|short||u2
 +
|-
 +
|short||u3
 +
|-
 +
|short||u4
 +
|-
 +
|unsigned short||count0
 +
|-
 +
|short||list0[count0]
 +
|-
 +
|unsigned short||count1
 +
|-
 +
|short||list1[count1]
 +
|-
 +
|unsigned short||count2
 +
|-
 +
|short||list2[count2]
 +
|}
 +
The first list seems to list sounds that play at animation start, the second seems to loop in the middle and the third seems to play when the user releases the control.
 +
 
 +
A few cases:
 +
* Myst island, card 4006: clock tower wheels, ''kind'' = 3
 +
* Myst island, card 4059: fireplace pattern book, ''kind'' = 3
 +
* Myst island, card 4098: huge tree control wheel, ''kind'' = 3
 +
* Selenitic Age, card 1245: arrows for rotating the cameras, ''kind'' = 1
 +
* Stoneship Age, card 2013: Achenar's toy lever, ''kind'' = 1
 +
* Stoneship Age, card 2161: generator handle, ''kind'' = 3
 +
* Stoneship Age, card 2218: telescope navigation, ''kind'' = 1
 +
 
 +
===Type 12===
 +
Type 12 hotspots implement animated controls which use a sequence of separate pictures for the animation. The record structure includes
 +
* a type 8 block
 +
* 10 unknown shorts
 +
* 3 lists of unsigned shorts (num_values followed by that many values) which look like sound IDs.
 +
* number of animation frames
 +
* ID of the picture with the first frame
 +
* two unsigned shorts
 +
* left,top coordinates of the animation
 +
 
 +
A few cases:
 +
* Channelwood Age, card 3161
 +
* Channelwood Age, card 3246
 +
* Channelwood Age, card 3271
 +
* Mechanical Age, card 6044
 +
* Mechanical Age, card 6156
 +
* Mechanical Age, card 6180
 +
* Myst island, card 4100
 +
* Myst island, card 4113
 +
 
 +
===Type 13===
 +
Type 13 record has just two unknown shorts ''u0'' and ''u1'' after the main block. In addition, ''destination'' seems to be a variable rather than a card ID.
 +
 
 +
Type 13 hotspots are used when an action is triggered by mouse movements (enter/exit) rather than clicks. Examples:
 +
*the match box puzzle in Myst island
 +
*the icons for raising the ship in Myst island
 +
*the crystals in Sirrus' room in Mechanical Age.
 +
Looking at the scripts, these hotspots could trigger a variable change when the cursor enters and leaves them.
  
 
==Case studies==
 
==Case studies==

Latest revision as of 23:14, 12 October 2008

Myst
Mohawk Overview
CLRC EXIT HINT INIT
MJMP MSND PICT RLST
VIEW WDIB HELP RSFL
Scripts Variables

These contain Myst's hotspot descriptions. Hotspots come in several "types" and depending on their type their action can be simple or very complex.

RLST data is a list of records, each record describing one of the hotspots:

short record_count
variable records

The record length is variable, depending on the hotspot type. The record structure is:

unsigned short type
unsigned short flags
short left
short top
short right
short bottom
unsigned short destination
variable additional data
  • type specifies the hotspot action in a wide sense. Every value between 0 and 14 except for 9 has been observed. See below for the meaning of each type.
  • flags seems to be a bit field. Observed values are 0, 1, 2, 3, 4, 5, 8 and 10 (4 variable bits). The value seems related to when the hotspot actions should be executed. For example, regular clickable hotspots usually have bit 1 set while hotspots that run background movies (e.g. the Channelwood windmill) have flags = 0. Bit 0 seems to indicate whether hotspot subimages are to be drawn (at least for type 8 hotspots). Hotspots with bit 2 set usually don't have any other bits set (except bit 0, encountered only twice). Bit 3 is suspected to flag Zip Mode hotspots.
  • (left, top, right, bottom) is the hotspot rectangle in pixels. Note that weird rectangles are found, like (-32000, -32000, 32000, 32000).
  • destination contains a destination card ID for hotspots that change card, or zero.
  • Additional data follows for some types, describing actions to perform. See below.

Hotspot types

Types 0 to 4 and 14

"Simple" hotspots that just change card. There is no additional data in the hotspot record. Types 0 to 4 define the movement direction (forward, left, right, down and up respectively) while the purpose of type 14 is not yet clear. It is used prevalently near linking books.

Type 5

Type 5 hotspots have a simple script attached to them, which is executed when the hotspot is activated. See the page about scripts for the structure of scripts.

Type 6

Type 6 hotspots have a script like type 5 ones, but they also play a video when activated. The record starts with a full type 5 record. Then comes a zero-terminated string (C string) which defines the path to the video file within the Myst CD-ROM, without extension. Backslashes are used to separate directories, as usual in Windows. After the string, the input stream position should be padded to the next 2-byte boundary. Finally come 7 shorts:

short left
short top
short loop
short u0
short u1
short u2
short u3

left and top specify the movie position. Sometimes they misteriously exceed the correct position by 10000, so one has to take them modulo 10000 to get "safe" values. loop is 0 for movies that are to be played once, 1 for movies that must loop. The unknown fields are usually 0 or 1 but u3 is found with 125 in one case. u0 seems fixed to 1.

Type 7

Type 7 record serves as some kind of switch statement: it runs a script from a list indexed by the value of a variable:

(var_index) {num_cases} [record_type <record_data>]

Each case itself begins with a record type (always 5 or 6) and contains the data you would find in a hotspot record of that type, excluding the standard block common to all types.

Type 8

Type 8 record is like type 7, but additionally it specifies a list of pictures to draw over main WDIB. The particular picture is chosen depending on the value of variable. This record includes the type 7 record at start.

<type_7_record> (var_index) {num_subs} [wdib_id <rectangle>]

Here, each subimage record defines a source WDIB ID and a source rectangle inside this WDIB. Rectangle is defined in the usual (left, top, right, bottom) format, with one exception: empty rectangle is defined as the single short -1. This is probably the case when source rectangle equals destination rectangle. Also, wdib_id itself can be -1, this probably means original WDIB for this card should be used as source WDIB.

Type 10

Type 10 hotspots implement slider-like controls. The record structure is:

variable type 8 block
short kind
short left
short right
short top
short bottom
short u0
short u1
short u2
short u3
short u4
unsigned short count0
short list0[count0]
unsigned short count1
short list1[count1]
unsigned short count2
short list2[count2]
unsigned short count3
short list3[count3]

kind is a small number (0-3) and seems to describe what kind of control this is. left, right, top and bottom look like coordinates and probably specify the area available to the control (e.g. for sliders). The values in the final lists look like sound IDs.

A few cases:

  • Myst island, card 4500: planetarium sliders, kind = 2
  • Myst island, card 4530: spaceship sliders, kind = 2
  • Selenitic Age, card 1147: sliders for accessing the mazerunner, kind = 2

Type 11

Type 11 hotspots implement controls that you click and hold or drag, like some of the levers. The record structure is similar to type 10 records, but lacks the last list:

variable type 8 block
short kind
short left
short right
short top
short bottom
short u0
short u1
short u2
short u3
short u4
unsigned short count0
short list0[count0]
unsigned short count1
short list1[count1]
unsigned short count2
short list2[count2]

The first list seems to list sounds that play at animation start, the second seems to loop in the middle and the third seems to play when the user releases the control.

A few cases:

  • Myst island, card 4006: clock tower wheels, kind = 3
  • Myst island, card 4059: fireplace pattern book, kind = 3
  • Myst island, card 4098: huge tree control wheel, kind = 3
  • Selenitic Age, card 1245: arrows for rotating the cameras, kind = 1
  • Stoneship Age, card 2013: Achenar's toy lever, kind = 1
  • Stoneship Age, card 2161: generator handle, kind = 3
  • Stoneship Age, card 2218: telescope navigation, kind = 1

Type 12

Type 12 hotspots implement animated controls which use a sequence of separate pictures for the animation. The record structure includes

  • a type 8 block
  • 10 unknown shorts
  • 3 lists of unsigned shorts (num_values followed by that many values) which look like sound IDs.
  • number of animation frames
  • ID of the picture with the first frame
  • two unsigned shorts
  • left,top coordinates of the animation

A few cases:

  • Channelwood Age, card 3161
  • Channelwood Age, card 3246
  • Channelwood Age, card 3271
  • Mechanical Age, card 6044
  • Mechanical Age, card 6156
  • Mechanical Age, card 6180
  • Myst island, card 4100
  • Myst island, card 4113

Type 13

Type 13 record has just two unknown shorts u0 and u1 after the main block. In addition, destination seems to be a variable rather than a card ID.

Type 13 hotspots are used when an action is triggered by mouse movements (enter/exit) rather than clicks. Examples:

  • the match box puzzle in Myst island
  • the icons for raising the ship in Myst island
  • the crystals in Sirrus' room in Mechanical Age.

Looking at the scripts, these hotspots could trigger a variable change when the cursor enters and leaves them.

Case studies

Note: these are simply the data in little-endian shorts and line-broken where patterns are found. <l t b r> is the hotspot rect. count [entry]... are guesses at when there are lists of entries. The number in parentheses before the data is the card number (not the resource number).

The following hotspots replace part of the image (in this case <417 260 544 333>) with part of another image (in this case 3004 <0 0 127 73>) based on a variable (103 2 plays in here somewhere):

8 1 < 31 276 163 333> 0 FFFF 0 103 2 3006 <0 0 132 57> 3005 FFFF
8 1 <417 260 544 333> 0 FFFF 0 103 2 3004 <0 0 127 73> 3003 FFFF

Case studies from Channelwood:

(CHANNEL 3001) 2
1 2   <1 0 110 332> 3002
2 2 <455 2 544 332> 3003
(CHANNEL 3002) 2
1 2   <0 1 100 332> 3005
2 2 <431 0 544 332> 3001
(CHANNEL 3003) 4
5 2 <213 90 343 290> 3494 2 [6 0 0] [24 0 1 {3494}] (the door)
1 2 <0 0 81 332> 3001 (left)
2 2 <463 0 544 332> 3005 (right)
8 1 <417 260 544 333> 0 FFFF 0 103 2 [3004 <0 0 127 73>] [3003 <FFFF>]
(CHANNEL 3005) 4
0 2 <76 152 196 330> 3012
1 2  <0   0 106 332> 3003
2 2 <438  0 544 332> 3002
8 1 <31 276 163 333> 0 FFFF 0 103 2 [3006 <0 0 132 57>] [3005 <FFFF>]
(CHANNEL 3012) 8
8 3 <101 243 214 343> 0 FFFF 1 5 (1 [3 103 1 {802}]) 103 2 [3013 <0 0 113 100>] [3012 <FFFF>]
5 2 <255 193 269 208> 0 1 [117 0 1 {0}]
5 2 <268 193 282 208> 0 1 [117 0 1 {1}]
5 2 <281 193 295 208> 0 1 [117 0 1 {2}]
5 2 <294 193 308 208> 0 1 [117 0 1 {3}]
8 1 <252 190 310 210> 0 FFFF 0 17 4 [3008 <0 0 58 20>] [3009 <0 0 58 20>] [3010 <0 0 58 20>] [3011 <0 0 58 20>]
0 4 <180 31 379 305> 0
5 2 <0 0 544 332> 0 1 [34 0 2 {3005 0}]
(MYST 4368) 3
8 3 <305 148 375 238> 0 FFFF 1 5 (1 [3 103 1 {802}]) 103 2 [FFFF <FFFF>] [4369 <0 0 70 90>]
7 2 <216 110 304 235> 0 106 5
  5 (1 [115 101 3 {4741 4370 4368}])
  5 (1 [115 101 3 {4741 4370 4368}])
  5 (1 [115 101 3 {4741 4370 4368}])
  5 (1 [115 101 3 {4741 4370 4368}])
  5 (0)
0 2 <0 0 544 332> 4345

Intro Case Study

(INTRO 1) 1
0 2 <-32000 -32000 32000 32000> 5

INTRO 1 is supposed to be the card which shows the opening movies and then switches to card 2.

(INTRO 2) 1
5 2 <245 202 304 253> 4 2 [37 0 0] [34 0 2 {3 11}]

INTRO 2 is the first interactive part of the game, the part where you can pick up the Myst book. The rect correctly corresponds to where the book is on screen. But, look at the "destination" -- 4. There is no VIEW/RLST 4! However, there is a WDIB 4 and it is the open book with the water. Where this should go is to card 3 and show the Myst book cover before showing image 4 and then playing the video. And, there is a 3 in this chunk, but I'm not sure if that's the purpose. I have no idea what commands 37/34 could be. There is a WDIB 11, but it's of D'ni, so I doubt it's that. ;)

(INTRO 3) 2
0 2 <-32000 -32000 32000 32000> 5
6 0 <312 70 441 159> 0 0 "\qtw\intro\intro2" 0x2848 0x2756 0 1 0 0 0

Note that this one has a string for the video (null-terminated). This obviously calls that video which is the Myst fly-by for the linking book. And, that rect perfectly matches where the video should be displayed on screen. However, this also clearly breaks the format specified above for "type 2 hotspots".

WDIB 3 is the cover of the Myst linking book. But, this doesn't match up with the video mentioned here which should be for WDIB 4 (or 10, they are identical)(the open linking book with the water image) and eventually ending at WDIB 12 (the open linking book with the dock image). The 5 after the very large numbers is the target card for the open linking book which seems correct. 0x2848 is 10,312 and 0x2756 is 10,070. The rate of the audio is 11,025. Not sure if this has any correlation.