Patch:Exit Door
The exit door found in Keen Vorticons is not a door per se, so much as a tile that when touched lets Keen exit the level. The setup is almost identical in all three Vorticons episodes. When Keen touches the tile (he must be standing to do so.) he will begin walking right, four tiles will be drawn over the level (And any sprites that may appear, and Keen appears to walk behind them, looking as if he is entering the door.
This page covers all patches relating to what happens when Keen touches the tile. Patches relating to what is done when a level is exited, via door or death can be found at Patch:Level exit. Patches relating to the door in Keen 5 that lets you exit the level when you enter it can be found at Patch:Doors (Galaxy)
Exit door tiles
These are the tiles that are drawn over the level when Keen touches the exit tile. By default they appear in a 2x2 square with the top left of the square being the same location as the 'activating' exit tile.
Keen 1
#Exit tiles (These appear during exiting)
%patch $4128 [$00A0W] #Top left
%patch $414C [$00A0W] #Bottom left
%patch $4176 [$008FW] #Top right
%patch $41A0 [$008FW] #Bottom right
Keen 2
#Exit tiles (These appear during exiting)
%patch $6F6A [$00A0W] #Top left
%patch $6F8E [$00A0W] #Bottom left
%patch $6FB8 [$008FW] #Top right
%patch $6FE2 [$008FW] #Bottom right
Keen 3
#Exit tiles (These appear during exiting)
%patch $77CE [$0101W] #Top left
%patch $77F2 [$0101W] #Bottom left
%patch $781C [$00F6W] #Top right
%patch $7846 [$00F6W] #Bottom right
Exit tile locations
This is where the tiles are drawn, relative to the activating exit tile. Values that are 0 by default are not defined, meaning they can't be edited. This limits the movability of the exit tiles. It is possible however to change an h value into a v value and vice versa. In the patch below $F8 is vertical, while $FC is horizontal. All values are in tiles. (The default location of the tiles being 0,0; 0,1; 1,0; and 1,1)
Keen 1
#Locations
%patch $4154 $F8 $05 [$0001W] #Bottom left door tile v location
%patch $418B $FC $05 [$0001W] #Top right tile h location
%patch $41A8 $F8 $05 [$0001W] #Bottom right tile v
%patch $41BB $FC $05 [$0001W] #Bottom right tile h
Keen 2
#Locations
%patch $6F96 $F8 $05 [$0001W] #Bottom left door tile v location
%patch $6FCD $FC $05 [$0001W] #Top right tile h location
%patch $6FEC $F8 $05 [$0001W] #Bottom right tile v
%patch $6FFF $FC $05 [$0001W] #Bottom right tile h
Keen 3
#Locations
%patch $77FA $F8 $05 [$0001W] #Bottom left door tile v location
%patch $7831 $FC $05 [$0001W] #Top right tile h location
%patch $784E $F8 $05 [$0001W] #Bottom right tile v
%patch $7861 $FC $05 [$0001W] #Bottom right tile h
Don't draw exit tiles
These patches stop exit tiles being drawn over the level, useful if you're just plain sick of them.
Keen 1
#Don't draw exit tiles
%patch $4140 $90 $90 $90 #Top left tile
%patch $416A $90 $90 $90 #Bottom left tile
%patch $4194 $90 $90 $90 #Top right tile
%patch $41C4 $90 $90 $90 #Bottom right tile
Keen 2
#Don't draw exit tiles
%patch $6F75 $90 $90 $90 #Top left tile
%patch $6F9F $90 $90 $90 #Bottom left tile
%patch $6FD6 $90 $90 $90 #Top right tile
%patch $7006 $90 $90 $90 #Bottom right tile
Keen 3
#Don't draw exit tiles
%patch $77E6 $90 $90 $90 #Top left tile
%patch $7810 $90 $90 $90 #Bottom left tile
%patch $783A $90 $90 $90 #Top right tile
%patch $786A $90 $90 $90 #Bottom right tile
Exit tile code
The exit tile code begins with a check of the player's current behavior. (This can be different from Keen's behavior causing the 'midair exit glitch'.) If this is not his standing behavior then the remaining code is skipped. This prevents Keen from exiting when not on the ground. (Most of the time.) After this sound $F is played and the player's behavior set to $40EFW, or 'exit walk'. The player's sprite collision is set to $3360W or 'nothing' to prevent the player dying, etc when exiting. Two other player variables are also set.
Keen 1
#Default exit tile code
%patch $44D2 $81 $3E {$6F0CW} [$3867W] {$74} $03 $E9 $009BW $B8 [$000FW] $50 $E8
$7A0FW $44 $44 $C7 $06 {$6F0CW} [$40EFW] $C7 $06 {$6F0EW} [$3360W]
$8B $C7 $40 $40 $A3 {$6F04W} $89 $36 {$6F06W} $EB $79
Keen exiting
By default when Keen exits he just walks right and eventually disappears. This is a whole sprite behavior in itself.
Keen can exit in midair, pogoing, etc
This patch allows Keen to exit in midair, while pogoing and so on. It does this by skipping the 'behavior check' that stops Keen exiting unless he is standing or walking.
Keen 1
#Keen can exit in midair, pogoing, etc
%patch $45B0 [$44DDW]
Behavior check
This is the behavior checked for before Keen is allowed to exit. Note that this is different from the behavior that Keen is currently using; it is stored in Keen's standing code when the arrow keys are pressed meaning that when Keen is walking he can exit. It is possible, via carefully timed jumping to exit slightly off the ground, the 'midair exit glitch'. Changing the behavior may result in unexpected difficulties in exiting.
Keen 1
#Exit player behavior check
%patch $44D6 [$3867W]
Keen's exiting animation
Keen automatically uses animation 0 when exiting, which is very difficult to alter. It has 3 + 1 frames of animation and an animation speed of 4.
Keen 1
#Exiting Keen animation (0)
%patch $411C [$03] #Frames used by Keen exiting -1
%patch $4118 [$04] #Animation speed
Keen 2
#Exiting Keen animation (0)
%patch $6F5A [$03] #Frames used by Keen exiting -1
%patch $6F5E [$04] #Animation speed
Keen 3
#Exiting Keen animation (0)
%patch $77C2 [$03] #Frames used by Keen exiting -1
%patch $77BE [$04] #Animation speed
Keen can exit just by touching an exit tile
This patch allows Keen to exit the level as soon as he touches an exit tile, instead of having to be on the ground when he does so. This will result in him 'walking on air' unless the 'exit walk' is shortened to 0 tiles long.
Keen 1
#Exit level by just touching exit tile
%patch $44D8 $EB
Keen 2
#Exit level by just touching exit tile
%patch $72EF $90 $90
Keen 3
#Exit level by just touching exit tile
%patch $7B10 $90 $90
Invisible when exiting
This makes Keen invisible when exiting; there is still a pause before the level ends, but instead of a walking Keen, nothing is shown.
Keen 1
#Invisible Keen when exiting
%patch $41CD $90
Keen 2
#Invisible Keen when exiting
%patch $700F $90
Keen 3
#Invisible Keen when exiting
%patch $7873 $90
Length of 'exit walk'
This is how long, in tiles Keen's exit walk is, that is, how far right he walks before disappearing and the level being done. By default it is two tiles. In the patch below each $90 shortens this by 1 tile. (And thus halves the walk time.) The patch as given makes it 0 tiles long. (Instant level exit.) This means of course that the maximum length of an exit walk is 2 tiles long.
Keen 1
#Length of exit walk
%patch $44F4 $90 $90
Keen 2
#Length of exit walk
%patch $7308 $90 $90
Keen 3
#Length of exit walk
%patch $7B28 $90 $90
Keen vanishes when he touches the exit tile
This patch (which may cause some side effects) makes Keen invisible when he touches the exit tile, though there is still a pause before he exits the level.
Keen 3
#Keen disappears as soon as he touches the exit; pause before exiting level
%patch $7873 $90
Exit sound
This is the sound Keen makes while exiting. The first patch allows a modder to alter the sound,t he second stops it playing entirely.
Keen 1
#Exit sound
%patch $44DE [$000FW]
#Don't play exit sound
%patch $44E1 $90 $90 $90
Keen 2
#Exit sound
%patch $72F2 [$000FW]
#Don't play exit sound
%patch $72F5 $90 $90 $90
Keen 3
#Exit sound
%patch $7B13 [$0F]
#Don't play exit sound
%patch $7B12 $EB $06
Misc
These are patches that don't fit into any of the above categories.
Exit door is a 'siren'
This patch stops Keen actually exiting the level when he touches the exit door, instead the exit door sound plays. This means whenever Keen is on the exit tile, it makes a lot of noise. (Another way is needed to actually exit the level, such as destroying a Heart sprite.)
Keen 3
#Touching exit tile plays exit sound, but doesn't affect Keen
%patch $7B1A $90 $90 $90 $90 $90 $90