The home of Stainless
  • Starflight
    • Hacking
    • Remake
    • Archive
  • XNA
    • Planet generation >
      • Planets 1 Mercators
      • Planets 2 Bump maps
      • Planet 3 Ice worlds
      • Planets 4 Gas giants
      • Planets 5 Airless rocks
      • Planets 6 Molten planets
      • Planets 7 Bug fixes and improvements
      • Planets 8 Clouds
      • Planets 9 Atmospheric Scattering
      • Planets 10 Rings and stars
    • Remakes >
      • Ultima 4
      • World map
    • Facial Animation >
      • Importing the expressions
      • Loading the base mesh
      • Using the mesh
    • Spherical Harmonics >
      • GPU based
    • Sand
    • Alpha blending bug
  • Contracting
    • Clients
  • Blog
  • New Games
    • Onslaught
    • Towers
    • Two Towers
    • FOFT
    • Convoy
    • IL2 Mod tool >
      • Gallery
    • Downloads
  • Magic System
    • Genetic Magic
  • DevMaster Competition
  • Reality
    • Chapter 1
    • Chapter 2
    • Chapter 3
    • Chapter 4
    • Chapter 5
    • Part Two
    • Chapter 6

Starflight Hacking

In the course of my research into Starflight I have discovered many things. Some are available elsewhere on the interweb, some are not.

I will include a few choice items here.

Amiga version :- Graphic Archives

The graphics are stored in a bespoke format TLB.
Be aware that the byte ordering is motorola format.


Each archive starts with a header.
typedef struct TLBHEADER
{
	char	 Type[4];		 	//TLBR
	int	Filelength;
	short	 NRecords;
	char	 Padding[2];
}t_tlb_hdr;
There then follows NRecords +1 int's which are the offset of each graphic within the file.
The extra int exists so you can get the length of the last graphic.

Each graphic starts with a six byte header, byte 5 of this is a type byte which specifies the storage used for this graphic.

Byte 4 is a scalar, usually the width in bytes of the graphic.

The identified types are...

Type 0

16 colour sprite stored in 4 bit planes.
Byte 4 is the width in bytes so the height is (size-6)/(Byte4*4)

Example

Picture

Type 1

Seems to be functionally identical to type 0

Example

Picture

Type 2

16 colour sprite with mask.
The mask is stored as the first bit plane, so the height becomes (size-6)/(Byte4*5)

Example

Picture

Type 3

Seems to functionally identical to type 2

Example

Picture

Type 5

Run length encoded graphic.
Each byte is a flag which has the following meaning.

  • -1 to -127 (repeat the next byte 1+(0-a) times
  • 1 to 127 (copy the next 1+a bytes
  • -128 NOP

This produces a 16 bit nibble per pixel bit stream.

Example

Picture

Type 7

This is an animated sprite, I haven't decoded this yet.

Type 10

This s a pallete.


Each four bytes maps to a pallete record with byte 0 being the index within the pallete and the next 3 the RGB values.

Powered by Create your own unique website with customizable templates.