Ascendancy

From XentaxWiki
Revision as of 18:10, 22 July 2023 by imported>Ikskoks (→‎FNT)
Jump to navigation Jump to search

Choose archive extension:

COB


Format Specifications

uint32 {4}   - Number Of Files

// for each file

char {50}    - Filename (null)


// for each file

uint32 {4}   - File Offset


byte {X}     - File Data

MultiEx BMS Script

Set DUMMYL Long 50 ;
Get FILECNTL Long 0 ;
Set DUMMYL Long DUMMYL ;
Math DUMMYL *= FILECNTL ;
SavePos FILESTART 0 ;
SavePos TAILSIZEU 0 ;
Math TAILSIZEU += DUMMYL ;
Math FILECNTL -= 1 ;
Do ;
GoTo FILESTART 0 ;
GetDString FILENAME 50 0 ;
SavePos FILESTART 0 ;
GoTo TAILSIZEU 0 ;
Get FILEOFF Long 0 ;
SavePos TAILSIZEU 0 ;
Get FILESIZE Long 0 ;
Math FILESIZE -= FILEOFF ;
Log FILENAME FILEOFF FILESIZE 0 0 ;
Math EXTRCNT += 1 ;
While EXTRCNT <> FILECNTL ;
GoTo FILESTART 0 ;
GetDString FILENAME 50 0 ;
SavePos FILESTART 0 ;
GoTo TAILSIZEU 0 ;
Get FILEOFF Long 0 ;
GoTo EOF 0 ;
SavePos FILESIZE 0 ;
Math FILESIZE -= FILEOFF ;
Log FILENAME FILEOFF FILESIZE 0 0 ;


Compatible Programs

Subformats

Ascendancy has a number of proprietary formats in the COB file. All of the non-audiovisual stuff is stored as CSV. Some formats are defined below:

RAW

Raw, 22050Hz PCM audio. (I'll look up endianness and other details ASAP)

VOC

Creative VOiCE files [1].

SHP

Ship visuals. All little-endian Main file header:

Offset     Size      Value
0x00       4 bytes   Magic number: 0x30312E31
0x04       4 bytes   Number of ship images in file
0x08       4 bytes   Offset into file of color palette for ship 1
0x0C       4 bytes   Offset into file of image for ship 1
0x10       4 bytes   Offset into file of color palette for ship 2
0x14       4 bytes   Offset into file of image for ship 2

From: http://80.126.249.96/users/mark/public/ascendancy/documentation/shp.html

FNT

From: http://80.126.249.96/users/mark/public/ascendancy/documentation/fnt.html

Font File Format

Author would like to thank authors of the following tools (in no particular order) for providing the information about the shape file format (which is the same in The Tone Rebellion and an older game from The Logic Factory, Ascendancy):

The Tone Rebellion fonts are known to have the header of the following structure: - version, 4 bytes: "1.\0\0", - character-count, 4-byte unsigned integer (it’s unknown whether it’s actually signed or unsigned, because we have font specimen consisting of more than 226 characters; for consistency, let’s consider it unsigned, even if all the other tools read it as signed), - rows-per-character, 4-byte unsigned integer, - transparent-color, 4-byte unsigned integer (considering the color indices are 1-byte long, this is a bit redundant), - offsets, array of unsigned 4-byte integers of length character-count, where every item is an offset in bytes for the corresponding character data to be placed, - character data array (until the end of the file).

Every known font file has exactly 226 characters, which seems to correspond to characters of the code page 437 (starting from code 0).

Every character corresponds to the following structure:

  • columns, 4-byte unsigned integer,
  • byte array of rows-per-character×columns, storing the color data.

The color data is meant to be an array of indices corresponding to some palette, except for one color, marked by color transparent-color, which is transparent (despite what the palette says).

Certain characters may have zero columns defined; this means those characters are absent from the font.

Read more about palettes in corresponding format description.

Oddities

Character with index 225, which normally looks like ß in the code page 437, for some reason looks more like ¡ in the fonts (in smfont.fnt, it is also the same as i, but from the bigfont.fnt, we can conclude it looks exactly like an inverted exclamation mark).

Related Pages