Skip to content

Kal Files

Adrien edited this page Oct 22, 2023 · 2 revisions

Kal Files

File organisation

Root folder

Old New Description
GAME.K* GAME.K* Contains objects loaded and used through the entire game
00GLOC.K* 00GLC.K* Language-specific file used in the entire game (first langauge)
01GLOC.K* 01GLC.K* " (second language)
... ...
LVL000/ LVL000/ Folder containing files for Level 0 (main menu)
LVL001/ LVL001/ Folder containing files for Level 1
LVL002/ LVL002/ Folder containing files for Level 2
... ...

Level folder (LVL012 as example)

Old New Description
LVL12.K* LVL012.K* Contains objects loaded during the level
STR12_00.K* STR01200.K* Contains objects loaded during sector 1
STR12_01.K* STR01201.K* " sector 2
... ...
00LLOC12.K* 00LLC012.K* Language-specific level data (first language)
01LLOC12.K* 01LLC012.K* " (second language)
... ...

In Spyro DotD and the Olympic Games Xbox 360 port, the file names were changed, such that the level number uses 3 decimals instead of only 2, while keeping the 8.3 filename limit. So LVL01.KWN becomes LVL001.KWN, STR01_02.KWN becomes STR00102.KWN, and 02LLOC01.KWN becomes 02LLC001.KWN

The extensions in the file names depend on the platform:

Platform Extension
PC KWN
PS2 KP2
GameCube KGC
PSP KPP
Wii KRV
Xbox 360 KXE
PS3 KP3

GAME file

XXL1 Format

numGlobalObjects    uint32_t  4  Number of objects
gameManagerClassId  uint32_t  4  ID of the class of category 12-Misc, to be used as the game manager class
For i in [0..numGlobalObjects)
  clCat             uint32_t  4  Class category
  clId              uint32_t  4  Class ID
  nextOff           uint32_t  4  File offset to right after the object serialization
  <serialization of object of class (clCat,clId)>

XXL2+ Format

numGlobalObjects    uint32_t  4  Number of objects
gameManagerUUID     kuuid    16  UUID of Game Manager object (so that it can be referenced)
gameManagerClassId  uint32_t  4  ID of the class of category 12-Misc, to instantiate the Game Manager
Assign s = 0
While s < numGlobalObjects:
  clFullID          uint32_t  4  Class Full ID
  count             uint32_t  4  Number of objects of class [clFullID] to instantiate
  hasUUID           uint8_t   1  1=objects can be referenced through UUID, 0=objects have no UUID and cannot be referenced
  If hasUUID=1
    For i in [0..count)
      objUUID       kuuid    16  UUID of the object [s+i]
  Assign s = s + count
For i in [0..numGlobalObjects)
  nextOff           uint32_t  4  File offset to right after the object serialization
  <serialization of object [i]>
Clone this wiki locally