Keen 1-3 Tileinfo format

From ModdingWiki
Jump to navigation Jump to search

Overview

Commander Keen 1-3 has an internal tileinfo file that details the properties of its tileset, whether they block the player, whether they kill, etc. The location of these segments are as follows (For the decompressed executable of each episode only.):

Episode Version Offset Number of tiles
1 1.1 0x131F8 611
1.31 0x130F8
2 1.1 0x17938 689
1.31 0x17828
3 1.1 0x199F8 715
1.31 0x198C8

The file is divided into six 'planes'; each composed of two-byte entries. Each plane covers a specific property of the tileset, such as blocking-up or general behavior. The total size of the tile file is thus (tilenum * 12) bytes. The blocks in order are:

  • Number of animation frames
  • Behavior
  • Top blocking
  • Right-side blocking
  • Bottom blocking
  • Left-side Blocking

Plane functions

The first plane deals with animations. The valid values here are 0, 2 or 4, defining the three length of animation used in game. (0, 2 or 4 tile sequences.) The game scans this plane and organizes tiles into 'animation loops' To work predictably a row of 2 or 4 consecutive tiles should all have the value of 2 or 4 respectively. If this is not the case, the first tile encountered will be considered the start of the loop, and the next 1 (Or 3) tiles as part of it.

The behavior plane is how the tile affects the player, with quite a variety of effects as follows:

Value Effect Value Effect
-2 Masked 14 Whiskey
-1 Foreground 15 Raygun
0 Nothing 16 Pogo
1 Kills 17 Exit
2 Door 1 18 Key 1
3 Door 2 19 Key 2
4 Door 3 20 Key 3
5 Door 4 21 Key 4
6 500 points 22 Message box pop-up
7 100 points 23 Light switch
8 200 points 24 Teleporter
9 1000 points 25 Switch on
10 5000 points 26 Switch off
11 Joystick 27 Ankh (Keen 3)
12 Battery 28 Ammo clip (Keen 3)
13 Vacuum

The blocking planes can have values of either 0-1 (0-4 for top blocking) for each tile and control whether the player can move through that boundary. For example, the top blocking plane controls whether a tile can be stood on. A completely solid tile will thus have all its entries in these planes as 1. For the top blocking plane, the following values are valid:

Value Effect
0 Fall through
1 Solid
2 Slippery
3 Ice

Notes

This format has been reverse engineered several times, most notably for the Tileinfo program for Keen.