Table of Contents

Resource Reverse Engineering: Last Window: The Secret of Cape West

Oh boy… At a glace, pretty much all of the files inside this game are completely different to the previous game, Hotel Dusk: Room 215.

You'll find some code from 2023 at: https://github.com/Jas2o/KyleHyde

Pack

A fairly typical file container format.

Then for the number of files:

Then all the files follow.

BIN / BPG / EBP / IFB / IBA

Appears the first 4 bytes is the uncompressed size, and then 2 bytes is a zlib header (78 9c).

Confirmed, offzip was able to decompress a EN_Common.bin

.NET DeflateStream appears to work fine for these, just skip the first 6 bytes before you run it.

Sadly, don't think BRA files use this. The search continues…

BIN

Usually text.

BPG (Uncompressed)

A tile based images using a palette. A 256 x 192 image would have 48 tiles, 32 x 32 pixels each. Left to right, top to bottom, easy enough. Large images work fine in GameTools. A lot of the smaller or odd sized ones do not display correctly without forcing some changes.

bool flip = false;
byte[] magic = GT.ReadBytes(fs, 4, flip); //BPG1
int paletteNum = GT.ReadInt16(fs, 2, flip);
int unknown2 = GT.ReadInt16(fs, 2, flip); //Should be 8 ?
Width = GT.ReadInt16(fs, 2, flip);
Height = GT.ReadInt16(fs, 2, flip);
 
int tileWidth = GT.ReadInt16(fs, 2, flip);
int tileHeight = GT.ReadInt16(fs, 2, flip);
 
// Small/odd sized BPGs will need their Width/Height and tileW/H variables
// altered, you could do that here. I was working on a Dictionary to do it,
// but they're not very interesting to look at.
 
int numTilesX = Width / tileWidth;
int numTilesY = Height / tileHeight;
 
Color[] palette = new Color[paletteNum];
for(int i = 0; i < paletteNum; i++) {
	byte left = GT.ReadByte(fs);
	byte right = GT.ReadByte(fs);
	palette[i] = HotelDusk.FRM.Palette2Color(left, right);
}
 
bitmap = new Bitmap(Width, Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
 
for (int y = 0; y < numTilesY; y++) {
	for (int x = 0; x < numTilesX; x++) {
		for (int ty = 0; ty < tileHeight; ty++) {
			for (int tx = 0; tx < tileWidth; tx++) {
				byte lookup = GT.ReadByte(fs);
				bitmap.SetPixel(x * tileWidth + tx, y * tileHeight + ty, palette[lookup]);
			}
		}
	}
}

EBP

Might be the same as BPG (as in tile based). These seem less clear, will need to spend some time on them.

Appears to be a fairly standard bitmap using a palette. Unsure if it has animation/smaller scaled frames. However sometimes I can't recognize what's in them using a raw image viewer.

Assumptions:

When I can be bothered I'll look into how the Flag actually determines how the palette and extra bytes and image works.

Currently in GameTools most EBPs with 8 flags work fine, 53's work without the palette, and all the others are either broken or fail to load entirely. I'm still far more intrigued by the BRA files however them being the most unknown format I might come back to EBPs as a distraction.

BRA / Animation

As of July 26th 2020 these are pretty much solved. You'll find these files inside files inside pack files. They use a form of LZ compression, doesn't appear to be off-the-shelf.

Assume all the lengths are 4 bytes unless mentioned otherwise:

After the co-ordinate table, the pixel data goes something like this:

Some of the European version's files achieve better compression by using the 0x8 length/offset method less frequently.

If the palette length was 256, then just use the decompressed values to lookup the palette. Otherwise each byte value is used to determine alpha transparency and the palette offset:

MTC

MTCs are a low resolution colour animation overlay. Each frame appears to always be 25 x 29 pixels (however the first one includes the header so it's missing the first row - covered by the characters name anyway). Colour format is RGBA1555. Not the same as Hotel Dusk.