Dune 2000 File Formats Specs. Specially for Programmers, who want make editor(s) for Dune 2000

Date: June 8, 2004

Author: Roman "Siberian GRemlin" Lotchenov
E-Mail #1: slos@scn.ru
E-Mail #2: SibGRem@rambler.ru
*****************************************************************************
Graphics Resources - .R8 and .R16

ImageHeader: Record
ID: Byte; //0 - no data, 1 - picture with pallete,
//2 - picture with current pallete.
Width: LongInt; //Width of picture
Height: LongInt; //Height of picture
X_Offset: LongInt; //Pictures offset on an axis X (from left border(edge) of virtual frame)
Y_Offset: LongInt; //Pictures offset on an axis Y (from top border(edge) of virtual frame)
ImageHandle: LongInt; //Handle to picture (in memory), 0 - image not have picture
PaletteHandle: LongInt; //Handle to pallete (in memory), 0 - image not have pallete,
//and using pallete from palette.bin filr. format - 256*RGB
Bpp: Byte; //Bpp of picture
FrameHeight: Byte; //Height of virtual frame, in which is displayed the picture
FrameWidth: Byte; //Width of virtual frame, in which is displayed the picture
Align: Byte; //Alignment on even border
End;

There is a matrix(array) of pixels by the size further:
For ImageHeader.Bpp = 8: ImageHeader.Width*ImageHeader.Height
For ImageHeader.Bpp = 16: ImageHeader.Width*ImageHeader.Height*2,
������� � ���� ������ �� ������������.

If PaletteOffset <> 0 and ImageHeader.ID = 1, then there is Pallete Header and Pallete

PalHeader: Record
Memory: LongInt; //The memory under a palette was allocated (There is no importance in a file)
PalHandle:LongInt; //Handle to colors array (in memory), if 0 - then game showe error message
End;

Palette: array[0..511] of byte; //Pallete: 256 records of colors
//Color record: 2 bytes - 5 bit red component, 6 bit green component,
//5 bit blue component

Warning: In files UI_ENG.R16 and UI_ENG.R8, cuted ImageHeader.ID
Warning: Files UIBB.R8 and UIBB.R16 is only picture(pixels array) without any headers. Width=640, Height=400

*****************************************************************************
Sound Resources - [Dune2000 Folder]\Data\GameSFX\SOUND.RS

HeaderSize: LongInt; //Size of RSoundHeader
RSoundBody: array[0..56] of record
FileName: Char[0..12]; //File name
Zero: Byte; //Always $00
FileOffset: DWord; //Offfset of WAVE
FileSize: DWord; //Size of Wave file
end;

*****************************************************************************
Text Resources - [Dune2000 Folder]\Data\UI_Data\TEXT.UIB

STUIBHeader: record
Strs: DWord; //Count of strings
end;

STUIBBody: array[0..STUIHeader.Strs] of record
NameCount: Word; //Count of symbols(chars) in string name
StrName: array[0..STUIBBody.NameCount] of char; //String name
StrCount: word; //Count of symbols(chars) in string
Str: array[0..STUIBBody.StrCount] of char; //String
end;

*****************************************************************************
Fonts Resources - .FNT and .FPL

FontHeader of record
FontLoadedFlag: byte; //Must be $00
SpaceSize: byte; //Size of space (in pixels)
FirstSymbol: byte; //Code of first symbol in font
Interval: byte; //Size of interval between symbols (in pixels)
MaxHeight: byte; //Maximum height of symbol
Reserve: array[0..2] of byte; //not used
SymbolsHandle array[0..255] of LongInt; //Handle table to symbols in memory (There is no importance in a file)
end;

Symbols: array[0..255] of record
Width: LongInt; //Width of symbol
Heigth: LongInt; //Heigth of symvol
Pixels: array[1..(Symbols.Width*Symbols.Heigth)] of byte;
end;

Warning: FONTCOL.FNT using pallete from FONTCOL.FPL, Format - 256*RGBF, F=Junk!
Warning: [Dune2000 Folder]\Data\BIN\Font.BIN - is sybmol code(index) table(map)

*****************************************************************************
Thanks to:
Michail Beschetnov for begins in R8 file format description
Magic Team for help with R8 file format and for Dune 2000 Image Converter
be-lam0r for help with FNT, R16 and R8
-=*************=-
Please sorry for my english...