Wartbed:Files/Formats

From Dark Omen Wiki

(Difference between revisions)
Jump to: navigation, search
(File Formats: +Application Settings)
(Units, Regiments and Armies)
Line 69: Line 69:
==Formats related to unit attributes==
==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.
+
:''Main article: [[Wartbed:Files/Formats/Units, Regiments and Armies|Units, Regiments and Armies]]''
-
{{transclude|Wartbed:Unit attributes}}
+
:''See [[Wartbed:Unit attributes|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.
+
* Unit definition format
-
 
+
* Regiment file format
-
Using full or short qualifiers for attributes, a typical block might look like this:
+
* Army file format
-
 
+
-
{|style="padding:2em;"
+
-
!Using .script v1 syntax    
+
-
!Using inheritance syntax
+
-
|-
+
-
|width="50%" style="color: rgb(92,92,92);"|<div style="margin:0.25em;padding:1em;border:dotted 1px;font-family:courier;">blockname<br>{
+
-
<div style="margin-left:2em;">Mov : +1;</div>
+
-
<div style="margin-left:2em;">Wsk : +2;</div>
+
-
<div style="margin-left:2em;">Bsk : -1;</div>
+
-
<div style="margin-left:2em;">Pow : -2;</div>
+
-
<div style="margin-left:2em;">Tgh : =4;</div>
+
-
<div style="margin-left:2em;">Hp  :  3;</div>
+
-
<div style="margin-left:2em;">Ini :  3;</div>
+
-
<div style="margin-left:2em;">Att : -1;</div>
+
-
<div style="margin-left:2em;">Sta : +1;</div>
+
-
<div style="margin-left:2em;">Rec : +1;</div>
+
-
<div style="margin-left:2em;">Fat : =4;</div>
+
-
<div style="margin-left:2em;">Ldr :  3;</div>
+
-
<div style="margin-left:2em;">Tac :  3;</div>
+
-
<div style="margin-left:2em;">Std : -1;</div>
+
-
<div style="margin-left:2em;">Fer : +1;</div>
+
-
<div style="margin-left:2em;">Stu : +1;</div>
+
-
<div style="margin-left:2em;">Mor : =4;</div>
+
-
}
+
-
</div>
+
-
 
+
-
|<div style="margin:0.25em;padding:1em;border:solid 1px;font-family:courier; background:rgb(215,230,215)">gnome = basic unit<br>{
+
-
<div style="margin-left:2em;">Mov += 1;</div>
+
-
<div style="margin-left:2em;">Wsk += 2;</div>
+
-
<div style="margin-left:2em;">Bsk -= 1;</div>
+
-
<div style="margin-left:2em;">Pow -= 2;</div>
+
-
<div style="margin-left:2em;">Tgh  = 4;</div>
+
-
<div style="margin-left:2em;">Hp  = 3;</div>
+
-
<div style="margin-left:2em;">Ini  = 3;</div>
+
-
<div style="margin-left:2em;">Att -= 1;</div>
+
-
<div style="margin-left:2em;">Sta += 1;</div>
+
-
<div style="margin-left:2em;">Rec += 1;</div>
+
-
<div style="margin-left:2em;">Fat  = 4;</div>
+
-
<div style="margin-left:2em;">Ldr  = 3;</div>
+
-
<div style="margin-left:2em;">Tac  = 3;</div>
+
-
<div style="margin-left:2em;">Std -= 1;</div>
+
-
<div style="margin-left:2em;">Fer += 1;</div>
+
-
<div style="margin-left:2em;">Stu += 1;</div>
+
-
<div style="margin-left:2em;">Mor  = 4;</div>
+
-
}
+
-
</div>
+
-
|-
+
-
|'''This style has been phased out of WARTBED.''' 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 ('=').
+
-
|'''This is the script syntax currently used throughout WARTBED, even though this inheritance model will not be used.''' 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.
+
-
 
+
-
<pre>unit_name
+
-
{
+
-
    attributes ... ;
+
-
    representation : unit.sprite;
+
-
}
+
-
 
+
-
unit_2_name
+
-
{
+
-
    attributes ... ;
+
-
    representation : unit.models;
+
-
}</pre>
+
-
 
+
-
===Army===
+
-
Description of army definition. Armies are sets of regiments of units of a race, class and with equipment.
+
-
 
+
-
<pre>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;
+
-
    }
+
-
}</pre>
+
-
 
+
-
Alternatively, hypothetical inheritance syntax:
+
-
 
+
-
<pre>
+
-
    unit = human + regular + swordmen
+
-
    {
+
-
        type : human;
+
-
        type : leader;
+
-
    }
+
-
</pre>
+
==Modules and Campaigns==
==Modules and Campaigns==

Revision as of 17:05, 15 November 2009

Description of WARTBED file formats.

Contents

Types of File Formats

WARTBED Script

Human-readable text-based mark-up language for data definitions. Script v2 is a flexible language parser that can use arbitrarily defined symbols for scoping and operators, but the WARTBED Script syntax is loosely based on C/C++ syntax. The WARTBED Script can be said to fulfil the same function as XML, but is infinitely more readable and easy to maintain.

NOTE that WARTBED currently uses Script v2, but most examples in this article still are written in the style of v1. In the first version, name and value in pairs where separated by colon, while in v2 C-style assignment operators are used.

Syntax

WARTBED Script

  • represents data as couples of names and values separated by an operator
  • uses curly brackets ("{" and "}") for scopes
  • uses C's assignment operators (=, +=, -=, *= and /=) to separate name and value of data
  • supports white space in names and data without citation marks. If leading or trailing white space is required, to be retained or operators must be included in name or value, citation marks must be used
  • reads EOL as end of the current declaration. Multiple declaration on the same line must be separated with semi-colon.
  • Uses // and /* ... */ for single-line and block comments.

Example

first = Hello, file! second = " Hello, whitespace! " outer block { 1st value = 10 2nd value = 3.1415 inner block { name 1 = "WARTBED"; name 2 = "Script" } }

File Formats

Configuration

See application.config

3D Geometry ("Models")

3D geometry (a "model") is represented as a set of files contained inside a .ZIP archive with .model extension. Archive containing the following file types and extensions (can contain any number of all file types except meshes.desc).

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

Main article: Units, Regiments and Armies
See Unit Attributes
  • Unit definition format
  • Regiment file format
  • Army file format

Modules and Campaigns

Modules are top-level files. 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.

The .module format


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

The .campaign format

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.

Other

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