Skip to content

MSX2DAAD Wiki: Understanding DSF file format

nataliapc edited this page Dec 14, 2019 · 9 revisions

Go back to Index


Index


What is a DSF file

A DSF file is the source where we create our adventure before the creation of the final DDB compiled database. Is used by the new DRC compiler.

Basically a DSF (and the resulting DDB) file is a database containing the messages, vocabulary, and actions that compound our adventure, also the orders "tree" to manage game action.

DAAD works by writing in a DSF text file the adventure in a format of condacts very similar to PAWS, although without some of its automatic mechanisms (leaving in the author hands to reproduce them on their own and adding a larger dose of "freedom" in exchange for "greater effort").

This file is processed through a compiler, executed from command line, and is transformed into a DDB database that, depending on the parameters used, would be specific to each of the different platforms supported (ZX, CPC, MSX, etc...).

The DDB database would be copied to a compliant disk where it must be interpreted by an executable program, defined as "interpreter", also specific to each system to produce the final adventure game.


Editors and Charset encoding

The DSF files must encoded with Windows-1252 or ISO-8859-1 encoding charset.

With a Windows system you should not have any problem with this since these encodings are used natively.

Is you use other operating systems (UTF-8 based for example), you must use an editor that allows you to change the encoding to one of those named above.

You can use EAAD that is a text editor specially created to edit DAAD adventures.

You can also use editors like VS Codium that has a nice plugin for highlightning DSF syntax.


The main sections

DSF files are divided into several sections, and each has a very precise purpose:


/CTL

The control section. You don't need to change anything here.


/VOC

The vocabulary section.

Here you define the words that your adventure will understand. There are several rules in this section as:

  • Movement verbs must be numbered below or equal to 14.
  • Nouns below or equal to 20 can be used like verbs (ex: DROP).
  • Take care about DAAD only recognize the first 5 characters of a word, so ICONIZE and ICONIC are the same word for DAAD.

The format to create a new vocabulary entry is:

<word> <number assigned> <type>

Where <word> is the new word added, <id number> is his word ID, and <type> is the word type. Example:

TABLE 20 noun
FLY 12 verb

Word with same id and type are synonyms.


/STX

The system messages section.

Here you can see the predefined system messages that DAAD internally use.

You can modify them if needed but usually is not needed. To modify them you need to know exactly when is printed each message. You can read about this at the original DAAD manual.

/16 "Press any key to continue.#n"

These kind of messages can be shown using the condact SYSMESS:

SYSMESS 16


/MTX

The user messages section.

At this section you can create yours own custom messages like:

/0 "You jump the crevice and now you are at the other side."

These messages can be shown using the MES or MESSAGE condacts:

MESSAGE 0

Using DRC you have an aditional way to show messages in /PRO sections that is not possible using the classic compiler:

MESSAGE "You jump the crevice and..." MES "This text is without carriage."

This way to write user messages automatically create an entry in the /MTX section and replace the text by their numeric index.


/OTX

The objects description messages section:

Here you can describe the objects inside your adventure. These texts are shown by the LISTAT condact. An example could be:

/0 "a big and red key"

It is desirable that the descriptions starts with the article 'a' ('un/a' in spanish) to help the interpreter internally make the necessary changes in the description if needed.


/LTX

The location texts section.

Here you can define what the player can read at each location of your adventure.

/2 "You are in a clearing where you can see a large stone slab with..."

If you use the DSF template you don't need to worry about how to show these descriptions, but you can display a concrete location text using the condact DESC.


/CON

The connections section.

At this time you can define how the player can move from a location to another. The format is:

/1
N 2
E 3

This means that if the player are at location 1 there are 2 connections: NORTH to location 2 and EAST to location 3.

Each location must be defined here even if it has no connections.


/OBJ

The object attributes section.

This could be the more complex section until here. Every object must be here and defined his behavior and attributes.

An object can be defined like:

;obj  starts  weight    c w  5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0    noun   adjective
;num    at
/0    CARRIED   1       _ _  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _    TORCH  _
  • obj num is the object index and must coincide with the /OTX section.
  • starts at is the location where the object is placed. There are special places like: CARRIED, WORN and NOT_CREATED.
  • weight is used to known if you can carry it due to its weight.
  • c denotes if the object can be carried.
  • w denotes if the object can be weared.
  • attr: 16 user custom attributes can denote if a object can be drunk, is poisonous, etc. It's your choice to defined them or not.
  • noun is the vocabulary word to define this object.
  • adjective is optional, and can be use to differentiate several objects with the same name.

/PRO

The processes section.

Here starts the adventure itself, the processes, entries and condacts to create it.

Each process have a funcion and you surely just need to modify or add things to /PRO 5.

Now let's define what each process does:

/PRO 0

Is the game main loop, where the the location picture and description is shown.

/PRO 1

Read user sentences from the keyboard and move the user location if requested.

/PRO 2

Write the system message "I didn't understand" when an unknown sentence is found or if the input timeout is reached.

/PRO 3

Is called after the localization player is changed. Can be used to add conditional text descriptions to the location texts after them.

At the template, if not dark, enumerate the objects at current location.

/PRO 4

Is called after each turn or player action.

/PRO 5

This is the most important process: the sentences table.

Each sentence the player can or must use is defined here. Several examples can be:

> EAT    APPLE    AT      1
                  PRESENT  objAPPLE
                  MESSAGE "It tastes so good!"
                  PLACE    objAPPLE    NOT_CREATED
                  DONE

Above code is equivalent to this pseudo-code:

IF ORDER="EAT APPLE" AND
   PLAYER is_at_location 1 AND
   objApple = currentLocation OR carried
THEN
   PRINT "It tastes so good!"
   objApple = notCreated
ENDIF

If player write "EAT APPLE", and the current location is 1, and the objAPPLE is CARRIED then the message is printed and objAPPLE is placed like NOT_CREATED and disappears from the inventory.

If any condition fails (AT or CARRIED) the EAT APPLE entry stops and try to execute the next one.

You can read more about all the existing contacts in the wiki section about them.

/PRO 6

This process initialize the DAAD system: the game resets the windows, the flags, and show the presentation text if any.


/END

This denotes the end of the DSF file.

Clone this wiki locally