АКЦИЯ от www.R3.ru - хостинг сайтов 72р. в месяц. Домен в подарок!

.werkkzeug 3 datafile format description

introduction

This is .k file format description. Some fields are still unknown. If you are any additional info or questions, feel free to write to me.

This format description is very incomplete and it will be updated soon.

/*
 *  .werkkzeug 3 datafile format.
 *  (c) 2010-2011, Sauron.
 * 
 *  Updated: August 30, 2011.
 */

// .werkkzeug 3 project (.k)
struct wz3project {
	// Magic number ('nova')
	uint32 magic;
	// Version of format (always 0x01)
	uint32 version;
	// Start tag, always '<<<<'
	uint32 startTag;
	// Format identificator (for .k always 0x01000100)
	uint32 formatId;
	// Format subversion, always 0x0e
	uint32 unknown2;
	// Length (from nrevents to meta inclusive), measured in dwords
	uint32 length;
	// Number of timeline events
	uint32 nrevents;
        // Number of pages
	uint32 nrpages;
	// Number of operators
	uint32 nrops;
	// Unknown
	uint32[5] _unknown0;
	// Page descriptors
	struct wz3page[nrpages] pages;
	// Operators
	struct wz3operator[nrops] operators;
	// Timeline events
	struct wz3event[nrevents] events;
	// Number of splines
	uint32 nrsplines;
	// Splines
	struct wz3spline[nrsplines] splines;
	// Unknown DEADBEEF
	uint32 _unknown1;
	// BLOBS
	uint08[?] blobs;
	align 4;
	// Unknown DEADBEEF
	uint32 _unknown2;
	// Demo metadata
	struct wz3meta meta;
	// End tag, always '>>>>'
	uint32 endTag;
	// Unknown 32 bytes (scenes)
	uint32[8] unknown@end;
}

// .werkkzeug 3 page descriptor
struct wz3page {
	// Number of operators situated on this page
	uint32 nroperators;
	// Position of horizontal scroll bar (in px)
	uint32 x_position;
	// Position of vertical scroll bar (in px)
	uint32 y_position;
	// Unknown
	uint32 unknown1;
	// Unknown (counter???)
	uint32 unknown2;
	// Spare flag 01
	uint32 spareFlag01;
	// Spare flag 02
	uint32 spareFlag02;
	// Indentation in the page tree
	uint16 indent;
	// ' ' - leaf, '-' - expanded, '+' - collapsed
	uint16 collapseState;
	// Length of page name
	uint32 nameLength;
	// Page name
	char[nameLength] name;
	align 4;
	// Length of owner name
	uint32 userLength;
	// Owner name
	char[userLength] user;
	align 4;
	// Unknown
	uint32 unknown5;
}

// .werkkzeug3 operator descriptor
struct wz3operator {
	// OpClass (it is kike CID in WZ1)
	uint32 type;
	// Unknown
	uint32 unknown0;
	// X position
	uint32 xpos;
	// Y position
	uint32 ypos;
	// Width of the block
	uint32 width;
	// Number of page
	uint32 page;
	// Number of dword parameters
	uint8 ndwords;
	// Number of links and some unknown flag
	uint8 nlinks;
	// Number of string parameters
	uint8 nstrings;
	// Unknown
	uint8 unknown1;
	// ?? a.p.
	uint32 unknown2;
	// Bypass flag
	uint32 bypass;
	// Still unknown
	uint32 unknown4;
	// Number of animation blocks
	uint32 nranims;
	// Hidden flag
	uint32 hidden;
	// Size of BLOB connected to this operator
	uint32 blobSize;
	// Length of operator name
	uint32 nameLength;
	// Operator name
	char[nameLength] name;
	align 4;
	// Links
	struct {
		uint32 linkLength;
		char[linkLength] link;
		align 4;
	} [nlinks] links;
	// Dword and float32 parameters
	uint8[ndwords*4] para;
	// String parameters
	struct {
		uint32 stringLength;
		char[linkLength] string;
		align 4;
	} [nlinks] strings;
	// Animation blocks
	struct wz3animblock[nranims] anims;
}

// .werkkzeug 3 animation operator
struct wz3animblock {
	// Position
	uint32 xpos;
	uint32 ypos;
	// Width
	uint32 width;
	// Mode (see comment #2)
	uint32 mode;
	// Variable index (when storing and loading variables)
	uint32 variable;
	// Length of parameters, measured in dwords
	uint32 dwords;
	// Still unknown (or reserved)
	uint32 _unknown0;
	uint32 _unknown1;
	// Parameters
	uint32[dwords] para;
}

// .werkkzeug 3 timeline event
struct wz3event {
	// 
	uint32 _unknown0;
	// Start time
	uint32 start;
	// End time
	uint32 end;
	// 
	uint32 select;
	// 
	float32 velocity;
	// 
	float32 modulation;
	// 
	uint32 row;
	// 
	uint32 _unknown1;
	// 
	uint32 mark;
	// 
	uint32 color;
	// 
	uint32 enabled;
	// 
	uint32 _unknown2;
	// 
	uint32 nameLength;
	// 
	char[nameLength] name;
	align 4;
	// 
	float32[3] scale;
	float32[3] rotate;
	float32[3] translate;
	// 
	uint32 splineNameLength;
	char[splineNameLength] splineName;
	align 4;
	// 
	float32[2] timeInterval;
	// 
	uint32 preserveTime;
}

// Kinds of splines
enum SPLINE_KIND {
	ANY=0;
	SCALE=1;
	ROTATE=2;
	TRANSLATE=3;
	COLOR=4;
}

// Types of interpolation
enum SPLINE_INTERPOLATION {
	// normal spline
	CUBIC=0;
	// 
	LINEAR=1;
	// rectangular
	STEP=2;
}

// .werkkzeug 3 spline
struct wz3spline {
	// Kind of spline
	SPLINE_KIND kind;
	// Number of channels
	uint32 nrchannels;
	// Type of interpolation
	SPLINE_INTERPOLATION interpolation;
	// 
	uint32
	// Length of spline name
	uint32 nameLength;
	// Spline name
	char[nameLength] name;
	align 4;
	...
}

// Types of production
enum PROD_TYPE {
	DEMO=0;
	INTRO=1;
	KKRIEGER=2;
}

// .werkkzeug 3 demo metadata
struct wz3meta {
	// Unknown
	uint8[12] _unknown0;
	// Farbrausch number
	uint32 projectID;
	// Border size
	uint32 border;
	// X screen resolution
	uint32 screenX;
	// Y screen resolution
	uint32 screenY;
	// Beats per minute
	float32 bpm;
	// Start sample of soundtrack
	uint32 startSample;
	// ?
	uint32 _unknown9;
	// Global gamma correction
	float32 globalGamma;
	// Type of production
	PROD_TYPE prod_type;
	// Buzz(0) / Correct(1) flag
	uint32 bpmState;
	// ?
	uint32 _unknown12;
	uint32 _unknown13;
	uint32 _unknown14;
	uint32 _unknown15;
	uint32 _unknown16;
	uint32 _unknown17;
	// Length of demo title
	uint32 appNameLength;
	// Demo title
	char[appNameLength] appName;
	align 4;
	// Length of soundtrack filename
	uint32 soundtrackLength;
	// Soundtrack filename
	char[soundtrackLength] soundtrackName;
	align 4;
	// Length of samples filename
	uint32 samplesLength;
	// samples filename
	char[samplesLength] samplesName;
	align 4;
}

See also