User Tools

Site Tools


arma:file_formats:generic_data_types

ArmA 1 Generic File Format Data Types

Intro

This is a generic list of data types encountered in all file formats. Not all of which will be used in a specific file format.

They are listed here, rather than repetitive typing in each of file format's documentation.

Endian

Little endian byte order, lsb first for numeric values, text is stored in Big endian byte order.

Data Types

Type Description
byte unsigned 8 bit (1 byte)
char signed 8 bit Ascii(utf8) character
char[] fixed length string
tbool byte (0 = false).
short 16 bit signed short (2 bytes)
ushort 16 bit unsigned short (2 bytes)
long 32 bit signed integer (4 bytes)
ulong 32 bit unsigned integer (4 bytes)
float 32 bit IEEE-single precision floating point value (4 bytes)
double 64 bit IEEE-double precision floating point value (8 bytes)
asciiz Null terminated (0x00) variable length ascii string
asciiz… zero or more concatenated asciiz strings
ascii fixed length ascii string(UTF-8)

XYPair

XYPair
{
	ulong x,y; // normally associated with cell sizes
}

XYZTriplet

XYZTriplet
{
	float    x,y,z;
}

Normally, this structure is associated with positional information.

RGBAColor

RGBAColor
{
	byte r,g,b,a; // // 0xFF:FF:FF:FF means 'default'
}
  • RGBA colors correspond to Microsoft's D3DCOLORVALUE
  • They normally come in pairs inside the pew structures to reflect object and outline colors

String

LenString
{
	ulong  Length;
	Asciiz Characters[[Length]];// null terminated regardless.
};

Length always =strlen(Characters)+1;

This is a pre-calculated convenience to reduce load times (and skip over the variable length block).

TransformMatrix[[4]][[3]]

This is the transform matrix as used by Microsoft DirectX. Known as row-vector format

In fact, the 'correct' matrix is actually 4 x 4, but the last column always represents 0,0,0,1 thus

M11, M12, M13 (0.0)
M21, M22, M23 (0.0)
M31, M32, M33 (0.0)
M41, M42, M43 (1.0)

And so is never stored. This identical matrix is used for WRP files (both formats) and RTM files.

In this documentation the above matrix is represented as XYZTriplets

struct TransformMatrix
{
	XYZTriplet XYZ[[4]];
};

The last row:

M41..., or XYZ[[3]]...

corresponds to the position of the object.

ColumnFormat[[3]][[4]]

Pew files hold this data in Column, rather than row, vectors, as per OpenGL. Thus;

Wrp

ABC
DEF
GHI
JKL

Pew

ADGJ
BEHK
CFIL

And is repesent structurally as

struct PewTransform
{
	float[[3]][[4]];
};

Note

Note that 'int' is not used in this documentation for the following reasons:

  • an 'int' is machine and compiler and language dependent. It is an arbitrary size SIGNED value.
  • with exceptions, bis use floats when requiring negative values.
  • almost all references to 'integers' in bis file formats are either positive-only offsets into memory, zero based indexes, and counts.
  • the incidence of true shorts and true integers in bis is quite rare. Exception -1 is a favourite, to indicate default
arma/file_formats/generic_data_types.txt · Last modified: 2024/08/01 07:57 by snakeman

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

All PMC web site download services are temporarily suspended until web site yearly fees have been recovered, want to download addons/mods? Then Support PMC.

If you are grateful for all the work PMC has done in the past 25 years, use Support PMC page.