This file is part of the TADS 2 Author’s Manual.
Copyright © 1987 - 2002 by Michael J. Roberts. All rights reserved.
Edited by NK Guy, tela design.


Chapter Eleven


Introduction to Multimedia TADS

 

What is Multimedia TADS?

Multimedia TADS is an extension of the TADS interpreter that allows a game author to use HTML markups to control the appearance of the game.

Multimedia TADS is simply a different user interface built on the standard TADS interpreter engine. You create a game for use with multimedia TADS in the same way as with the standard TADS; the only difference is that you can use HTML markups to format the text of your game.

Note that HTML TADS is the name of the Windows program which lets you play multimedia TADS games. Macintosh users can use HyperTADS, but at the time of writing there are no other multimedia TADS ports available for other operating systems. However, since HTML TADS was the first multimedia-enabled TADS interpreter you may see references to “HTML TADS” meaning the entire TADS multimedia system. Strictly speaking, however, HTML TADS refers to the specific Windows application.


What are some new Multimedia TADS features?

Multimedia TADS allows a TADS game to use many features that have not traditionally been available in text adventure systems:


What software do I need?

If you’ve installed the TADS Author’s Kit for Windows, you already have everything you need to create and run multimedia TADS games. If not, you’ll need the following software:

You might also want the HTML TADS Debugger (this currently is only available on 32-bit Windows platforms). You can still use the normal TADS debugger (version 2.2.5 or higher), but the normal debugger will not interpret HTML tags in the game display window; the Windows version is fully integrated with the HTML TADS interpreter, plus its user interface is improved over the DOS version.

Once you have the software you need, continue reading this manual for an introduction to using the HTML features in multimedia TADS. Since multimedia TADS is an extension to the normal TADS, you can use what you already know about TADS to write a multimedia TADS game - refer to the end of chapter 12 for information about how to convert an existing TADS game into a multimedia one. You may also want to get a book on HTML version 3.2, so that you can learn how to use HTML to format your game's display.


Compatibility between multimedia TADS and text-only TADS

Multimedia TADS is an extension of the standard TADS. The core language system is the same in both versions - the only difference is the way the two systems interpret and display text. Even though multimedia TADS uses a very different display system than text-only TADS, the two versions are highly compatible.

Playing text-only TADS games with multimedia-capable TADS interpreters: Multimedia TADS is fully compatible with games written for the standard TADS. Standard games will naturally not take full advantage of the HTML features, but Multimedia TADS interprets all of the standard TADS formatting codes correctly.

Playing HTML-enabled games with the text-only interpreter: Recent versions (2.2.4 or higher) of the standard TADS interpreter also provide a degree of compatibility with games written for multimedia TADS. Refer to appendix G for details.

You can also use multimedia TADS interpreters, such as HTML TADS and HyperTADS, to play a standard TADS game. Since all of the standard formatting sequences work in multimedia TADS, a standard game will play the same way it does on the normal interpreter. There are nice standard interpreter versions are available for most of the GUI platforms already, but you can use multimedia TADS this way if you want to.


Whither text-only TADS?

I don’t want to use terms like “old-style” to describe existing, non-multimedia TADS games, because multimedia TADS is just one variation of TADS. The standard text-only TADS will continue to exist, and some authors may choose to write new games using the standard TADS system. Multimedia TADS is not yet implemented on as many operating systems as the standard TADS interpreter, and probably won’t ever be as widely ported as the standard TADS interpreter due to its additional complexity. As a result, some authors will want to use the standard system so that their game can be played by more people.

I plan on continuing to support text-only TADS; fortunately, supporting both the multimedia and text-only versions will will involve very little additional work beyond only the multimedia version. Multimedia TADS uses exactly the same interpreter engine as text-only TADS; the only difference is in the user interface (text output) code. So, as changes are made to the TADS language and the interpreter system, they’ll more or less automatically show up at the same time in the text-only and multimedia versions of TADS. The only area that will probably receive less attention than it would have in the absence of multimedia TADS is in enhancing the standard TADS DOS interpreter environment’s user interface. However, because of the widespread deployment of the TADS interpreter, the user interface has been essentially frozen for several years anyway, so this isn’t really going to change anything.


Why HTML?

One of the main improvements that TADS authors have been requesting for some time is more control over formatting, ideally including support for graphics and sound. There are many ways I could have added these features, but the emergence of HTML as a ubiquitous text formatting language made it a clear choice.

HTML is a “markup language” that’s become widely used, thanks to the popularity of the World Wide Web. HTML documents are text files that have embedded “markups,” which are special sequences within the text that specify formatting commands. The language has been refined over several years based on the experiences and needs of a vast number of users, and it's proved to be very flexible and useful.

I chose HTML as the new formatting language for TADS because of these advantages. I didn’t want to invent a new markup language because, even though HTML isn’t perfect, it would be difficult to do so much better that it would justify the work of creating a new language and the cost to game authors of learning a new language.


Some Quick Examples

Here are some practical examples of how HTML markup works in a game. First, here’s how you’d display some text in a room description using bold italics:

   myRoom: room
     // ...
     ldesc = "Here's some text in <b><i>bold italics</b></i>! "
   ;

Here’s how to display some text in red italic letters that are slightly larger than the main text font size (the "+1" means one size larger than normal):

   warningSign: item
     // ...
     ldesc = "<font color=red size='+1'><i>Warning!!!></i></font> "
   ;

Here’s how to center-align some text:

   trespassSign: item
     // ..
     ldesc = "<center>
              <b>Warning!</b>\b
              Trespassers\n
              will be fed to\n
              dragon!\b
              </center> "
   ;

Some Common Tags

As we mentioned earlier, there are so many sources of HTML documentation that we won’t even try to provide a full tutorial on HTML here. However, to help get you started, here are a few simple tags that you might find handy:

<I> ... </I> - italics.

<B> ... </B> - boldface.

<U> ... </U> - underline.

<TT> ... </TT> - typewriter font. This uses a fixed-width font if one is available, which can be useful when you want columns of text to line up. (HTML offers much more sophisticated ways to align columns of text, including the <TAB> and <TABLE> tags, but for very simple cases it’s sometimes easier to use a fixed-width font.)

<CENTER> ... </CENTER> - center text.

<BLOCKQUOTE> ... </BLOCKQUOTE> - slightly indent both the left and right margins. This is usually used to display long passages of quoted material, but can be handy for simple formatting as well.

<SUP> ... </SUP> - display text as a superscript, in a smaller typeface and elevated slightly from the main text line.

<SUB> ... </SUB> - display text as a subscript, in a smaller typeface and lowered slightly from the main text line.

<FONT SIZE=n COLOR=c FACE=f> ... </FONT> - display text in a different size or color. For sizes, you can use 1 through 7; the default size is 3, and larger numbers indicate larger font sizes. You can't specify the exact point size because this varies according to user settings, so SIZE simply selects a relative font size.

For COLOR, you can specify a color name; some common color names are WHITE, BLACK, SILVER, GRAY, RED, BLUE, GREEN, YELLOW. You can also specify a hexadecimal RGB (reg-green-blue) value using notation such as ‘#FF0000’ (for maximum red, minimum green, minimum blue) or ‘#808080’ (half-intensity red, half-intensity green, half-intensity blue). You can also specify a typeface by name, but for portability, you should try to use one of the special TADS fonts, such as ‘TADS-Serif’ for a serifed font or ‘TADS-Sans’ for a sans-serif font, since the user can select what to display for each of these fonts. Note that you don’t have to specify all of these attributes with the <FONT> tag - if you only want to change the current text color but leave its size and typeface unchanged, include only the COLOR attribute in the tag.

<Q> ... </Q> - enclose text in quotation marks. Nested <Q> tags alternate between double quotes and single quotes, which is the normal typographical convention, and the open and close quotes will use typographical (“curly”) quotes on platforms that support them.

<BR> - line break: start a new line.

<HR> - horizontal rule: show a horizontal line. You can use this as a visual separator.

<IMG SRC='file.jpg'> - show an image from the file “file.jpg” (“.jpg” indicates a JPEG picture file, and “.png” indicates a PNG image file).

<SOUND SRC='file.wav'> - play a sound. This TADS extension to standard HTML is documented fully in the next chapter.

 


Chapter Ten Table of Contents Chapter Twelve