SubSim World XML Specifications Guide

This document provides an introduction to the SubSim World XML specification. The world describes the items that are simulated by SubSim. This includes environmental aspects such as the terrain, water, and visibility, as well as objects such as submarines and buoys.

The world is broken up into two aspects. The environment, and WorldObjects.

All files specified in the World XML file are relative the World XML files location.
SubSim specifies the y-axis as 'up', and the z-x plane as the 'ground'. Positional coordinates are specified in meters.

World Environment

The world environment consits of the overall physical simulation parameters, such as gravity and water, and terrain descriptions such as a pool.
The physical simulation parameters are described in a seperate XML file, and are only linked via a 'Physics' node.

Water

The water specification describes the visual appearance of the water surface. The water is simply a plane of a specified dimension (width and length), as well as a texture applied to the surface.

Water Example

< Water >
	< Dimensions width="25" length="50" />
	< Texture file="../resources/bitmaps/water.bmp" />
< /Water>

This creates a water surface of size 25x50 and draws the texture image in ../resources/bitmaps/water.bmp onto the plane.

Pool

A generic pool can be described via the pool node. The orientation and dimensions of the pool can be specified directly in the world XML file. The pool is constructed as a rectangular prism with a specifiable sized closed lower surface and open upper surface.

Pool Example

< Pool >
	< Origin x="0" y="1" z="0" / >
	< Dimensions width="25" length="50" depth="5" lengthdown="45" widthdown="20"/ >
	< Texture file="../resources/bitmaps/stone.bmp" / >
< /Pool >

This creates a pool where the open top is one meter above the surface of the water. The top of the pool measures 50x25 meters, and the bottom of the pool measures 45x20 meters. The pool is 5 meters deep.

Terrain

A height mapped terrain can be constructed from a source heightmap bitmap file. Each pixel in this bitmap will represent the height of the surface, with white being highest and black being lowest. The width and length of the terrain can be specified, as well as the depth of the heightmap values. (That is, depth XML value equals white). The origin of the terrain can also be specified, as well as a texture file to be drawn ontop of the heighmap.
The heightmap must be in greyscale, saved as a 24 bit image.

Heightmapped Terrain Example

< Terrain>
	< Origin x="0" y="-40" z="0" />
	< Dimensions width="500" length="500" depth="20" />
	< Heightmap file="../resources/bitmaps/heightmap.bmp" />
	< Texture file="../resources/bitmaps/mercury.bmp" />
< /Terrain>

This will construct a terrain covering 500x500 meters, with a maximum height of 20 meters, located 40 meters below the water surface. This means the terrain will range from 40 to 20 meters below the water surface.

More Information

More information on the heightmap description can be found here as part of the PAL documentation.