OAR Format 1.0

From OpenSimulator

Revision as of 12:31, 23 April 2013 by Justincc (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

What is the OAR 1.0 format?

Changes

This format was introduced in OpenSimulator 0.7.5. This is the first version of the OAR format which supports storing multiple regions in a single OAR. However, it is not backwards compatible with versions of OpenSimulator before 0.7.5 which is why it has a new major version number. It is not currently the default save format.

Apart from the additional regions/ directory structure for storing multiple OARs and additions to archive.xml, the other parts of this format are idential to OAR format 0.8.

Detail

An OAR file is a gzipped tar file (tar.gz) in the the original unix tar format (not USTAR). This can be extracted and created with standard tools (7-zip on Windows). The file can contain multiple regions. The structure of the archive is as follows (this example contains 4 regions):

archive.xml
assets/
regions/
  1_1_Arizona/
    landdata/
    objects/
    settings/
    terrain/
  2_1_New_Mexico/
    landdata/
    objects/
    settings/
    terrain/
  1_2_Utah/
    landdata/
    objects/
    settings/
    terrain/
  2_2_Colorado/
    landdata/
    objects/
    settings/
    terrain/

The regions' directory names include the region's location (relative to the root region) in order to ensure uniqueness even if regions have duplicate names.

archive.xml

This is the archive control file. It contains a major and minor version number, to allow compatibility with future format changes.

The boolean element <assets_included> specifies whether the OAR contains assets. If the value is True then the OAR was saved with assets included. If the value is False then the OAR was saved with the --noassets option.

The control file contains a manifest of the included regions. The list of regions always describes a rectangle, with the root region (the region where the "save-oar" command was run) in the SW corner. The regions are listed in the following order: rows from South to North, and within each row regions are listed West-to-East. Missing regions are supported: they're represented by empty elements.

For example:

<?xml version="1.0" encoding="utf-16"?>
<archive major_version="1" minor_version="0">
  <creation_info>
    <datetime>1343204139</datetime>
  </creation_info>
  <assets_included>True</assets_included>
  <regions>
    <row>
      <region>
        <id>12345678-1111-1111-1111-111111111111</id>
        <dir>1_1_Arizona</dir>
        <is_megaregion>False</is_megaregion>
        <size_in_meters>256,256</size_in_meters>
      </region>
      <region>
        <id>12345678-2222-2222-2222-222222222222</id>
        <dir>2_1_New_Mexico</dir>
        <is_megaregion>False</is_megaregion>
        <size_in_meters>256,256</size_in_meters>
      </region>
    </row>
    <row>
      <region>
        <id>12345678-3333-3333-3333-333333333333</id>
        <dir>1_2_Utah</dir>
        <is_megaregion>False</is_megaregion>
        <size_in_meters>256,256</size_in_meters>
      </region>
      <region>
        <id>12345678-4444-4444-4444-444444444444</id>
        <dir>2_2_Colorado</dir>
        <is_megaregion>False</is_megaregion>
        <size_in_meters>256,256</size_in_meters>
      </region>
    </row>
  </regions>
</archive>

assets/

This directory contains all the assets in the archive. The assets for all the regions are stored in the same directory because assets are often shared. Each filename has the following format

<uuid>_<asset type>.<asset extension>

The uuid section must always be present and form a valid uuid - it is used directly as the uuid for that asset. The asset type and asset extension are used to identify the type of asset and the asset extension allows the asset to be associated with different editors on platforms such as Windows. For instance, a script will always have the asset type and extension script.lsl. A full list of asset types and extensions can be found in the file

OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs

in the OpenSimulator distribution.

In the future, the format of these files will be described in Asset Formats.

landdata/

This directory contains all the parcels in the region. Information for each parcel is stored in a separate file in XML format. Each filename has the form:

 <uuid>.xml

where uuid is the uuid of the parcel.

objects/

Each individual file in here is an object in the region (where an object [linkset] can be composed of many prims). The file format used is OpenSim's XML2 format. Each filename has the following structure by default

<Object name>_<x>-<y>-<z>__<uuid>.xml

Unlike asset filenames, any component of this name can be changed without affecting any attributes of the object itself - this information is taken from the xml instead. Indeed, this file can have any name - there is no need for any of the sections to be present. An example object file name is

Primitive_154-121-062__9be68fdd-f740-4a0f-9675-dfbbb536b946.xml

The actual format is described (currently very sketchily) in Asset Formats.

settings/

This contains the region settings information for the region in XML format. The filename will be the same as the region name. For example,

OpenSimulator Test.xml

See an example of an XML region settings file below.

terrains/

This contains the terrain file for the region, stored in RAW format. The filename must end with .r32. For example,

OpenSimulator Test.r32
Personal tools
General
About This Wiki