Riven engine overview

From A look inside The Link @ wiki
Revision as of 00:06, 13 February 2008 by Di gama (Talk | contribs)

Jump to: navigation, search

A Riven scenario is made of virtual objects called stacks and each stack is a list of virtual objects called cards. This may remember HyperCard: it's the same approach. Each card has an associated script, a sequence of commands to be executed in response of events happening to the card (for example, card creation). The player interacts with the game by means of invisible buttons, placed within cards and called hotspots. Hotspots have associated scripts too, responding to events different than cards (for example, mouse clicks). Within cards can also be placed bitmaps and movies. Finally, sounds can be played.

Riven stacks are named

  • aspit (main menu, books, setup screens)
    • a_Data.mhk
    • a_Sounds.mhk
  • ospit (Gehn's office)
    • o_Data.mhk
    • o_Sounds.mhk
  • pspit (prison island)
    • p_Data.mhk
    • p_Sounds.mhk
  • gspit (garden island)
    • g_Data.mhk
    • g_Sounds.mhk
  • rspit (rebel age)
    • r_Data.mhk
    • r_Sounds.mhk
  • tspit (temple island).
    • t_Data.mhk (Riven 5CD)
    • t_Data1.mhk, t_Data2.mhk (Riven DVD)
    • t_Sounds.mhk
  • jspit (jungle island)
    • j_Data1.mhk
    • j_Data2.mhk
    • j_Sounds.mhk
  • bspit (boiler island)
    • b_Data.mhk
    • b_Sounds.mhk

Physically, a stack is described by a set of data blocks called resources. Resources are identified by a 4-char type and an integer ID. Optionally they can also have a name, but it seems completely ignored by the engine. The resource type tells what kind of data is stored in the resource; see the resource type list for types used in Riven.

Resources belonging to a certain stack are archived inside an arbitrary number of Mohawk files (listed above under their respective stacks). The file "riven.cfg" tells which files compose each stack by associating stack and file names.

Saved games are Mohawk archives too, and they contain additional resource types as described in the resource type list.

Notes on stack switching

The current stack can be changed from scripts using script command 27. For example, when the player activates a MagLev, first the car movie is played, and then command 27 is called to change the current stack to the new island. This command is also used in the "Play Riven" button. However, most linking books actually change stack simply by moving to another card which has no buttons and no scripts. Apparently, there is some hardcoded mechanism inside the engine which triggers the stack change when one of these "special" cards is entered. These cards are listed here.

Stack Card ID Target stack Target card
bspit 447 ospit 1
gspit 178 ospit 1
jspit 228 rspit 3
jspit 344 ospit 1
ospit 58 pspit 43
ospit 62 jspit 341
ospit 67 gspit 175
ospit 72 bspit 444
ospit 76 tspit 387
pspit 46 ospit 1
rspit 13 jspit 215
tspit 392 ospit 1