Patch:Keen (Keen 5)
This page contains patches relating to Keen as a sprite in Keen 5. That is, such things as the sprites used, the speeds and sounds. It does not cover patches relating to gameplay such as those that make levels scroll or change keys. Those can be found at Patch:Gameplay (Keen Galaxy). It is divided into sections relating to the various sprite properties the patches involved. Being fluent with various sprite patch pages will help when working with these patches.
As little is known about Keen, there is less information here than for most sprites.
Keen behaviors with their own pages
The following pages have been created for specific Keen actions that have a significant number of patches, necessitating them being kept separate for clarity:
- Patch:Keen bored
- Patch:Keen dying (Galaxy)
- Patch:Keen jumping (Galaxy)
- Patch:Keen look down
- Patch:Keen look up
- Patch:Keen on map (Galaxy)
- Patch:Keen on Platforms
- Patch:Keen on poles
- Patch:Keen shooting (Galaxy)
- Patch:Keen's shot (Galaxy)
- Patch:Keen walking (Galaxy)
This is a complete list of Keen's actions, both in-level and on the map. t provides links to some pages that discuss specific actions in further detail but a discussion of all of Keen's actions is too complex to host on this page.
Actions: $0888W #Keen standing $08A6W #Keen on Platforms $08C4W #Keen looks up (Bored) $08E2W #Keen shrugs 1 (Bored more) $0900W #Keen shrugs 2 $091EW #Keen shrugs 3 $093CW #Keen shrugs 4 $095AW #Keen shrugs 5 $0978W #Keen shrugs 6 $0996W #Keen starts reading book 1 $09B4W #Keen starts reading book 2 $09D2W #Keen starts reading book 3 $09F0W #Keen starts reading book 4 $0A0EW #Keen reads book 1 $0A2CW #Keen reads book 2 $0A4AW #Keen reads book 3 $0A68W #Keen stops reading book 1 $0A86W #Keen stops reading book 2 $0AA4W #Keen stops reading book 3 $0AC2W #Keen looking up $0AE0W #Keen keep looking up $0AFEW #Keen looks down start $0B1CW #Keen looks down $0B3AW #Keen keep looking down $0B58W #Keen stops looking down $0B76W #Keen stops looking down start (Screen has moved) $0B94W #Defunct dead action $0BB2W #Keen dies sprawled (Restarts level if offscreen.) $0BD0W #Keen dies clutched (Restarts level if offscreen.) $0BEEW #Keen shooting horizontally start $0C0CW #Keen shooting horizontally $0C2AW #Keen shooting up start $0C48W #Keen shooting up $0C66W #Keen flicking switches $0C84W #Keen flicking switches $0CA2W #Keen places gem $0CC0W #Keen start interaction with gem holders/ walk-in doors $0CDEW #Keen walks into doors $0CFCW #Keen walks into doors $0D1AW #Keen walks into doors $0D38W #Keen walks into doors $0D56W #Keen walks into doors $0D74W #Keen walks into doors $0D92W #Keen walks into doors $0DB0W #Keen walks into doors $0DCEW #Keen still on a pole $0DECW #Keen going up a pole $0E0AW #Keen going up a pole $0E28W #Keen going up a pole $0E46W #Keen going down a pole $0E64W #Keen going down a pole $0E82W #Keen going down a pole $0EA0W #Keen going down a pole $0EBEW #Keen shooting horizontally on a pole start $0EDCW #Keen shooting horizontally on a pole $0EFAW #Keen shoots up on pole start $0F18W #Keen shoots up on pole $0F36W #Keen shooting down on a pole start $0F54W #Keen shooting down on a pole $0F72W #Keen walking $0F90W #Keen walking $0FAEW #Keen walking $0FCCW #Keen walking $0FEAW #Keen start pogoing $1008W #Keen pogoing $1026W #Keen pogoing $1044W #Keen jumping 1 $1062W #Keen jumping 2 $1080W #Keen falling 1 $109EW #Keen falling 2 $10BCW #Keen shoot horizontally in air start $10DAW #Keen shoot horizontally in air (Make shot) $10F8W #Keen shoot horizontally in air $1116W #Keen shoot up in air start $1134W #Keen shoot up in air (Make shot) $1152W #Keen shoot up in air $1170W #Keen shoot down in air start $118EW #Keen shoot down in air (Make shot) $11ACW #Keen shoot down in air $11CAW #Keen gripping ledge start $11E8W #Keen gripping ledge $1206W #Keen pulls himself up from ledgegripping 1 $1224W #Keen pulls himself up from ledgegripping 2 $1242W #Keen pulls himself up from ledgegripping 3 $1260W #Keen pulls himself up from ledgegripping 4 $127EW #Keen stands back up $137AW #Map Keen standing (clear walking animations) $1398W #Map Keen wait (Maintain existing animation until keypress) $13B6W #Map Keen wave 1 $13D4W #Map Keen wave 2 $13F2W #Map Keen wave 3 $1410W #Map Keen wave 4 $142EW #Map Keen wave 5 $144CW #Map Keen moving
Impossible bullet in Keen 5
This patch allows Keen to perform the impossible bullet glitch in Keen 5. Note that Keen will take his platform stance when performing this trick, which looks even more unusual than in Keen 6. It works by making Keen's shot acquire the Platform sprite property when it hits tiles.
|Patch: Keen 4|
Keen has several sprite collisions used in a variety of circumstances. As such this section does not list the collision values of Keen's actions but instead deals with the more general collision codes.
For patches that affect what collision a specific action uses, see that action's page. (For example Patch:Keen on poles.)
Collision 1 code
This collision, often known as KeenSpriteCollision is used under a variety of circumstances. Keen uses this collision when doing such things as being bored, looking up or down and mooning the player. The collision is exceedingly complex and is notable for using a pointer list that is utterly pointless.
The first section is the 'hub' separating the two basic sprite types Keen reacts to. The first is platforms (Type 6) and the second items (Type 5). Interestingly though the item jump is last, its code is section 2.
The second, largest, section deals with the various kinds of items Keen encounters. The first part deals with how many kinds of items there are; it skips the item code if an item's 'kind' is larger than 12 (Giving a total of 13 different types of item.) It calls a list at $C155 ($AAF0 + $1665W) which in this case is a trivial list pointing to $C0B2 ($AAF0 + $15C2W).
What is done to all item sprites is covered right after the list setup (Line 3 and onwards). First a 'got item' sound is played based on the list located at $30340 + $12BAW = $315FA. Then the sprite's sprite type is set to 1, the 'misc sprite' type. Then its foreground variable is set to 3 so it appears in front of all tiles. (So the player can see all the items they get.) After this the sprite's animation changes based on the 'got item animation list' at $30340 + $12EE = $3162E and the player's score increases by an amount given in the list located at $30340 + $12D4 = $31614. This is the same basic code for all items.
After this code more specific to various types of items is run. On line 6 a check is made for the keygems which adds a gem to the player's gem counter (The first counter is shown, depending on gem this or the next three counters will be affected.) After this a check is made for the 1UP item type which increases the player's life counter by 1. Following that is the ammo type check which increases the player's ammo counter ($6F6CW) by an amount that depends on the difficulty ($6F56W) using a list of values found at dataseg $12B2W. Finally there is a check for the V card item, which if contacted sets the card variable to 1. Following this the last thing done is for the sprite's action to be changed to that of the got item.
The third section deals with platforms. Platforms have no effect if an unknown variable is 0 but otherwise allow Keen to stand on them.
|Patch: Keen Collision 1 code|
Collision 2 code
This collision, often known as KeenOnPolesSpriteCollision is actually used under a variety of circumstances. Keen uses this collision when looking up or down, climbing poles and gripping ledges. The collision is far simpler than the first sprite collision, ignoring many sprite types. Unlike Keen's first sprite collision it doesn't use a pointer list.
The first thing checked for is sprites of type 6, Moving Platforms. If this type is found then the code jumps the next two checks and goes to line 3. The next two checks check for types $0E and $17; types that push Keen around. (The Little Ampton and Korath respectively.) If found then the code jumps to the second section, otherwise the collision ends.
The second section, starting on line 3, is the 'platform section' Keen's clipping is set to 1 and he is knocked back to his standing or falling action depending on whether he is in the air or not. $090B0D6BRL 'Push Keen vertically' is also run so that Keen will be picked up by a passing Platform.
The last section deals with Keen being pushed about by Koraths and Amptons; it is similar to the code dealing with Platforms except Keen's foreground variable is set to 1 and 'Push Keen vertically' is not run.
|Patch: Keen Collision 2 code|
The player's tile interaction, the game tile code is not in fact part of Keen's tile interaction. Instead it is run by the designated player sprite whatever its current tile interaction may be. Keen in fact has several tile interactions depending on what he is doing.
Move switches one tile down
This patch for Keen 5 moves switches one tile down; that is, instead of working at the height of Keen's head they are located by his feet. (Unless Keen is made taller than 2 tiles.) However the patch is not 'complete'; only the animation is moved down, a switch tile is still required at Keen's head height (One tile above where the tile will animate.) However if this tile is made invisible and nonanimating, it will at least appear that the switch has been moved down a tile.
|Patch: Keen 5|
There are two initiation codes, one for Keen facing left and one for Keen facing right. Both are nearly identical except for Keen's starting direction. Both use the same spawning code. The call $0CCB0007RL is used to mark the sprite as the player.
In the initiation code notice the Keen's cache being set ($C7 $06 $C269W $0001W.) Also notice that both initiation codes cache the scoreboard image ($00EBW) separately.
In the spawning code the last blue highlighted value is the sprite action the sprite uses as it proceeds to act in-level. $C7 $02 $xxxxW sets the clipping, $C7 $07 $xxxxW sets the sprite type, $C7 $20 $xxxxW sets the foreground value. Finally $D3 $E0 $05 $xxxx is how far down (Or more usually up) the sprite is spawned from where it is placed. This is necessary for sprites that walk on the ground as they can only be placed in the level at multiples of 16 pixels high while their actual height can be anything.
Keen's horizontal direction depends on his initiation code. (It is the first blue variable.) He always starts the level 'facing down' however, though this is of little importance. $C7 $47 $10 $xxxxW is the vertical direction the sprite starts moving in, either $0001W (Facing down), $FFFFW (Facing up) or $0000W (Neither, never used.) Keen's sprite type is important, if it is not $0002W then he will be invulnerable to enemy sprites since this sprite type is used to identify 'killable players'
|Patch: Keen 5|
Keen's spawn height and changing Keen's height
This simple patch alters how high Keen spawns above where he is placed in a level. By default this is 16 pixels up,suitable for a Keen sprite 32 pixels high. If Keen's height is changed, this should be changed to reflect that. It is part of the above spawning code patch and shouldn't be used in conjunction with it.
|Patch: Keen 5|