The cigen.package Thumbnail Cache
This file contains thumbnail images for items that have been displayed in Body Shop. That is, Body Shop only creates thumbnails for items as they are scrolled into view. If this file is deleted, Body Shop will recreate it and add thumbnails as needed.
The file contains three types of resource
- 0x43524944 - unknown to SimPe, 16 bytes. Purpose unknown.
- 0x43494745 - unknown to SimPe, variable length. This is a lookup table mapping resource keys to thumbnail keys, se below for details and see classes Cgn1 and Cgn1Item in my DbpfLibrary for implementation.
- 0x856DDBAC - jpg/tga/png Image, variable length. The cached thumbnail. Maxis modified jpeg including the alpha channel (stored in the ALFA block in an unknown format). Note, the Maxis modification has technically broken the JFIF standard, but most jpeg reading code can cope with the broken format.
To locate a thumbnail, get the key resource (AGED, GZPS, XMOL, XTOL) for the item and use it to lookup the associated thumbnail resource. Note, there may be zero, one or many thumbnails for an item.
So long as the primary resource (GZPS, XTOL, XMIL, AGED) group and instance ID of a Body Shop item isn't changed, the other values (sort, category, life stage, gender, et al) are irrelevant for locating the thumbnail, as is it's location on the disk.
0x43494745 (CGN1) Format
Header
// Fixed length of 8 bytes
DWORD unknown
DWORD count
Entry
// Repeated {count} times, fixed length of 104 bytes
WORD unknown1 (usually 0x0012)
WORD unknown2 (possibly image data length)
// TGIR of the owning resource, have seen AGED (skins), GZPS (clothing), XTOL (hair) and XMOL (makeup) types, but probably more
DWORD owner_typeId
DWORD owner_groupId
DWORD owner_instanceId (instance lo)
DWORD owner_resourceId (instance hi)
// TGIR of the associated image withing the cigen.package file
DWORD image_typeId
DWORD image_groupId (this is always 0x6F001872 - which could be a hash of "cigen" - but the actual group is 0xFFFFFFFF)
DWORD image_instanceId (instance lo)
DWORD image_resourceId (instance hi)
// Unknown 68 bytes, mostly 0x00s, could be anything!
BYTES unknown (68 bytes)
Notes
- owner keys are NOT unique
- not all Body Shop items have (findable) entries despite being displayed in Body Shop
Hope these notes are of use to someone. Enjoy!