[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ] [ Search: ]

5.4.2 Format of Map File (XML)

This section describes the Crystal Space map, which uses XML, and is a companion to the XML schema file residing at:


This document is not yet complete but it should give you sufficient information to get started. For the format of the mesh object loaders you should look at the appropriate mesh object documentation (see section Mesh Object Plug-In System). There is also a HOWTO on loading a map file (see section Loading a Level) and a HOWTO with a simple map example (see section Simple Map Example).

The Crystal Space engine, itself, does not care about the external format of world data, nor does it care about how that information was obtained. It is possible to create additional map loaders as plug-in modules which understand world data stored in other formats, such as binary. A map loading plug-in module could even load maps over the network from a map file server, or generate worlds randomly based upon some set of input properties. There are many possibilities.

The map file syntax described in this section, however, is that which is understood by the standard map file loader which accompanies Crystal Space. It deals strictly with plain-text XML-format files.

Basic Structure

The basic structure of a map file for Crystal Space is as follows:

  initialization part:
    one texture specification section.
    one material specification section.
    one shader section.
    one sounds section.
    one variable section.
    one plugin section.
    one settings section.
    zero or more start locations.
    zero or more library specifications.
    zero or more keys.
  world elements:
    zero or more add-ons.
    zero or more mesh factories.
  world definition:
    zero or more sectors.
    zero or more collections.
  action section:
    one sequence section.
    one trigger section.

The structure above divides the world into roughly four sections. This is only a logical division for explanatory purposes; in reality there are no such divisions.

The initialization part contains everything that is related to setting up the map except for geometry-related data. The textures, materials, and other required parts are defined there.

The world elements section defines objects (mesh factories) and optional additional features (add-on's) which will be used throughout the actual world definition. Thus, geometry-templates are defined here, though instantiated later.

In the world definition section the actual geometry is defined. At the highest level you have sectors. In every sector the actual objects reside (see later for more information about this).

Finally there is the action section. In this section sequences and triggers are used to define interactions and other special actions on objects and other objects in the world.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated using texi2html 1.76.