2.0 DXW Reference – WORLD structure and attributes

At a first glance, a game for DimensioneX is described by a single .DXW file, coded according to a well-defined format. The structure and the syntax of the file is described by this and the following sections.  DXW files can, however, be created from multiple DXW-formatted files by use of the Include statement.  More on the Include statement below.

The game is also made complete by a set of multimedia files (pictures and sound files) that you will have to provide unless you want to develop a text-only multiplayer adventure.

 

2.1      Structure of the .DXW files

Each game environment is described in a DXW file, which is actually a text file formatted using a well defined syntax. In this section we describe the DXW file structure.

A file for DimensioneX, say “world.dxw” is structured as follows:

 

WORLD

NAME              world_name

IMAGESFOLDER      http://www.dimensionex.net/pics/

‘ – or – at your choice (this is a comment by the way)

IMAGESFOLDER_LOCAL      http://localhost:8080/pics/

IMAGESFOLDER_PUBLIC     http://mywebsite.com/pics/

 

[ ENCODING        ANSI ]

[ VERSION         1.0 ]

[ AUTHOR          Your Name Here ]

[ AUTHOREMAIL     name@domain.net ]

[ SITE            http://www.yourdomain.tld/sitename ]

[ HELP            http://www.yourdomain.tld/help_page.htm ]

[ COUNTERHTML     html_code_here ]

[ INTERPHONE      level ]

[ SAVEGAME_PERSISTENCE  2 ]

[ MUTING          1 ]

[ CLUSTER         clusterid ]

[ CUSTCMDPROC     custom.command.processor.classname ]

 

[IncludeYourLibraryFile.dxl” ]

 

[GUI section]

[ROOMS section]

[LINKS section]

[CHARACTERS section]

[ITEMS section]

[SETS section]

[SCRIPTS section]

 

END_WORLD

 

  • The square brackets [ ] indicate optional elements.
  • The file is structured in a single big WORLD definition, which containes a few attributes (most of which are optional) and seven optional subsections: GUI, ROOMS, LINKS, CHARACTERS, ITEMS, SETS, SCRIPTS.
  • Each section has a closing keyword (END_GUI, END_ROOMS, END_LINKS, etc)
  • Each section inside WORLD is optional
  • Text beginning with a quote (‘) is a comment and is ignored by the parser.

 

 

2.2      WORLD

The WORLD object represents the whole game environment.

 

Here is the syntax for its definition, with sample values. Square brackets indicate optional items. The attributes below can appear in any order.

All attributes are optional, as defaults are defined for each one of them, but without specifying at least the IMAGESFOLDER attribute, your game will not look properly.

 

WORLD.Attribute Meaning and values
NAME Game title. Serves as a world ID.
IMAGESFOLDER

URL of the folder where most of the game’s images and media files are contained.

This setting applies whatever serverType setting you have in the worldnav##.properties file.

Important: Do specify a final slash and do not use DOS-like backslashes (“\”).

 

All the images used by your game are generally kept in one single folder which will be hosted on a web space. The most performing solution would be to separate the multimedia content web server and the game server, so CPU and bandwidth is not wasted for transferring images and allows quick management of the game. However, see the “documentation” section on the DimensioneX site to learn more about where to host multimedia content of your game (there’s a knowledge base article on this topic).

IMAGESFOLDER_PUBLIC

URL of the folder where most of the game’s images and media files are contained when the game will be published to public.

This setting applies (and has priority over IMAGESFOLDER) only if you have set serverType=public in the worldnav##.properties file.

IMAGESFOLDER_LOCAL

URL of the folder where most of the game’s images and media files are contained when the game is being tested on local computer.

This setting applies (and has priority over IMAGESFOLDER) only if you have set serverType=local in the worldnav##.properties file.

ENCODING

(Optional) Specifies which encoding format has been used for this source file. This is important for rendering local (non-US) charsets correctly.

Acepted values are: UTF-8 or ANSI

The default value will be UTF-8.

VERSION (Optional) Version of this game. Do not confuse it with the DimensioneX version, which is completely other thing.
AUTHOR (Optional) Author’s name for this game
AUTHOREMAIL (Optional) Author’s e-mail
SITE (Optional) URL of the official game site
HELP (Optional) URL of the file to be linked to the “Help” button. So, each game can have its own help system.
COUNTERHTML (Optional) HTML string to allow the insertion of a counter. Get a free counter from a web service provider and then paste here the provided code so you can autonomously track usage of your game.
INTERPHONE

(Optional) level can be 0, 1 or 2

0 = speech is heard only within the same room

1 = (default) speech is heard word-wide but vehicle/item provide privacy

2 = speech is heard world-wide

SAVEGAME_PERSISTENCE

(Optional) 0 to 2.

Specifies the persistence level of saved games.

0 = Saved game is canceled when game is restarted

1 = Saved game is canceled when game version changes

2 = Saved game is always valid (default)

CLUSTER

(Optional) specifies that the world belongs to a cluster with the specified ID.

This is used to make WORLDs to act as areas of bigger, multi-area games.

 

clusterid can be any valid identifier

MUTING

Specifies the level of the MUTING system. Available values are:

0 = No muting at all

1 = Basic – Each time a stopword is used in speech, the speech is censored, but the player is allowed to speak immediately after

2 = Normal (default) – The first time a stopword is used in speech, the player is muted for 1 minute, then allowed to speak again.

3 = Cumulative – Each time a stopword is used in speech, the player is muted for 1 minute. This penalizes repeated attempts to break the system

INCLUDE

Specify another DXW-formatted textfile to be Included or inserted as part of this world definition.  These files are considered to be reusable “library” files and often use a .DXL extension.  The filename must be enclosed in quotes and can be either an absolute URL (eg. http://www.myserver.com/folder/file.ext) or a relative path.  In this case, the path is intended to be relative to the folder containing the main DXW source code.  Includes can be used in ALL areas of the DXW file.

Some examples:

Include "MyWorld_Rooms.dxl"

Include "MyWorld_Items.dxl"

Include "MyWorld_Characters.dxl"

Included files can contain other Include statements.  Beware not to generate infinite include recursion!

CUSTCMDPROC The game engine has certain Java hooks that allow Java developers to extend or bypass normal game processing.  Interfaces available for such processing can generally be found in the org.dimx package of the distribution.  Early examples of available hook points are the ISayProcessor for extending default handling of the SAY command and the IWorldInitProcessor allowing custom processors to include themselves in pre- and post- World initialization.

 

2.3 GUI section
1.4 Developing a game

Leave a Reply

Your email address will not be published. Required fields are marked *