Wartbed:Files/Formats

From Dark Omen Wiki

< Wartbed:Files(Difference between revisions)
Jump to: navigation, search
(Formats related to unit attributes)
(File Formats)
 
(20 intermediate revisions not shown)
Line 2: Line 2:
Description of WARTBED file formats.
Description of WARTBED file formats.
-
==Geometry==
+
=Types of File Formats=
-
.ZIP archive with .model extension. Archive containing the following file types and extensions (can conatin any number of all file types except meshes.desc).
+
<div style="margin-left: 2em;">
 +
==Archives and Virtual File Systems==
 +
Many WARTBED data files are in fact .zip archives. Some contain several files, like <tt>.model</tt> files, and sometimes entire file systems of directories and files, like the <tt>.module</tt> files.  
-
<div style="border:1px solid gray; background:rgb(215,225,215);">
+
==WARTBED Script==
-
<div style="float:right;text-align:right;padding:0.5em;background:grey;color:rgb(225,225,225);width:25%;">''modelname''.'''model'''<br>(.zip archive)</div>
+
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.  
-
<div style="padding:1em; "><tt>
+
-
{| style="font-family:courier;color:rgb(0,32,0);background:rgb(215,225,215);align:left;" |
+
-
|style="padding-right:8em;"|'''model.desc''' ||text || (1)
+
-
|-
+
-
|''filename''.vertices ||text || (2)
+
-
|-
+
-
|''filename''.indices ||text || (3)
+
-
|-
+
-
|''filename''.bmp/jpg/png ||bitmap
+
-
|-
+
-
|''filename''.skeleton ||???
+
-
|-
+
-
|''filename''.animation ||???
+
-
|-
+
-
|}
+
-
</tt></div></div>
+
-
<br>
+
-
===Model description===
+
:''See [[Wartbed:Files/Formats/Script|The WARTBED Script Format]]
-
<div style="margin-left:2em;border:1px solid gray; background:rgb(215,225,215);">
+
-
<div style="float:right;text-align:right;padding:0.5em;background:grey;color:rgb(225,225,225);width:25%;">1: '''meshes.desc'''<br>(text file)</div>
+
-
<div style="padding:1em; color:rgb(0,32,0);"><tt>''Mesh_name''<br>
+
-
{<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;vertices : filename.vertices;<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;indices : filename.vertices;<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;offset : [x,y,z];<br>
+
-
}<br><br>
+
-
''Mesh_2_name''<br>
+
-
{<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;...<br>
+
-
}<br></tt></div>
+
</div>
</div>
-
<br>
 
-
===Vertices===
+
=File Formats=
-
Space, tab, '[', ']' and ',' are all valid separators and can be exchanged for reabability. Separators should be able to follow each other (cross your fingers).
+
<div style="margin-left: 2em;">
 +
==Configuration==
 +
:''See [[Wartbed:Files/Formats/Application Settings|application.config]]''
-
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.
+
==3D Geometry ("Models")==
 +
3D geometry (a "model") is represented as a set of files contained inside a .ZIP archive with <tt>.model</tt> extension. Archive containing the following file types and extensions (can contain any number of all file types except meshes.desc).
-
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.
+
* 3D Models <tt>'''[[Wartbed:Files/Formats/3D|.model]]'''</tt> format (an archive of the following files)
-
 
+
** <tt>[[Wartbed:Files/Formats/3D# Model description|model.desc]]</tt>
-
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).
+
** <tt>[[Wartbed:Files/Formats/3D#Vertices|.vertices]]</tt>
-
 
+
** <tt>[[Wartbed:Files/Formats/3D#Indices|.indices]]</tt>
-
<div style="margin-left:2em;border:1px solid gray; background:rgb(215,225,215);">
+
** <tt>.skeleton</tt>
-
<div style="float:right;text-align:right;padding:0.5em;background:grey;color:rgb(225,225,225);width:25%;">2: ''filename''.'''vertices'''<br>(text file)</div>
+
** <tt>.animation</tt>
-
<div style="padding:1em; color:rgb(0,32,0);"><tt>definition<br>
+
-
{<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;xyz : position;<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;xyz : normal;<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;argb : diffuse;<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;argb : specular;<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;argb : emissive;<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;xy : texture coordinates;<br>
+
-
}<br>
+
-
<br>
+
-
vertices<br>
+
-
{<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;0 : [1,2,3] [0,1,0] 0xFFFFFFFF, 0xF0F0F0F0, 0x10101010 [0,0];<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;1 : [4,5,6] [1,0,0] 0xFFFFFFFF, 0xF0F0F0F0, 0x10101010 [1,1];<br>
+
-
}<br></tt></div>
+
-
</div>
+
-
<br>
+
-
 
+
-
===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.
+
-
 
+
-
<div style="margin-left:2em;border:1px solid gray; background:rgb(215,225,215);">
+
-
<div style="float:right;text-align:right;float:right;text-align:right;padding:0.5em;background:grey;color:rgb(225,225,225);width:25%;">3: ''filename''.'''indices'''<br>(text file)</div>
+
-
<div style="padding:1em; color:rgb(0,32,0);">
+
-
<tt>textures<br>
+
-
{<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;0 : texture1.png;<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;1 : texture2.jpg;<br>
+
-
}<br>
+
-
<br>
+
-
definition<br>
+
-
{<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;123 : indices;<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;xyz : normal;<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;id : texture;<br>
+
-
}<br>
+
-
<br>
+
-
faces<br>
+
-
{<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;0 : 1,2,3 [0,1,0] 0;<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;1 : 2,3,5 [0,0,1] 1;<br>
+
-
}<br>
+
-
<br>
+
-
faces      //requesting creation in new index buffer<br>
+
-
{<br>
+
-
&nbsp;&nbsp;&nbsp;&nbsp;...<br>
+
-
}</tt></div></div>
+
==Sprites==
==Sprites==
Line 126: Line 52:
==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|Unit attributes}}
+
:''See [[Wartbed:Unit attributes|Unit Attributes]]''
-
Using full or short qualifiers for attributes, a typical block might look like this:
+
* Unit definition format
 +
* Regiment file format
 +
* Army file format
-
{|style="padding:2em;"
+
==Modules and Campaigns==
-
!Using normal .script syntax&nbsp;&nbsp;&nbsp;&nbsp;
+
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.
-
!Using hypothetical inheritance syntax
+
:[[Wartbed:Files/Formats/Modules_and_Campaigns#The_.module_file|The '''<tt>.module</tt>''' format]]
-
|-
+
-
|<div style="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="font-family:courier;">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>
 
-
|}
 
-
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 ('=').  
+
Campaigns are sequences of cutscenes and missions, the order of which are determined by simple scripting.
-
 
+
:[[Wartbed:Files/Formats/Modules_and_Campaigns#The_.campaign_file|The '''<tt>.campaign</tt>''' format]]
-
'''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.
+
-
 
+
-
===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.
+
==Mission==
==Mission==
Line 197: Line 73:
A cutscene can be interactive or non-interactive. It can follow simple scripting.  
A cutscene can be interactive or non-interactive. It can follow simple scripting.  
-
==Campaign==
+
==Other==
-
Campaigns are sequences of cutscenes and missions, the order of which are determined by simple scripting.
+
<pre>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...</pre>
 +
</div>
 +
 
 +
[[category:File Formats]]

Current revision as of 21:57, 15 November 2009

Description of WARTBED file formats.

Contents

Types of File Formats

Archives and Virtual File Systems

Many WARTBED data files are in fact .zip archives. Some contain several files, like .model files, and sometimes entire file systems of directories and files, like the .module files.

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.

See The WARTBED Script Format

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