Game errors are problems that occur during gameplay that (usually) result in the crash of the game or the display of an error message. They are useful patch-wise in that a well constructed mod will never use these errors and they can be co-opted for other means.
There are four basic types of error encountered in the Keen games; the first are nonfatal errors, these will display an error message, but will allow the game to continue being played. An example of this is the 'Unable to play background music' error. The second kind are crashes, and they cause the game to crash leaving just a command prompt and (usually) a single line of text explaining technical details. These are the most common and least useful errors. An example is the 'too many animating tiles' error. The third kind of error is a freezing error, where the game will freeze, needing to be closed. An example is the animating tile freeze. The final category of errors will not affect gameply hugely but result in 'gibberish' or other limits on what can be done.
This page will cover two basic functions. The first is to identify errors and how they are triggered and thus aid the modder in avoiding them. The second will be to supply patches where possible to remove or modify error code or more useful purposes. (It may be useful to see Patch:Text patches
Since most errors occur in the Keen Galaxy series, all errors listed on this page apply only to Keens 4, 5 and 6 unless sated otherwise.
- 1 Nonfatal errors
- 2 Crash errors
- 2.1 Null pointer assignment
- 2.2 Missing a text file
- 2.3 Disk error
- 2.4 Can't open files errors
- 2.5 EGAGRAPH errors
- 2.6 RF_MarkTileGraphics errors
- 2.7 RF_CheckForAnimTile error
- 2.8 RFL_AnimateTiles errors
- 2.9 MM_ClearBlock errors
- 2.10 WallDebug errors
- 2.11 FullClipToWalls
- 2.12 Object with bad state
- 2.13 Tried to load a non existent map
- 2.14 Map is too tall
- 2.15 Insufficient memory to load map level
- 2.16 RF_SetScrollBlock errors
- 2.17 RFL_NewRow errors
- 2.18 No free spots in Objarray
- 2.19 No free spots in Sprite array
- 2.20 Placed uncached sprite
- 2.21 Tried to remove the player
- 2.22 Bad shifts number
- 2.23 No star specs for object
- 2.24 SpawnShot - Bad dir
- 2.25 Walk: Bad dir
- 2.26 Keyholder points to bad spot
- 2.27 StartMusic - Bad level number
- 2.28 MM_Set errors
- 2.29 String exceeds width
- 2.30 PageLayout errors
- 2.31 CA_FarRead\CA_FarWrite
- 2.32 USL_ConfirmComm errors
- 2.33 Demo loop exited
- 2.34 Demo buffer overflow
- 2.35 Demo playback exceeded
- 2.36 CA_UpLevel\CA_DownLevel
- 2.37 Out of memory
- 2.38 Bad pointers
- 2.39 Error during code expansion
- 3 Freeze errors
- 4 Other limits\problems
- 4.1 Level height\width limit
- 4.2 Maximum number of sprites
- 4.3 Forbidden pointer values and gibberish in-level
- 4.4 Tiles become gibberish
- 4.5 Maximum number of cached items
- 4.6 Maximum number of sprite images onscreen
- 4.7 Maximum number of affected tiles
- 4.8 Cannot place Keyholder pointers, Switch pointers or [B] sprites on animating tiles
As noted these are errors that show a message, but allow the player to continue, though not without consequences.
Insufficient Memory to play music
This error occurs when after all the level and graphics have been loaded, there does not remain enough free memory to load the IMF music file selected for that level. The solution is to either use a smaller music file for the level or free up memory.
This error is both easy to diagnose and remedy. The first step is to load the level with the error. Using the memory test cheat (F10 + M) the amount of free memory without the music can be found. This can then be compared with the size of the IMF file needing to be played to give a good estimate of how much extra memory needs to be freed up. If a smaller music file is not desirable or cannot be found then more memory will have to be freed up. This can be constantly checked with the memory cheat.
There are three main ways to free up memory. The first is to physically shrink the level's size; each tile removed will free up six bytes of memory, so trimming a large level can save a lot. This however is often not preferable.
The second method is to lessen the number of different tiles in the level (This is why TED5 has a function to tell you how many there are.) each background tile will save 128 bytes and each foreground tile 140 bytes of memory. Again this may not be preferable, but a large level often contains many tiles that do not really add anything to it.
Finally certain sprites may be removed. Each sprite caches all its graphics into memory so it can display them A sprite can easily take up tens of kilobytes of space, the larger and showier it is, the more memory it needs. To remove a sprite cache, all instances of the sprite must be removed from the level, not one can remain.
A related solution is to edit the graphics, either making them smaller, or changing how many copies are placed into memory. (In theory this will make the sprite move less smoothy, but this is often hard to see.) This can halve or even quarter the amount of memory the sprite needs to run.
|Patch: Insufficient memory to play music|
Not enough memory to load game
This error occurs quite simply when a saved game demands more memory than the game has. This usually happens if the game was saved in a different mod or different version of the same mod. In this case it is not the saved game or even necessarily the mod that is broken, there is simply an incompatibility between the conditions the game was saved in and the conditions it was loaded in. Even the smallest change can cause this. Working only with games saved in the most recent version of the game should fix this.
If this occurs in a completed or stable mod then it points to deep and unpredictable errors that can be difficult to fix. The best strategy is simply to attempt to discover what conditions cause this to happen, starting with which level\difficulty then looking for more specific subconditions such as the presence of a certain sprite.
There are two situations in which this error can arise and in Keen 4\6 they use different text. In Keen 5 they use the same text.
|Patch: Not enough memory to load game error|
Insufficient Memory to load level
This occurs when a level is too large to be played. It relates entirely to the size of the level. A good 'large' size for a level is 100x100 tiles, (See also level size limits in the 'other limitations' section.) A level that is much larger than this, in area (Height * width) will exceed the memory allocated and be unable to load. the only way to resolve this is to reduce the size of the level.
At present the exact maximum size of the level that can be loaded is unknown. however it also affects sprites and background music, for both of these to load (In that order.) there must be enough free memory after the level has been loaded.
If the levels do not trigger this error then the code space may be used for other things.
|Patch: Insufficient memory to load level error|
As mentioned, these errors cause the executable to crash, leaving the user at the command prompt with technical details of the error.
Null pointer assignment
This is a bizarre error that sometimes appears when the game is exited to DOS or when something is massively wrong. It can be overlaid with gibberish and usually only the first line appears. It appears to be inserted by the C++ compiler and thus totally unrelated to the game's actual errors.
It is likely this error only appears when something corrupts the game to such an extent that it fails completely. (Its appearance when the game is quit may be due to the game not being able to shut itself down correctly.) There is little that can be done to mitigate this error.
|Patch: Null pointer assignment text|
Missing a text file
This error is displayed when a vital external file is missing from the game directory. It is mostly encountered in Keen 1 where all the game texts are external but can also appear when things like the Finale file are absent. This can happen if the filename the game searches for has been altered or if the file itself is missing.
|Patch: Missing text file error texts|
This error occurs while starting the game when the game cannot access one of the files it needs. This may be because the disk drive has been disconnected, is read only or broken. This error was much more common in the days of floppy disks and is not expected to occur on modern systems.
The first error is the initial message which allows the player to attempt to correct the problem. The second error is displayed after the first if problems continue or if 'abort' has been selected. The third error indicates that the game is aborting its attempt and will shut down.
|Patch: Disk error texts|
Can't open files errors
These errors occur when a vital file cannot be opened. There are three possible causes for this; firstly the file's filename has been overwritten by a patch, secondly the file itself may have been deleted or renamed and thirdly the file may be restricted by the operating system. (Having read only properties for example.)
If the last two causes can be ruled out (They are easy to check.) then removing recent patches to test for conflict is the best way to test for the problem.
|Patch: Can't open files errors|
In Keen 4 the game contains code both to check for EGAGRAPH and if it is not found to create it from two files, EGA1.CK4 and EGA2.CK4. Keen 5 has the code but it is defective, and Keen 6 does not have this ability at all. The only error that should appear is the "Can't open EGAGRAPH.CK4!" if the EGAGRAPH file is absent or its name has been patched and a matching file is not present.
|Patch: Check for EGAGRAPH|
All errors involving 'RF_MarkTileGraphics' are errors with tile animation. They are patch problems that result when a modder produces a corrupt TILEINFO.CKx file. This error is the best result as it provides information about both the problem and the tile responsible. The worst case scenario is that the game freezes.
There are three types of error and six possible errors (Five in Keen 5); three for background and three for foreground tiles. Each type of error is as follows.
Too many unique animating tiles: Animating tiles require extra memory on top of what is needed for their graphics. When too many different types of animated tile are in a level then this memory will be overrun and the level will not be playable. The solution is to remove some kinds of animating tile from the level. (All instances of a tile must be removed, which is why TED5 has a feature to count the number of different tiles in a level, if even one tile of type x remains, type x will still be loaded into memory.)
If this error occurs during play, not at the start then the problem is with how many animating tiles are appearing at once; no more than 24 animating tiles of any kind can appear in play (Onscreen or within 2 tiles of the screen borders) at one time.
Note that in Keen 5 the same text is used for both the background and foreground error, in the other Galaxy games different texts are used.
Anim of 0: This occurs when a tile animates to tile 0. Since tile 0 is a special case (No tile) this cannot happen. It is the easiest error to fix as the offending tile will be at the top of the tileset, within the first 128 tiles. The offending tile must be made to animate to another tile or not animate at all. This error is rare as it requires a modder to deliberately set tile 0 as an animation target.
Unending animation: This occurs when a tile animation is not a nice neat loop. It is rather common as there are many ways a modder may unintentionally cause it. The first possibility is that a tile that animates (Has an animation delay) does not have anything to animate to, this can happen if part of an animation loop is removed or not set in the first place.
The second way this may happen is if two tiles are set to animate to the same target and both 'start' tiles are present in a level. Like two cars trying to park in the same space, they clash.
If a modder is conscientious they will have kept a record of what they have done before the error so that they have a good idea as to what tile may be the problem. If not there may be some guesswork. The tile error might well give a tile number, but this is hard to pin down as it is a 'chunk number' and needs a certain value removed from it to give the actual tile number. In desperate situations it is possible to back up levels and delete the newest parts of them, stopping when the error stops/ (The tile can then be identified, fixed and the backed up levels restored.)
|Patch: 'RF_MarkTileGraphics' errors|
This error occurs when too many animated tiles are shown onscreen at once. There is only a limited number of tile frames available for animation and this can be exhausted by many animated tiles being onscreen, an animation loop having lots of different tiles in it, or both.
The most common cause is too many tiles, removing any large blocks of animating tiles from the level will fix this.
|Patch: RF_CheckForAnimTile error|
This error occurs when an animated tile is set to animate to a tile that is not in fact in the tileset. Using standard modding tools this should be impossible but it may occur if data becomes corrupted or a patch interferes with things. The error can be checked for in three ways; by backing up levels and removing layers, then individual sections of tiles to see what the 'bad tile' is; by removing recent patches from the patchfile or by using an earlier version of the tile properties to see if that file was corrupted.
|Patch: RFL_AnimateTiles errors|
This error is triggered when a level contains too many unique tiles to fit into memory. This includes regular and animated tiles, all of which must be cached before the level loads. The only way to avoid this error is to edit the level to not contain so many unique foreground or background tiles.
These are tileinfo errors that occur when the game encounters a tile that has values for either its left or right sides that are not 0 or 1. (Pass or block.) It will occur when the Wall Debug cheat (F10 + Y) is used in a level containing a problematic tile. The number of the first tile that has this problem will be given with the error, allowing quick identification and fixing.
It is possible for this to occur via bugs in the program used to edit tileinfo or by a patch being placed within the tileinfo segment of the game. In this case it will always appear in a similar situation and depend on specific tile(s). If a nonsensical number (Say 0 or a negative number.) is given as the affected tile, or the tile number keeps changing randomly or is not given at all, then it is possible the bug is a 'scrambling error' caused by a patch in another area of code becoming scrambled and accidentally referring to the error code. In this case testing of recent patches may solve the problem.
|Patch: WallDebug errors|
This is an issue with a sprite's clipping; specifically it is trying to use a clipping of 2 (Full clipping to walls\slopes) when it can't. Most sprites use a clipping of 1, allowing them to move up slopes but not into walls. Some sprites however like the Dopefish need to avoid sloped tiles altogether and thus use a value of 2. But this has very limited usability.
This error usually occurs when an 'ordinary' sprite is given the wrong clipping but can also occur if something goes severely wrong and a sprite gets muddled. To identify the error make a test level and add sprites in one-by-one.
|Patch: FullClipToWalls errors|
Object with bad state
This error occurs when a sprite's 'state' doesn't make sense. This can be triggered by a number of things but usually means that a patch has become garbled and caused a sprite to have values for things that it shouldn't. To identify the error make a test level and add sprites in one-by-one.
|Patch: Object with bad state errors|
Tried to load a non existent map
This error occurs when the game tries to load a level that doesn't exist. While it is possible for a patch to corrupt the map header data this is not common and instead it usually involves an error by a level editing program or the patches required to play custom maps. See Patch:GAMEMAPS.
|Patch: Tried to load a non existent map errors|
Map is too tall
This error can occur under two circumstances. The first, which is very rare, is when the map is literally too tall, over 200 tiles high. Such a level will already be suffering from the 'level size limit' bug in the 'other limits' section.
However the most common appearance of this level is an accidental triggering when using TED5 as a level editor. TED5 can compress levels (Carmackize them) and Keen Galaxy games require this. If the levels are saved but not compressed (Which takes time unless Instant Carma is used.) then the game sees nothing but gibberish and crashes with this error. Checking that levels are carmackized is the first step to solving this.
Similar situation will also cause this bug, if level data has become corrupt, if the MAPHEAD.CKx file is corrupt or not the right one for the levels or not patched correctly. Such situations can be aggravating and underlie the need to backup regularly.
|Patch: Map too tall error|
Maximum map height limit
This patch alters the maximum map height. For Keen 4 and 6 this is 200 tiles, for Keen 5 however it is 250 tiles. Increasing the limit will cause problems; for Keen 4 and 6 maps taller than 200 tiles cause 'flicker errors' where lines 200-204 start to overlap with the top rows of the level. (The rest of the level is playable.) Levels taller than 250 tiles confuse Keen's location and will result in 'insta-wins' when the player enters the level.
|Patch: Map height limit|
Insufficient memory to load map level
This error is identical in nature to the 'unable to load level' error, except that in this case it is the map level that cannot be loaded. Since a lot of important things are also done at this point, the game cannot simply throw up an error, but must crash. The solutions are the same as given in the level error section above.
|Patch: Keen 4|
This error occurs when the modder has placed too many scrollbars in a level. It should always happen when first entering a level. The error will explain which type of scrollbar is at fault, vertical or horizontal. The only solution to this is to remove scrollbars from the level until the error stops occurring.
If all scrollbars are removed yet the error recurs then it is a patch error and the entire patchfile must be checked.
|Patch: Scroll bar errors|
This error appears to relate to scroll blocks and may occur if a scroll block has been corrupted and is neither vertical or horizontal. however this is only conjecture.
|Patch: RFL_NewRow errors|
No free spots in Objarray
This error occurs at the start of a level when there are too many objects (Enemies, keys, etc) in a level. The 'object array' can only hold 100 different objects, that is things in layer 3 of the level (Not tiles of any kind.) and this is why TED5 has a feature to show how many objects exist in the level.
The object array is a specific amount of memory set aside for any object placed in the level that stores its properties. All objects thus use the same amount, one entry, in this array. Therefore the only way to rectify this error is to remove objects from the level, starting with the least significant. (Such at point objects, but not point tiles.)
This error is included in Keen Dreams, but is called a 'sprite array' error, see the below section. In Keen Vorticons the level will simply crash on loading. The limit in Vorticons is 76 sprites or fewer per level.
|Patch: Object array errors|
Don't crash, just don't spawn sprites
These patches avoid crashing the game and notifying the player. Instead the game simply doesn't spawn the extra sprites. However since this occurs at the start of a level it will mean that anything that creates a new sprite will cause a 'sprite array' crash unless that is also patched out. (See section below.)
If the sprite array error is also dealt with the level will still play oddly, Keen will be unable to shoot and points will not show when items are obtained. This will happen until enough objects have been destroyed to free up some array space. The level will also be missing the 'extra' objects, those at the bottom and right corner of the level.
|Patch: Remove object array errors|
No free spots in Sprite array
This error occurs for the same reasons as the error above; there is no space in the sprite (object) array for new sprites to be placed. However it differs in that it occurs in the middle of gameplay, not when the level is loaded. In other words it occurs when existing sprites that fit into the sprite array produce a new sprite that can't.
This will happen if any sprite shoots a projectile that isn't destroyed or shoots fast enough that about 60 new sprites can be onscreen at once or if a marginal level produces just one or two extra sprites. This can be checked using the Count objects cheat included in the game for just this purpose. The total number of objects in a level should not exceed 70 or so. If the count is high at the level start, this means the level is dangerously marginal and some objects should be removed from the map. If not then it is a production\disposal problem and regular checks of the count will keep the modder informed as to what is going on.
In Keen Dreams this cannot occur as the game prevents new sprites being produced when the object array is full. This is a surprising feature. However wen this error does occur, it is not a sprite array error but an object array error, triggered at the level start. (See above section.) Only the wording is different.
|Patch: Sprite array error messagess|
Don't crash, just don't spawn sprites
These patches avoid crashing the game and notifying the player. Instead the game simply doesn't spawn the sprite. This can have interesting effects. For example, when the sprite array is full Keen can shoot but no shot will be produced. Likewise item point indicators will not appear. This may be a worthwhile tradeoff if a modder is confident no serious issues will occur. (Say if a large level has one isolated point where too many sprites appear.)
|Patch: Remove sprite array errors|
Placed uncached sprite
This error occurs during gameplay when an object tries to use a graphic image that wasn't cached at the level start. (See Animations and Sprite cache for an explanation of this.) This is annoyingly common when advanced patching is involved and enemies, etc are using animations they did not originally.
The error comes with a number, which is useful if the modder is using Keengraph as it will be the same number as the sprite bitmap that was trying to be loaded, usually allowing the modder to check, identify the sprite at fault and alter their patch file accordingly. In Modkeen this is not possible as the sprite bitmaps are not numbered as the game numbers them.
|Patch: Placed uncached sprite error|
These patches cause the game to ignore the uncached error. Instead of crashing the game will display gibberish on the screen where the uncached sprite should be. (In severe circumstances this will cause the game to freeze.) This may be of use when debugging or if the error is hard to eliminate and intermittent.
|Patch: Ignore sprite errors|
Tried to remove the player
The game tracks a certain sprite (The last Keen-type sprite encountered when loading sprites from the level map.) as the player. The screen will follow it, it will die when the 'kill player' code is called, etc. While other sprites can act like the player, they are not special and can be removed, destroyed, etc. However if due to a certain patch the player sprite is set to action=0 (Nothing, that is, removed from the level.) then the game will crash as it does not have a way to pick a new player sprite.
This is always a patching error. It usually occurs when two sprites collide. As an example, setting Keen's sprite type to 3 (The same as his shot) will cause Keen to stun enemy sprites and vanish. The only way to solve this problem is to check the patch file for any patches that may be causing a problem.
|Patch: 'Tried to remove the player' error|
Removing player loses level
This patch alters the game code so that trying to remove the player automatically loses the level, as it would if Keen died. This can allow a unique method of dying in addition to the regular types and is less frustrating than a game crash. By altering the level state value highlighted in blue the game can do other things, such as win the level instead.
|Patch: Remove player loses the level|
This is a graphics error that occurs when the modder has written an incorrect sprite shifts entry in SPRITES.TXT (Modkeen) or LIST.TXT (Keengraph) and imported it. This relates to the number of sprite shifts, or how smoothly a sprite animation can move in the level. it can be 1, 2 or 4, but no other number. This number is the last number in every sprite entry in the text file. This error will only occur when an incorrect sprite animation is called, which will help narrow down the search.
|Patch: Keen Galaxy and Dreams shifts errors|
No star specs for object
This error occurs only in Keen 6 and is encountered when the game is not told where to put the stun stars when a sprite is stunned. Notably, changing the Nospike's sprite type will cause this to happen whenever one is stunned or falls off a cliff.
This error can be fixed by patching the relevant entry for the stunned sprite star position to $1A6CW or another valid value.
|Patch: Keen 6|
SpawnShot - Bad dir
This error technically occurs because the player has produced a shot that is moving in an illegal direction (Say up and down at the same time.) In practice this will appear only due to patch errors corrupting the shooting code. (Around $E500) The only solution to this is to check each patch, especially recently added patches to see if this fixes the error.
|Patch: Spawn shot errors|
Walk: Bad dir
This error is specific to Keen 5 and occurs when a Shikadi Mine moves in an 'incorrect' direction. This should only occur if the default Shikadi Mine code has been tampered with somehow or another patch is massively incorrect.
|Patch: Shikadi Mine error|
Keyholder points to bad spot
This error should occur when the player tries to place a key gem to open a door. It occurs when the keyholder does not have a correct sprite value over it. usually this happens when the modder forgets to put a value in, giving a default value of 0,0. Other invalid values are those outside the level borders. This error is easy enough to fix since there should only be a small number of keyholders in the level to check for validity.
This error may also occur if a 'hidden' keyholder is triggered, say if the modder accidentally gives a tile the keyholder property. (The hidden holder will of course not be given a value and can be hard to find until the player accidentally runs into one while having the right colored gem.)
In either case the best course of action is to play the level and note exactly where the game crashes. This will be the exact location of the broken keyholder.
|Patch: Keyholder errors|
Ignore error, door fails
These patches ignore the 'bad spot' error, simply aborting the door opening sequence. This means that while Keen can place the gem but no door sprite can be created. This allows 'pointless' keyholders to be placed that take gems but do nothing.
|Patch: Ignore Keyholder errors|
StartMusic - Bad level number
This error occurs when a song is started. This is usually when a level is entered, but may also be when something else changes the music, the ending sequence for example or rescuing an Oracle Council member. StartMusic works by taking a value (3 say) then looking at the level music list and reading that music entry from it to play. (Why it doesn't just take a music value directly is unknown.) See Patch:Music.
There are two sources of error that may cause this. In the first the entry in the level music list is for a song that doesn't exist. (Say song 300.) Obviously playing a nonexistent song is impossible. The second cause is if the game is told to play the song of a nonexistent level. This can happen when the background music for say, the ending sequence is set to a nonexistent level (Again, say level 300) Both of these errors will involve a problem in the music patch.
It is also possible a faulty sound file will cause this problem, but this is unlikely.
|Patch: 'StartMusic - Bad level number' error|
These patches cause the game to ignore the error. The first set cause the game to play no music at all- silence. The second causes the game to continue playing the song it is playing when the error occurs. (This can still be silence if the game has called StopMusic before attempting to switch to the erroneous song.)
|Patch: Ignore bad level number, play silence|
|Patch: Ignore bad level number, don't switch song|
There are two possible errors in the 'MM Set'; Purge and Lock. Both are caused by massive memory problems and are often symptomatic of patching errors. 'Purge' errors deal with trying to clear things from memory to 'make more space'; This error often occurs aside from patching when a level contains two many memory 'blocks' and there is not enough space in the memory block array to store more. This is a combination problem as background tiles, foreground tiles, sprite images and bitmaps all add together to take up memory block space. The easiest way to remove this error is to 'simplify' a level, often by removing rarely used foreground or background tiles.
When patching is an issue (Say the problem only appeared after a new patch was added.) purge errors occur most often when an exceptionally long string of text is loaded somewhere expecting a short string, such as a level name. This is similar to the 'string exceeds width' error above, but moreso. This often happens when a terminal $00 is left out of a text patch, mixing two strings into one big one.
Purge errors can also occur when a non-level music call asks for a song that doesn't exist. For example, if theending sequence song is set to level 3's music, and level 3 plays song 99 (Which doesn't exist.) then entering level 3 will cause a song error, but winning the game will result in this error. (If the game can be won without entering level 3, then the player will not encounter any error before this one.)
Lock errors involve the game trying to load something into memory that it shouldn't. It's hard to cause, and hard to fix.
|Patch: Keen MM_Set errors|
String exceeds width
This error occurs when a text window is given a line of text too wide for it. This is nearly always the result of a text patch, usually when a $0A or $00 is left out, resulting in one long, wide line of text. Close checking of text patches will often show the problem.
This error can also occur when inputting text into the star wars story screen, in this case the cause is identical, one of the lines of text in the story is too wide and must be reduced. The maximum width of a line of text is approximately 24 characters (Or "123456789012345678901234" for reference when patching.), but this varies with what characters are used.
|Patch: String exceeds width error|
These patches cause the game to ignore the width error. Instead of crashing the game will simply not display any visible text. This may be of use when debugging or if the error is hard to eliminate and intermittent.
|Patch: Ignore 'String exceeds width' errors|
These errors should be encountered while using the Computer Wrist or in the ending sequence. They occur when something is wrong relating to the text in these sequences. They will be triggered when the offending sequence is loaded, meaning that each page in the sequence will have to be scanned for possible errors.
The first error, the word limit, occurs when too much text has been placed on a single page. The word limit is such that in order to trigger this error the text will have to spill off the bottom of the page. It usually occurs when two pages are accidentally merged when modding the page text document.
The second error, 'Text not headed with ^P' occurs, as would be expected, when text in a page does not start with '^P' This can occur if the sequence document does not start with '^P', but usually occurs when a page that is not the last page in the sequence has no text on it at all; this confuses the parser into thinking the next page has no '^P' header.
The third error, "No ^E to terminate file" occurs when the text in a chunk does not end with '^E'. All text chunks must end with this to tell the game when to stop reading data. This however may occur with a perfectly fine chunk in the Keen 4 ending sequence if the wrong chunk is used. Due to a unique bug only one specific text chunk can be used to end the game.
All these errors can only be corrected by a modder looking at the offending text document.
|Patch: Keen PageLayout errors|
These two errors relate to file sizes, specifically when the game tries to load or create a file that has a chunk in it larger than 64K. This is actually quite rare and usually occurs after a bad import. They can also be triggered by code getting garbled and accidentally loading two files instead of one. It is most commonly encountered in the Computer Wrist or ending sequences if they are laid out incorrect. FarRead is by far the most common of this pair of errors.
This error is very rare and occurs when the Main Menu is asked to do something it cannot, such as save a game when no game is being played. Getting this error is a sign that some patch has gone severely wrong, interfering with the menu code around $19000-$1C000. The only solution is to make a note of what circumstances cause the error and check the patch file for patches that fix the error when removed.
|Patch: USL_ConfirmComm errors|
Demo loop exited
This error occurs when something goes wrong with the demo loop in Keen Galaxy or Dreams. The exact sources of error vary but are usually a corrupt demo file or a problem with the demo loop code. Checking demo files and demo patches is a good way to debug this.
|Patch: Demo loop exited error|
Demo buffer overflow
This error occurs when something goes wrong with the demo cheat in Keen Galaxy or Dreams. Specifically it occurs when a demo is recorded for too long, exceeding the amount of memory available for storing a demo file. The solution is to stop recording a demo before this happens. If this does not occur during demo recording then it is due to a random patch corrupting the game.
|Patch: Demo buffer overflow error|
Demo playback exceeded
This error occurs when trying to play a demo that is too large for the memory set aside. It is thus similar to the above error except that it occurs when a demo is being played rather than recorded. This should not be possible however if a demo chunk is corrupted or was recorded under different memory conditions than the demo is being played back then it is possible that this error will occur. The only solution is to use a smaller\shorter demo chunk for this demo. If this error occurs no matter what demo is used or outside of the demo loop then it is due to a random patch corrupting the game.
|Patch: Demo playback exceeded|
These errors relate to the 'cache level' of the game. This is a value between 0 and 7 that controls what resources are being loaded or cleared from memory. As an example, when Keen enters a new level that level's sprites and tiles must be loaded into memory a a certain cache level. When he exits the level they're unloaded. But more vital things like the game's fonts are not altered when this happens.
This error results from an 'imbalance' in code; normally anything that loads stuff into memory has an equal and opposite bit of code that will unload it. However a patch can overwrite this. If unloading is disabled the game will eventually run out of cache levels (down past 0), conversely if loading is disabled vital game resources can be unloaded. (up past 7.)
The only way to test for this error is to remove patches from your patchfile and see if it still occurs.
|Patch: CA_UpLevel\CA_DownLevel errors|
Out of memory
These errors occur when the game runs out of memory. In many respects this is a 'general error' expected to occur whenever something goes wrong. In Keen 1 all these occurrences are separate, (for example the third error occurs when the LZW compression goes awry.) but in the other two Vorticons episodes the errors all redirect to the same area of code with only one error message for efficiency.
|Patch: Out of memory errors|
These errors occur when the game is given a 'bad pointer'; that is an address for some code. There are two kinds of pointer, 'think' and 'contact', the difference between which is not important. These errors usually occur when a massive patch error has occurred causing the game to become completely lost. It is the least specific game error and one of the hardest to pin down.
|Patch: Bad pointer errors|
Error during code expansion
These are Keen 1 errors. The first error appears during LZW decompression when the code encounters nonsense data. As the only way this can occur is corruption of the original LZW compressed file this error should never appear on modern systems.
The second error occurs when the decompressed code uses up all available memory and also often occurs when nonsense data is encountered, causing the expanded data to be very large. It too is unlikely to appear on modern systems. (However identical errors occur in other situations. See above sections.)
|Patch: Keen 1|
These errors cause the game to freeze, and sometimes cause the music to stick on a single note. The game is unresponsive and must be closed down. These are also known as 'divide by zero' errors after their most common cause. There is no way to tell what the error is except via context, timing and trial and error. As such the following subsections describe the cause of the error, not any sort of message the player may get.
Game freezes at ONE MOMENT image
This error occurs in Vorticons and is when the game freezes, often with a display of gibberish, at the One Moment screen. This is usually caused by a corrputed data file, usually the SCORE.CKx file, but possibly a *TEXT.CKx file or CTLPANEL.CKx file. Deleting or replacing these files should solve the problem.
If the screen fills entirely with gibberish then what has likely happened is that there was no valid one moment graphic in the graphics file. This may have been due to graphic modification or a patch that changes what bitmap is used. (If the game can be run without the patch file but still freezes it is the second option.)
Level freezes just after loading
This error occurs when the game freezes shortly after entering a level, usually less than ten seconds after. It does not matter what the player does, though the freeze can be delayed by going to the main menu or checking the status window.
The cause is an animating tile that animates to a non-animating tile. The game tries to animate this tile infinitely fast, freezing the game. This is usually a tileinfo problem and can be resolved by fixing the errant tile. There are two ways to do this.
The first is to check the tileinfo by carefully going over ll the tiles used in the level and checking them. This may miss the tile.
The second is to remove tiles from the level until it no longer freezes, then adding suspect tiles back to see if the error returns. This is often more reliable, but requires the modder to back up their game maps.
In rare cases there will be just one too many animating tiles in a level. (See freeze with music, below.)
Level loads to black screen
This error occurs when a sprite is behaving improperly. Usually this is the player sprite or something in the sprite's initiation or spawning code, since it occurs immediately after the level loads. The most common cause is the modder not putting a player sprite in the level (for example mistaking the 'I' Keen helmet for the actual player sprite.) Levels can be debugged by checking the player sprite is present, and if the error persists, removing sprite types from the level one by one and seeing when functionality is restored. (The affected sprite can then be checked over.)
Level loads to black with music
While this can happen due to a bad behavior (As above.), it often occurs when there is one too many animated tiles in the level. The game freezes when the tile tries to animate. This is a very borderline case, enough to be exactly at the limit and cause problems, but not enough to cause the game to crash with an error. It can be confirmed by adding another, unique animated tile to the level and seeing the corresponding crash. To solve this simply remove the least needed animated tile from the level.
This is sometimes caused by a sprite behavior issue (See 'freezes just after loading' above).
Level loads to gibberish or gibberish appears while loading
This is usually a patch error, but may, in rare circumstances be a level error (See the 'other limits' section below.) In short the level has loaded as gibberish, causing the game to display nonsense.
The first step to fixing this is to check if only one level is affected, if all levels are affected this is likely a patch problem. If only one level is affected it may be a patch relating to a sprite appearing only in that level. Otherwise it may be a game limit bug.
If the level is in Vorticons and complex enough it may be that the sprite limit has been reached. In Vorticons only 76 ordinary sprites can be placed in any one level. If this limit is exceeded when the level starts then the level will turn to gibberish and crash. In some level editors this is easy enough to check by adding up all the sprites.
These are not errors as such, or have no way for the game to handle them, but are limitations that the modder may not be aware of. In some cases it is possible to circumvent these, in other cases not.
Level height\width limit
In Keen Galaxy and Dreams it is impossible for a level to be wider or taller than 257 tiles. This is because of how the game reads Keen's position. If a level exceeds one of these dimensions (It cannot exceed both) then a large part of the level, though displaying correctly, will be 'uninhabitable' for Keen; he will simply exit the level or die when he enters it.
This is because the game 'wraps the level around' so it thinks that most of the level is negative and thus that Keen is outside it, ready to exit to the world map.
It is also possible for a map to be so large it causes its own 'map to tall' error, but this is unlikely.
There is no way to circumvent this error at present, nor is there likely to be.
Maximum number of sprites
In Keen galaxy an error will appear if the sprite limit is exceeded. (No free spots in objarray for example.) In Keen Vorticons the level will simply crash on loading. (See freeze errors section above.) The limit in Keen Vorticons is 76 sprites.
Forbidden pointer values and gibberish in-level
Due to the way the game's compression works, there are certain values that cannot be used as sprite pointers for doors or switches by naive level editors. This is especially an issue in levels that are 100 tiles wide or wider.
There are three sets of forbidden values that will cause the level to load as gibberish or freeze if placed within it. The first is the value $ABCD which affects the RLEW compression. The second is $xxA7 and the third $xxA8, both of which destroy the Carmack compression of the level. It is unlikely these values will be placed in a level, but it has happened.
Levels saved by Abiathar are invincible to these problems; it performs RLEW compression and escapes Carmack magic values.
Tiles become gibberish
There are numerous conditions when a tile will not display correctly. To see examples of this use the F10 Y cheat in Keen 4 or 6. Such gibberish is actually data from memory where the tile should be.
The first way this may happen is if animating foreground tiles are placed over animating background tiles. Due to the way these work they interfere and result in nonsense. Note that item tiles are animating tiles.
The second way is when a door is not set up properly, a door must consist of a top tile, any number of middle tiles and a bottom tile, all of which must not animate but have animation targets set and be part of a door opening tile sequence (By default four frames long.) If any of these conditions is not met, some or all of the door tiles will become gibberish.
The third way this may occur is similar, but involving bridges and switches, switch tiles must have the switch property and have animation targets but not animate (bridge tiles are the same) They must also loop, so that eventually the bridge or switch can return to its original appearance.
Maximum number of cached items
The maximum number of items the game can cache at once is 1200. This includes sprite images, sounds, tiles, music and other game chunks. Of this tiles are likely to be the largest component. This causes no error, just a game crash.
Maximum number of sprite images onscreen
No more than 60 sprite images can be onscreen at once. This is not 60 sprite, but rather 60 separate sprite image chunks. So a sprite like Keen 4's moving platform which is one single object with several images counts for more than one sprite image. (The Sphereful counts for 5 images for example.)
Maximum number of affected tiles
There is a limit to how many 16x16 tile squares can be updated via scrolling onscreen, having a sprite pass in front of them or animating. Only 90 tiles may do this in any one game loop.
Cannot place Keyholder pointers, Switch pointers or [B] sprites on animating tiles
The animation time of an animating tile is stored in the ifnoplane (sprite) layer of the level. This means that any infoplane value that must sit there for the duration of the level will be deleted if the tile (background or foreground) animates. These things include [B] sprites used for changing the direction of moving platforms and pointers for doors and bridges.