Patch:Keen (Keen 3)

From KeenWiki
Jump to navigation Jump to search

This page contains patches relating to Keen as a sprite in Keen 3. 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 3). 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. Other related pages are Patch:Game start.


Behaviors with their own pages

Some behaviors are complex enough to have their own pages. The following pages relate to a single behavior of Keen in Keen Vorticons in general:


Sprite Behavior

Keen's behavior is complex since he is the most complex sprite in the game, a lot of it relying on keys pressed and the player. As such only a few of his behaviors can be patched.

There are four references to dead Keen, the first stops the camera from following Dead Keen as he flies up offscreen, changing this to any other value makes the camera follow dead Keen. The second is Dead Keen's behavior. The third is unknown. The fourth stops dead Keen hitting other deadly stuff and dying again,, which could make the game loop forever.

Keen 3 in-level

#Stunned
%patch $7C91 [$5553W] #Be stunned until stun time runs out (Stunned Keen)
%patch $5588 [$6F07W] #Standing (Keen recovers from stunning)

#Standing
%patch $67A5 [$6F07W] #Standing (When Keen stands on h/v platforms)
%patch $741C [$6F07W] #Standing (Keen lands on the ground after falling)
%patch $7527 [$6F07W] #Standing (After Keen shoots)
%patch $774E [$6F07W] #Standing (Stopping pogo when touching the ground)

#Jumping
%patch $718E [$7230W] #Starts jump (When Keen jumps)
%patch $67B5 [$7230W] #Starts jumping (When pogo landing while on h/v plats and ball)
%patch $7149 [$7344W] #Falling (Keen falls off a ledge)
%patch $72DA [$7344W] #Falling (At top of jump, screws up if new sprite is bigger than Keen)
%patch $769F [$7344W] #Falling (Keen stops pogoing in midair)

#Shooting
%patch $731D [$74BAW] #Shooting (Shooting right)
%patch $7773 [$74BAW] #Shooting (Shooting left)
%patch $71FA [$74BAW] #Shooting (When shooting and touching sprites)
%patch $7492 [$74BAW] #Shooting (When shooting while jumping\falling)
%patch $76C4 [$74BAW] #Shooting (When shooting while jumping\falling after above)
%patch $71E9 [$74BAW] #Shooting (Unknown use)
%patch $730C [$74BAW] #Shooting (Unknown use)
%patch $7481 [$74BAW] #Shooting (Unknown use)
%patch $76B3 [$74BAW] #Shooting (Unknown use)
%patch $7762 [$74BAW] #Shooting (Unknown use)

#Pogoing
%patch $745F [$756EW] #Pogoing (When Keen presses ctrl+alt in midjump or falling)
%patch $7720 [$756EW] #Pogoing (When Keen pogoes normally)
%patch $71C7 [$76F9W] #Pogoing off floor (Keen starts pogoing)
%patch $765C [$76F9W] #Pogoing off floor (Keen pogoes off floor)

%patch $6AD4 [$789EW] #Camera doesn't follow this (Doesn't follow dead Keen)
%patch $7920 [$789EW] #Keen dies (Behavior used when Keen dies)
%patch $795D [$789EW] #Keen dies (unknown use)
%patch $799F [$789EW] #Keen dies (Don't die if behaving like this)(


Animations

Some animations of Keens don't need to be specified, since they're animation 0. Sadly these can't easily be patched. Keen does not seem to have a starting animation specified for example. In other cases the number of animation frames used seems to be defined in some manner different to other sprites.

Keen's shooting frames are complex, depending on what keys the player presses different frames can be used. This is all unnecessarily complex, however the 'use space to fire' patch (See Patch:Gameplay (Keen 3).) has the result that only the first set of animations matters.

Some patches are not here but are instead located on more specific pages, such as that for Keen's shot.

Keen's animations

#Standing
%patch $7074 [$0000W] #Keen facing right
%patch $707C [$0004W] #Keen facing left

#Walking right
%patch $708B [$0000W] #Walking right
%patch $709A $03    #Frames used -1
%patch $7096 $04    #Animation speed

#Walking left
%patch $70B2 [$0004W] #Walking left
%patch $70C1 $03    #Frames used -1
%patch $70BD $04    #Animation speed

#Jumping
%patch $73D3 [$000DW] #Jumping/falling right
%patch $7D3B [$0013W] #Jumping/falling left

#Pogoing
%patch $761A [$0018W] #Keen pogoing right (Uses next frame when hitting ground)
%patch $7622 [$001AW] #Keen pogoing left (Uses next frame when hitting ground)

#Exiting Keen animation (0, unpatchable)
%patch $77C2 [$03]   #Frames used by Keen exiting -1
%patch $77BE [$04]   #Animation speed

#Other
%patch $983E $8C $00 #Lives left box sprite (Sprite number*16)


Keen's spawn height

Keen spawns 8 pixels lower than where he is placed, because he is not quite two tiles tall. If Keen's sprite height is changed this should also be changed by the same amount.

Keen 3

#Keen's spawn height
%patch $3BAC [$0800W] #Eight pixels down


Sounds

These are the sounds the sprite uses. Since almost all of the sounds in the game can be said to be made by or related to Keen, only the sounds the player sprite makes are listed here. Others should be found on their own patch pages such as Patch:Doors (Vorticons) for the door opening sound. Some sounds are missing.

Keen 3 sounds

%patch $7677 [$0015W] #Bump head when pogoing sound
%patch $7735 [$0006W] #The sound Keen makes when pogoing
%patch $7ADD [$000AW] #Sound for got gun and pogo
%patch $7BFA [$000AW] #Sound for got bullet
%patch $B800 [$001AW] #Hop onto Messie sound
%patch $714C [$001BW] #Keen plummets sound
%patch $70F8 [$001EW] #Keen walk sound 2
%patch $7D65 [$0025W] #Keen's right bullet hits tile and Keen (Keen stands next to and shoots right wall)
%patch $7DD7 [$0025W] #Keen's left bullet hits tile and Keen (Keen stands next to and shoots left wall)
%patch $7E37 [$0025W] #Keen's bullet hits walls sound
%patch $7E83 [$0025W] #Keen's shot hits sprites sound
%patch $7F78 [$0025W] #Unknown uses of shothit sounds:
%patch $7FE5 [$0025W] #Unknown uses of shothit sounds:
%patch $801B [$0025W] #Unused death behavior sound

#Don't make sounds:
%patch $767A $90 $90 $90 #Bump head when pogoing sound
%patch $7738 $90 $90 $90 #The sound Keen makes when pogoing
%patch $7AE0 $90 $90 $90 #Sound for got gun and pogo
%patch $7BFD $90 $90 $90 #Sound for got bullet
%patch $B803 $90 $90 $90 #Hop onto Messie sound
%patch $714F $90 $90 $90 #Keen plummets sound
%patch $70FB $90 $90 $90 #Keen walk sound 2
%patch $7D68 $90 $90 $90 #Keen's right bullet hits tile and Keen (Keen stands next to and shoots right wall)
%patch $7DDA $90 $90 $90 #Keen's left bullet hits tile and Keen (Keen stands next to and shoots left wall)
%patch $7E3A $90 $90 $90 #Keen's bullet hits walls sound
%patch $7E86 $90 $90 $90 #Keen's shot hits sprites sound
%patch $7F7B $90 $90 $90 #Unknown uses of shothit sounds:
%patch $7FE8 $90 $90 $90 #Unknown uses of shothit sounds:
%patch $801E $90 $90 $90 #Unused death behavior sound


Sprite Collision

Keen's collision is especially complex since he must react with nearly all sprite types. As such this is not handled in the way most sprites handle it, but instead what Keen does is read off a list, depending on what the colliding sprite's type is. These are locations in the code to go to. The list starts with the value for type 2 and goes to type 18. This allows you to change what certain sprite types do to Keen, even make up your own code for a sprite.

Each pointer points to a different 'collision' for Keen, so there are multiple collisions, each of which can be patched. Most collisions are exceedingly simple. Simply swapping pointer values can have big effects, for example making the Vortimoms stun Keen.

For patches that alter how Ankh time and\or god mode affect these collisions see Patch:G O D Cheat and Patch:Ankh.

Keen 3

#Where sprite pointer list is
%patch $7C6C {$7CB8W}

#Number of items on list -1
%patch $7C64 [$0F]

#Keen-sprite interaction list
%patch $7CB8 {$7CAFW} #Kill Keen
             {$7C77W} #Stun Keen
             {$7CA6W} #Push Keen
             {$7CA6W} #Push Keen
             {$7CAFW} #Kill Keen
             {$7CB4W} #Harmless
             {$7C6EW} #Pushes Keen, he can stand on it
             {$7CAFW} #Kill Keen
             {$7C6EW} #Pushes Keen, he can stand on it
             {$7CB4W} #Harmless
             {$7CB4W} #Harmless
             {$7CB4W} #Harmless
             {$7CB4W} #Harmless
             {$7CB4W} #Harmless
             {$7CAFW} #Kill Keen
             {$7CAFW} #Kill Keen


Misc

These are patches that do not fit into any of the above sections.


How closely the screen follows Keen

The screen follows the player by moving when the player is a certain distance from the screen boundary. That is, these patches control how close to the edge of the screen the player can get when not at a level edge. The values are in 256ths of a pixel, which is astonishingly precise. (It is best to round values to the nearest pixels, though all default values are rounded to the nearest tile.) Thus the player must be $3000 or $30 pixels (48 pixels, = 3 tiles) from the top of the screen before the screen moves up.

Keen 3

#How closely the screen follows Keen
%patch $6B17 $B000W #Scroll Right lag
%patch $6B65 $9000W #Scroll Left lag
%patch $6BB1 $7000W #Scroll Down lag
%patch $6BFF $3000W #Scroll Up lag