Riven engine overview
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)
- ospit (Gehn's office)
- pspit (prison island)
- gspit (garden island)
- rspit (rebel age)
- tspit (temple island).
- t_Data.mhk (Riven 5CD)
- t_Data1.mhk, t_Data2.mhk (Riven DVD)
- jspit (jungle island)
- bspit (boiler island)
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|