Wartbed:Files/Formats

From Dark Omen Wiki

< Wartbed:Files
Revision as of 23:34, 8 September 2008 by Mikademus (Talk | contribs)
Jump to: navigation, search

Description of WARTBED file formats.

Contents

Geometry

.ZIP archive with .model extension. Archive containing the following file types and extensions (can conatin any number of all file types except meshes.desc).

modelname.model
(.zip archive)
model.desc text (1)
filename.vertices text (2)
filename.indices text (3)
filename.bmp/jpg/png bitmap
filename.skeleton ???
filename.animation ???


Model description

1: meshes.desc
(text file)
Mesh_name

{
    vertices : filename.vertices;
    indices : filename.vertices;
    offset : [x,y,z];
}

Mesh_2_name
{
    ...

}


Vertices

Space, tab, '[', ']' and ',' are all valid separators and can be exchanged for reabability. Separators should be able to follow each other (cross your fingers).

The first block is identified by the keyword "definition" (of rather, any character sequence starting with "def") and details the components are their order in a vertex. Valid tokens are "xy" for a two-float dataype, "xyz" for a three-float , "xyzw" for a four-float; and "argb", "bgra" and "rgba" for four-byte colours.

Valid field names are "position", "normal", "diffuse", "specular", "emissive" and "texture coordinate". There can be multiple fields of the same type in a vertex, however, it is not yet defined how WARTBED handles this.

The second block is identified as "vertices" (or "vtx"). Every vertex is numbered (though item identifiers are actually ignored when parsing). Multiple vertex blocks are appended into one consecutive vertex buffer (regardless of vertex numbering).

2: filename.vertices
(text file)
definition

{
    xyz : position;
    xyz : normal;
    argb : diffuse;
    argb : specular;
    argb : emissive;
    xy : texture coordinates;
}

vertices
{
    0 : [1,2,3] [0,1,0] 0xFFFFFFFF, 0xF0F0F0F0, 0x10101010 [0,0];
    1 : [4,5,6] [1,0,0] 0xFFFFFFFF, 0xF0F0F0F0, 0x10101010 [1,1];

}


Indices

As for vertices. space, tab, '[', ']' and ',' are all valid separators and can be exchanged for readability, and separators should be able to follow each other.

Each faces block is created in a new index buffer, depending on parsing parameters.

3: filename.indices
(text file)

textures
{
    0 : texture1.png;
    1 : texture2.jpg;
}

definition
{
    123 : indices;
    xyz : normal;
    id : texture;
}

faces
{
    0 : 1,2,3 [0,1,0] 0;
    1 : 2,3,5 [0,0,1] 1;
}

faces //requesting creation in new index buffer
{
    ...

}

Sprites

A spritesheet it a texture where every frame of a sprite is laid out. A sprite may have several spritesheets. Notice that if frames are cropped to minimal rectangles their in-game size will vary. Size frames to reflect their in-game size.

spritename.sprite
sprite.desc text (1)
spritesheet.bmp/jpg/png bitmap (2)

Map

mapname.map
map.desc (1)

placeholder line

placeholder line

Formats related to unit attributes

All units are defined by and share the same attribute set. Each unit's particular values depends on their stereotypes (race, class and status). The principal function of items is to adjust a unit's attributes.

Transcluded from Unit attributes


Note: It is not yet fully decided on how this data will be organised. Races, classes, status and items might be kept separate in individual files, kept together, etc. Template (prototype) declarations might be allowed. It is also not certain the exact block/syntax format which will be used: f.i. the script format might be extended to allow for simple inheritance.

Using full or short qualifiers for attributes, a typical block might look like this:

Using normal .script syntax     Using hypothetical inheritance syntax
blockname
{
Mov : +1;
Wsk : +2;
Bsk : -1;
Pow : -2;
Tgh : =4;
Hp  : 3;
Ini : 3;
Att : -1;
Sta : +1;
Rec : +1;
Fat : =4;
Ldr : 3;
Tac : 3;
Std : -1;
Fer : +1;
Stu : +1;
Mor : =4;

}

gnome = basic unit
{
Mov += 1;
Wsk += 2;
Bsk -= 1;
Pow -= 2;
Tgh = 4;
Hp = 3;
Ini = 3;
Att -= 1;
Sta += 1;
Rec += 1;
Fat = 4;
Ldr = 3;
Tac = 3;
Std -= 1;
Fer += 1;
Stu += 1;
Mor = 4;

}

If an attribute or value is omitted it is assumed to be zero. All values can be prefixed by '=', '+' or '-'. If the sign is omitted it is assumed to be ASSIGN ('='). If an attribute or value is omitted it is assumed to be "+0". All values must be assigned as '=', '+=' or '-='. .

Items

Description of item (principally weapons and armour) definition format.

Units

Description of unit (races and classes) definitions format.

Army

Description of army definition. Armies are sets of regiments of units of a race, class and with equipment.

regiment_name
{
    default formation : box;
    standard : shield.png;

    unit
    {
        type : human;
        type : leader;
    }

    unit
    {
        type : human;
        type : champion;
    }

    unit
    {
        type : human;
        type : standard bearer;
    }

    unit
    {
        type : human;
        type : musician;
    }

    unit
    {
        type : human;
        amount : 21;
    }
}

Alternatively, hypothetical inheritance syntax:

    unit = human + regular + swordmen
    {
        type : human;
        type : leader;
    }

Mission

A mission is composed of a map, engagement parameters (zones and rules), armies and victory conditions.

Cutscene

A cutscene can be interactive or non-interactive. It can follow simple scripting.

Campaign

Campaigns are sequences of cutscenes and missions, the order of which are determined by simple scripting.

Module

Top-level file format. Principally considered self-sufficient and contains a complete and specific game (though it may use data of other modules, which voids its self-sufficiency). Must contain at least one campaign or individually playable mission.

background : bitmap name; //background for module main menu 
music: music name; //bgm for module main menu
icon : bitmap name; //"icon" for module in WARTBED main menu
etc...
Personal tools
communication