Difference between revisions of "Myst VIEW resources"

From A look inside The Link @ wiki
Jump to: navigation, search
(Conditional Images: observation)
(forgot that)
 
(17 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{Myst}}
 
{{Myst}}
  
VIEW resources are the candidate Myst card representations, as they seem to glue other resources together like WDIB and MSND. In particular they seem to describe what to show on screen and what sound to play.
+
VIEW resources are the candidate Myst card representations, as they glue other resources together. In particular they seem to describe what to show on screen, what sound to play and where to find additional data about the card.
  
 
Original hints by Petroff Heroj.
 
Original hints by Petroff Heroj.
  
= Basic Format =
+
=Basic Format=
The data seems split into four sections with different meanings: conditional images, main section and two unknown sections.
+
The data is split into five sections with variable size and different meanings:
 +
*card flags
 +
*pictures
 +
*sounds
 +
*element list
 +
*other resources
  
== Conditional Images ==
+
==Card flags==
The first section seems to provide lists of pictures, and the value of specified variables should define which pictures to show.
+
This is just
 
{| class="structure"
 
{| class="structure"
|unsigned short||u0
+
|unsigned short||card_flags
 +
|}
 +
''card_flags'' seems either 0 or 1. It's 0 for regular cards, while 1 is suspected to disable game saving in that card.
 +
 
 +
==Picture section==
 +
This section defines the card background picture, which may be static or dependent on the values of variables. The section starts with
 +
{| class="structure"
 +
|unsigned short||count
 +
|}
 +
If ''count'' = 0 then there is a single, static background picture and the whole section reduces to
 +
{| class="structure"
 +
|unsigned short||count = 0
 
|-
 
|-
|unsigned short||image_count
+
|unsigned short||picture_id
 +
|}
 +
where ''picture_id'' is the WDIB (or PICT) resource ID.
 +
 
 +
Otherwise, if ''count'' > 0, the section contains ''count'' conditional blocks:
 +
{| class="structure"
 +
|unsigned short||count
 
|-
 
|-
|variable||conditional_images
+
|variable||conditional blocks
 
|}
 
|}
*''u0'' is unknown (always either ''0'' or ''1'').
+
Each conditional block associates a variable with an array of picture IDs:
*''image_count'' is the number of conditional image blocks (always either ''0'' or ''1'').
+
*''conditional_images'' are the conditional image blocks.
+
The image blocks have the following structure:
+
 
{| class="structure"
 
{| class="structure"
 
|unsigned short||variable
 
|unsigned short||variable
 
|-
 
|-
|unsigned short||num_states
+
|unsigned short||id_count
 
|-
 
|-
|unsigned short||image_ids[num_states]
+
|short||picture_ids[id_count]
 
|}
 
|}
*''variable'' is the variable to check against.
+
The card will use the value of the specified variable to index the ID array and display that picture.
*''image_ids'' is an array of ''num_states'' unsigned shorts representing WDIB (or PICT) IDs.
+
 
The variable value is the index of what image to use in the ''image_ids'' array.
+
==Sound section==
 +
This section specifies ambient sounds for the card. It uses a basic "command" mechanism to continue with the already playing sound, alter it or start a different one.
  
== Main Segment ==
 
The main section seems to provide basic info about the card:
 
 
{| class="structure"
 
{| class="structure"
|unsigned short||main_image
+
|short||sound
|-
+
|signed short||sound
+
|-
+
|unsigned short||flags
+
 
|}
 
|}
*''main_image'' is the main image to show on the screen. (Kind of like the default case).
 
*''sound'' is the sound id to play. If it is less than 0, it acts like a flag to pause, continue sound (-1?), or stop the current sound (what means what still needs to be checked).
 
*''flags'' appears to be flags.
 
  
== Unknown Segment ==
+
If ''sound'' is -1 or -3, the section stops here.
TODO: I haven't completely figured this out. Petroff's guess was that it preloaded resources. However, it doesn't make sense that it is like that. It starts with an unsigned short representing the count. Then, following that is an unsigned short (which he believed to be the resource type to load). If it was 3 then there would be an array of WDIB's (an array of unsigned shorts, starting with a count and an unknown -- each unsigned shorts). A 1 would mean a single WDIB, a 2 would mean a single MSND (each represented by an unsigned short).
+
*-1 seems to continue with the current sound.
 +
*-3 seems to stop the current sound at all (mute).
  
== More Unknown ==
+
If ''sound'' is not negative or -2, the section includes a second field:
Following that is four unsigned shorts. Petroff's guess was that they represented RLST, HINT, EXIT, and INIT respectively. But, that doesn't line up with the resources that exist in the files. More likely, those resources are dependent upon the card id.
+
{| class="structure"
 
+
|short||sound
= Old Case Studies =
+
image name and sub-images (akin to Riven PLSTs)
+
{| cellpadding=2 style="border:1px #000 solid;border-collapse:collapse;text-align:center;"
+
|0||0||3001||-1||0/0||3001||3001||0||0
+
 
|-
 
|-
| || ||name||neg.||bytes||colspan=4|(name name 0 0)
+
|unsigned short||volume
 
|}
 
|}
 +
A positive ''sound'' stops the currently running sound and starts the given one, while -2 seems to continue with the currently running sound, but different ''volume''.
  
{| cellpadding=2 style="border:1px #000 solid;border-collapse:collapse;text-align:center;"
+
Finally, if ''sound'' is -4, there is a conditional block similar to those in the picture section:
|0||0||3002||-2||0/144||0|| ||3002||3002||0||0
+
{| class="structure"
 +
|short||sound = -4
 
|-
 
|-
|0||0||3003||-2||0/144||1||[1 3004]||3003||3003||0||0
+
|unsigned short||variable
 
|-
 
|-
| || ||name||?|| ||count||entry||colspan=4|(name name 0 0)
+
|unsigned short||count
|}
+
 
+
*I think ''3004'' is the name of a sub-image (small image to be placed in another) of ''3003'' here.
+
{| cellpadding=2 style="border:1px #000 solid;border-collapse:collapse;text-align:center;"
+
|0||0||3005||3005||0/144||1||[1 3006]||3005||3005||0||0
+
 
|-
 
|-
| || ||colspan=2|name twice|| || ||colspan=4|(name name 0 0)
+
|variable||sound specifications
 
|}
 
|}
 +
Each sound specification is a single short, followed by a second one if it's not negative or -2, similarly to what happens for the first field of the section. This probably chooses the sound/volume combination based on the given variable.
  
{| cellpadding=2 style="border:1px #000 solid;border-collapse:collapse;text-align:center;"
+
==Element list==
|0||0||3012||-2||0/50||5||[1 3013]||[1 3008]||[1 3009]||[1 3010]||[1 3011]||3012||0||0||3012
+
This section seems to list elements (pictures, sounds) available to the card. It is suspected that those elements can then be activated by scripts.
 +
{| class="structure"
 +
|unsigned short||count
 
|-
 
|-
| || ||name||?|| ||count||colspan=5|entries||colspan=4|(name 0 0 name)
+
|variable||element specifications
 
|}
 
|}
 
+
Each specification begins with an unsigned short ''type'' describing what the element is.
{| cellpadding=2 style="border:1px #000 solid;border-collapse:collapse;text-align:center;"
+
*Type 1 is a picture (WDIB or PICT). Resource ID follows.
!14
+
*Type 2 is a sound (MSND). Resource ID follows.
|1||1||5||2||3030||3031||FFFC 3 2 3031 00_A0||4031||x00A0||2||2 4030||1 3030|| || ||3031||3031||0||0
+
*Type 3 is a conditional block associating a variable with an ID array. This structure follows:
 +
{| class="structure"
 +
|unsigned short||variable
 
|-
 
|-
!44
+
|unsigned short||id_count
|1||1||2||2||3095||3096||FFFC 15 2 3095 00_A0||4095||x00A0||4||2 4095||1 3562||1 3097||2 5095||3095||3095||3095||0
+
 
|-
 
|-
!348
+
|unsigned short||u0
|1||1||16||2||3536||3535|| ||3535||x0060||0|| || || || ||3535||3535||0||0
+
|-
+
!359
+
|1||1||5||2||3550||3552||FFFC 3 2 6552 00_80||3552||x0080||4||4 3550||4 3552||2 4552||2 5552||3552||3552||0||0
+
 
|-
 
|-
!47
+
|short||ids[id_count]
|1||1||10||2||4140||4141|| ||5141||x0090||1||2 4141|| || || ||4141||4141||4141||4141
+
|}
|-
+
The variable value is used to index the ID array. IDs can be -1, probably meaning that nothing should be done in that case.
!50
+
*Type 4 seems to refer to pictures, since a WDIB ID follows.
|1||1||10||2||4148||4149|| ||4149||x0090||0|| || || || ||4149||4149||4149||0
+
*Type 5 seems to refer to sounds, since a MSND ID follows.
|-
+
 
!51
+
==Other resources==
|1||1||10||2||4150||4151|| ||FFFE||x0070||0|| || || || ||4150||4150||0||0
+
The final section points to associated resources that further describe the card, namely RLST, HINT, INIT and EXIT:
|-
+
{| class="structure"
!94
+
|unsigned short||rlst_id
|1||1||10||2||4243||4244|| ||4244||x0050||0|| || || || ||4244||4244||0||0
+
|-
+
!116
+
|1||1||40||2||4292||4294||FFFC 40 2 4292 00_50||4292||x0060||2||1 4293||2 5292|| || ||4292||4292||0||0
+
 
|-
 
|-
!145
+
|unsigned short||hint_id
|1||1||0||2||4358||4357|| ||FFFE||x0030||0|| || || || ||4357||4357||0||0
+
 
|-
 
|-
!287
+
|unsigned short||init_id
|1||1||34||3||4698||4701|| ||4702||xFFFD||4||1 4699||2 4698||2 5698||2 6698||4698||4698||4698||4698
+
 
|-
 
|-
!295
+
|unsigned short||exit_id
|1||1||10||2||4717||4719|| ||4717||x0040||1||1 4718|| || || ||4717||4717||0||0
+
 
|}
 
|}
 +
These values can be zero, indicating that the corresponding resource does not exist (i.e. a card might not have an associated HINT). It happens that all the IDs match the VIEW ID when they are not zero. Furthermore, ''rlst_id'' is always set: no cards exist without hotspot descriptions.

Latest revision as of 14:10, 3 November 2008

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

VIEW resources are the candidate Myst card representations, as they glue other resources together. In particular they seem to describe what to show on screen, what sound to play and where to find additional data about the card.

Original hints by Petroff Heroj.

Basic Format

The data is split into five sections with variable size and different meanings:

  • card flags
  • pictures
  • sounds
  • element list
  • other resources

Card flags

This is just

unsigned short card_flags

card_flags seems either 0 or 1. It's 0 for regular cards, while 1 is suspected to disable game saving in that card.

Picture section

This section defines the card background picture, which may be static or dependent on the values of variables. The section starts with

unsigned short count

If count = 0 then there is a single, static background picture and the whole section reduces to

unsigned short count = 0
unsigned short picture_id

where picture_id is the WDIB (or PICT) resource ID.

Otherwise, if count > 0, the section contains count conditional blocks:

unsigned short count
variable conditional blocks

Each conditional block associates a variable with an array of picture IDs:

unsigned short variable
unsigned short id_count
short picture_ids[id_count]

The card will use the value of the specified variable to index the ID array and display that picture.

Sound section

This section specifies ambient sounds for the card. It uses a basic "command" mechanism to continue with the already playing sound, alter it or start a different one.

short sound

If sound is -1 or -3, the section stops here.

  • -1 seems to continue with the current sound.
  • -3 seems to stop the current sound at all (mute).

If sound is not negative or -2, the section includes a second field:

short sound
unsigned short volume

A positive sound stops the currently running sound and starts the given one, while -2 seems to continue with the currently running sound, but different volume.

Finally, if sound is -4, there is a conditional block similar to those in the picture section:

short sound = -4
unsigned short variable
unsigned short count
variable sound specifications

Each sound specification is a single short, followed by a second one if it's not negative or -2, similarly to what happens for the first field of the section. This probably chooses the sound/volume combination based on the given variable.

Element list

This section seems to list elements (pictures, sounds) available to the card. It is suspected that those elements can then be activated by scripts.

unsigned short count
variable element specifications

Each specification begins with an unsigned short type describing what the element is.

  • Type 1 is a picture (WDIB or PICT). Resource ID follows.
  • Type 2 is a sound (MSND). Resource ID follows.
  • Type 3 is a conditional block associating a variable with an ID array. This structure follows:
unsigned short variable
unsigned short id_count
unsigned short u0
short ids[id_count]

The variable value is used to index the ID array. IDs can be -1, probably meaning that nothing should be done in that case.

  • Type 4 seems to refer to pictures, since a WDIB ID follows.
  • Type 5 seems to refer to sounds, since a MSND ID follows.

Other resources

The final section points to associated resources that further describe the card, namely RLST, HINT, INIT and EXIT:

unsigned short rlst_id
unsigned short hint_id
unsigned short init_id
unsigned short exit_id

These values can be zero, indicating that the corresponding resource does not exist (i.e. a card might not have an associated HINT). It happens that all the IDs match the VIEW ID when they are not zero. Furthermore, rlst_id is always set: no cards exist without hotspot descriptions.