Patch:Keen on poles

From KeenWiki
(Redirected from Patch:Poles)
Jump to: navigation, search

This page contains patches that relate to the player on poles, under what conditions the player grabs or lets go of poles and pole tiles themselves. It covers all the Galaxy and Dreams episodes. Other tile patches can be found under Patch:Tiles Other patches relating to Keen can be found under Patch:Keen (Keen 4), Patch:Keen (Keen 5), Patch:Keen (Keen 6) and Patch:Keen (Keen Dreams).

This page is divided into four sections. The first deals with pole tiles themselves, the second deals with grabbing onto poles, the third with falling off of poles and the fourth with the properties of Keen's pole climbing sprites.


Pole tiles

This section deals with pole tiles themselves and not the player's sprite.


Pole tile property

Poles have a 'misc flag' value of 1. This is the only tile property Keen can interact with to start climbing poles. In some games other sprites can interact with it too.

The pole tile type is checked for in several situations, firstly when Keen presses up in front of a pole, but also when Keen is on a pole and presses up or down. These checks ensure Keen 'knows' where the top and bottom of poles are.

Patch: Pole tile property
#Pole tile property -Keen 4
%patch $B8FC $0001W $75
#When gripping poles
#Pole tile property -Keen 5
%patch $ABDE $0001W $75
#When gripping poles
#Pole tile property -Keen 6
%patch $AB12 $0001W $75
#When gripping poles
#Pole tile property -Keen Dreams
%patch $6C6A $0001W $75
#When gripping poles
%patch $7368 $0001W $74
#When trying to move up on poles
%patch $7380 $0001W $74
#When trying to move down on poles
%patch $73ED $0001W $74
#When detecting pole bottoms
%patch $8FF6 $0001W $75
#When Apel grips poles


Starting\stopping pole climbing

This section deals with patches that relate to the conditions under which the player will start or stop interacting with poles.


Player cannot interact with poles at all

The first set of patches simply disables any interaction between the player and poles. The pole related code still exists, but the player cannot utilize it because they cannot start pole climbing. (Other sprites can also react to poles, such as the Little Ampton..)

The second patch is more specific, it stops Keen from being able to grab poles while jumping or falling.

Patch: Disable poles entirely
#Disable poles entirely -Keen 4
%patch $B8A0 $33 $C0 $5E $8B $E5 $5D $CB
#Disable poles entirely -Keen 5
%patch $AB82 $33 $C0 $5E $8B $E5 $5D $CB
#Disable poles entirely -Keen 6
%patch $AAB6 $33 $C0 $5E $8B $E5 $5D $CB

Patch: Disable grabbing poles while jumping\falling
#Disable grabbing poles while jumping\falling -Keen 4
%patch $C4BC $EB


Disable jumping on poles

These patches disable Keen's ability to jump off poles and\or shoot on poles. This means he can only leave poles if knocked off or at the top\bottom of poles.

Patch: Keen 4
#Disable jumping off poles (Frees $C682-$C6D2)
%patch $C680 $EB
#Disable shooting and jumping on poles (Frees $C64F-$C6D2)
%patch $C641 $5E $5D $CB


Keen's pole climbing sprites

This section of the page deals with the properties of the player's pole climbing sprites and is divided into sections for each property. All four games involving pole climbing are included in each section.


Sprite Actions

Keen 4

There are two unique situations where Keen will start climbing up a pole, these lead to a 3-action loop. The loop will stop in two situations; when Keen reaches a pole top or when he stops pressing the up key. Doing either will return him to his 'sit on poles' action.

Likewise there are two situations where Keen can start climbing down poles, leading to a 4-action loop. This will only stop when the down key is no longer pressed or Keen falls off of the bottom of a pole.

When on a pole Keen will keep going to his sitting action if nothing is pressed. Obscurely, Keen can 'walk off' of a pole if he's level with the ground and presses the left or right arrow keys. This will make him fall off the pole onto the ground.

Keen can jump off of a pole, this sends him to the first jumping action. Keen can also shoot up, down and horizontally on poles. Each direction involves a start point, a shooting check to check if Keen is already shooting and two actions to make the shot, returning Keen to sitting on a pole after.

When on poles and thus using his second sprite collision Keen can be disturbed by Platforms or Bounders; in both cases he will revert to his falling action.

Actions
$0EF0W #Keen going still on a pole
$0F0EW #Keen going up a pole
$0F2CW #Keen going up a pole
$0F4AW #Keen going up a pole
$0F68W #Keen going down a pole
$0F86W #Keen going down a pole
$0FA4W #Keen going down a pole
$0FC2W #Keen going down a pole
$0FE0W #Keen shooting horizontally on a pole 1
$0FFEW #Keen shooting horizontally on a pole 2
$101CW #Keen shoots up on pole 1
$103AW #Keen shoots up on pole 2
$1058W #Keen shooting down on a pole 1
$1076W #Keen shooting down on a pole 2


Patch: Keen 4
#Sitting on a pole
%patch $2FD7C $0EF0W
#Head up on a pole
%patch $C6F0 $0F0EW %patch $C8B1 $0F0EW
#Keen going up a pole loop
%patch $2FD9A $0F2CW %patch $2FDB8 $0F4AW %patch $2FDD6 $0F0EW
#Keen stops going up a pole
%patch $C7D3 $0EF0W
#At top of pole
%patch $C7F3 $0EF0W
#Up key no longer pressed
#Keen start going down a pole
%patch $C700 $0F68W %patch $C7FF $0F68W
#Keen stops going down a pole
%patch $C879 $11A2W
#Fall off of pole bottom
%patch $C8BD $0EF0W
#Down key no longer pressed
#Keen going down a pole loop
%patch $2FDF4 $0F86W %patch $2FE12 $0FA4W %patch $2FE30 $0FC2W %patch $2FE4E $0F68W
#Keen jump off of pole
%patch $C6BB $1166W
#Keen walk off of a pole
%patch $C762 $11A2W
#Start shooting horizontally
%patch $C672 $0FE0W
#Shooting horizontally check
%patch $CA82 $0FE0W
#Shooting horizontally on a pole sequence
%patch $2FE6C $0FFEW %patch $2FE8A $0EF0W
#Start shooting up
%patch $C66B $101CW
#Shooting up check
%patch $CAC5 $101CW
#Shooting up on a pole sequence
%patch $2FEA8 $103AW %patch $2FEC6 $0EF0W
#Start shooting down
%patch $C679 $1058W
#Shooting down check
%patch $CB06 $1058W
#Shooting down on a pole sequence
%patch $2FEE4 $1076W %patch $2FF02 $0EF0W
#Be disturbed by
%patch $CE54 $11A2W
#Platforms
%patch $CE8C $11A2W
#Bounders


Keen Dreams

Keen's actions in Dreams are more simple than that of Keen Galaxy. There is only one situation where he will grab a pole, by pressing up while in front of it. When Keen reaches the top or bottom of poles he'll turn into his sitting action, and stop moving. However the code for the bottom of poles is unsed (he'll fall off of them instead), even though it is present.

Actions
$118AW #Keen sit on pole
$11A8W #Keen climb up pole 1
$11C6W #Keen climb up pole 2
$11E4W #Keen climb up pole 3
$1202W #Keen climb down pole 1
$1220W #Keen climb down pole 2
$123EW #Keen climb down pole 3
$125CW #Keen climb down pole 4
$127AW #Keen pole-throw horizontally 1
$1298W #Keen pole-throw horizontally 2
$12B6W #Keen pole-throw horizontally 3
$12D4W #Keen pole-throw up 1
$12F2W #Keen pole-throw up 2
$1310W #Keen pole-throw up 3
$132EW #Keen pole-throw down 1
$134CW #Keen pole-throw down 2
$136AW #Keen pole-throw down 3

Patch: Keen Dreams
#Keen grip pole when pressing up
%patch $6C90 $118AW
#Keen stop moving at pole top
%patch $7374 $118AW
#Keen stop moving at pole bottom (Unused)
%patch $7389 $118AW
#Keen sit on pole when no longer moving down
%patch $7445 $118AW
#Keen fall off pole ends
%patch $73FF $1568W


Sprite Behavior

This section contain patches that relate to what Keen can do while on poles.


Behavior values

These are the values used by Keen's pole actions. There are several behaviors by Keen. Each responds to a different set of commands and conditions. Keen has a behavior for moving up or down poles as well as sitting still on them. When shooting on poles the first action of shooting uses Keen's shooting behavior while the second frame has no behavior (and so just sits there.)

Keen 4 Behaviors:
$0B800ED3RL #Keen on pole (Sit and wait for arrows to climb pole or shoot)
$0B800F89RL #Keen go up poles (Climb with arrow up or sit on pole)
$0B80101CRL #Going down poles (Climb down with arrow or sit on pole)
$0B801195RL #Shooting (Spawn Keen's shot in arrow direction)

Patch: Keen 4
#Keen sit on poles
%patch $2FD70 $0B800ED3RL
#Keen climb up poles
%patch $2FD8E $0B800F89RL %patch $2FDAC $0B800F89RL %patch $2FDCA $0B800F89RL
#Keen slide down poles
%patch $2FDE8 $0B80101CRL %patch $2FE06 $0B80101CRL %patch $2FE24 $0B80101CRL %patch $2FE42 $0B80101CRL
#Keen on pole shoot horizontally
%patch $2FE60 $0B801195RL %patch $2FE7E $00000000L
#Keen on pole shoot up
%patch $2FE9C $0B801195RL %patch $2FEBA $00000000L
#Keen on pole shoot down
%patch $2FED8 $0B801195RL %patch $2FEF6 $00000000L


Keen 5 Behaviors:
$0AAF1001RL #Keen on pole (Sit and wait for arrows to climb pole or shoot)
$0AAF10B7RL #Keen go up poles (Climb with arrow up or sit on pole)
$0AAF114ARL #Going down poles (Climb down with arrow or sit on pole)
$0AAF12C3RL #Shooting (Spawn Keen's shot in arrow direction)

Patch: Keen 5
%patch $3111D $0AAF1001RL 
#Keen on pole
%patch $3113C $0AAF10B7RL
#Keen move up pole
%patch $3115A $0AAF10B7RL
#Keen move up pole
%patch $31178 $0AAF10B7RL
#Keen move up pole
%patch $31196 $0AAF114ARL
#Keen move down pole
%patch $311B4 $0AAF114ARL
#Keen move down pole
%patch $311D2 $0AAF114ARL
#Keen move down pole
%patch $311F0 $0AAF114ARL
#Keen move down pole
#Keen on pole shoot horizontally
%patch $3120D $0AAF12C3RL
#Keen shoot
%patch $3122C $00000000L
#Nothing
#Keen on pole shoot up
%patch $3124A $0AAF12C3RL
#Keen shoot
%patch $31268 $00000000L
#Nothing
#Keen on pole shoot down
%patch $31286 $0AAF12C3RL
#Keen shoot
%patch $312A4 $00000000L
#Nothing


Disable shooting or jumping on poles

These patches disable Keen's ability to jump off poles, shoot on poles or both. (Keen can leave poles by turning left\right at the top of poles or moving off the bottom, so disabling jumping does not lock him onto poles permanently.) See also Patch:Keen shooting (Galaxy). Keen can still shoot while doing other things.

Patch: Keen 4
#Disable jumping off poles (Frees $C682-$C6D2)
%patch $C680 $EB
#Disable shooting on poles (Frees $C648-$C67A)
%patch $C646 $EB
#Disable shooting and jumping on poles (Frees $C64F-$C6D2)
%patch $C641 $5E $5D $CB


Speed

Keen's climbing and descending pole speed is determined entirely by his animation motion and animation speed. Therefore, the faster Keen animates the faster he will climb poles. By default his downwards speed is three times that of his upwards and animation speeds are identical.

Patch: Keen 4
#Keen on pole is still
%patch $2FD6C $0000W $0000W
#Keen climb poles speed
%patch $2FD8A $0000W $0008W %patch $2FDA8 $0000W $0008W %patch $2FDC6 $0000W $0008W
#Keen slide down poles speed
%patch $2FDE4 $0000W $0018W %patch $2FE02 $0000W $0018W %patch $2FE20 $0000W $0018W %patch $2FE3E $0000W $0018W

Patch: Keen 5
#Keen on pole is still
%patch $3111A $0000W $0000W
#Keen climb poles speed
%patch $31138 $0000W $0008W %patch $31156 $0000W $0008W %patch $31174 $0000W $0008W
#Keen slide down poles speed
%patch $31192 $0000W $0018W %patch $311B0 $0000W $0018W %patch $311CE $0000W $0018W %patch $311EC $0000W $0018W

Patch: Keen 6
#Keen on pole is still
%patch $31AA4 $0000W $0000W
#Keen climb poles speed
%patch $31AC2 $0000W $0008W %patch $31AE0 $0000W $0008W %patch $31AFE $0000W $0008W
#Keen slide down poles speed
%patch $31B1C $0000W $0018W %patch $31B3A $0000W $0018W %patch $31B58 $0000W $0018W %patch $31B76 $0000W $0018W

Patch: Keen Dreams
#Keen on pole is still
%patch $24BE8 $0000W $0000W
#Keen climb poles speed
%patch $24C06 $0000W $0000W %patch $24C24 $0000W $0008W %patch $24C42 $0000W $0008W %patch $24C60 $0000W $0008W
#Keen slide down poles speed
%patch $24C7E $0000W $0018W %patch $24C9C $0000W $0018W %patch $24CBA $0000W $0018W %patch $24CD8 $0000W $0018W


Sprite Collision

These are the values of the sprite actions Keen uses when climbing poles. Pole climbing Keen uses his second sprite collision also used by other actions such as gripping ledges. See the linked page for patches that affect that collision code.

Patch: Keen 4 collision values
#Keen sit on poles
%patch $32B74 $0B801632RL
#Keen climb up poles
%patch $32B92 $0B801632RL %patch $32BB0 $0B801632RL %patch $32BCE $0B801632RL
#Keen slide down poles
%patch $32BEC $0B801632RL %patch $32C0A $0B801632RL %patch $32C28 $0B801632RL %patch $32C46 $0B801632RL
#Keen on pole shoot horizontally
%patch $32C64 $0B801632RL %patch $32C82 $0B801632RL
#Keen on pole shoot up
%patch $32CA0 $0B801632RL %patch $32CBE $0B801632RL
#Keen on pole shoot down
%patch $32CDC $0B801632RL %patch $32CFA $0B801632RL

Patch: Keen 5 collision values
#Keen sit on poles
%patch $31122 $0AAF167FRL
#Keen go up pole
%patch $31140 $0AAF167FRL %patch $3115E $0AAF167FRL %patch $3117C $0AAF167FRL
#Keen go down pole
%patch $3119A $0AAF167FRL %patch $311B8 $0AAF167FRL %patch $311D6 $0AAF167FRL %patch $311F4 $0AAF167FRL
#Keen on pole shoot horizontally
%patch $31212 $0AAF167FRL %patch $31230 $0AAF167FRL
#Keen on pole shoot up
%patch $3124E $0AAF167FRL %patch $3126C $0AAF167FRL
#Keen on pole shoot down
%patch $3128A $0AAF167FRL %patch $312A8 $0AAF167FRL

Patch: Keen 6 collision values
#Keen sit on poles
%patch $31AAC $0AA2154CRL
#Keen going up a pole
%patch $31ACA $0AA2154CRL %patch $31AE8 $0AA2154CRL %patch $31B06 $0AA2154CRL
#Keen going down a pole
%patch $31B24 $0AA2154CRL %patch $31B42 $0AA2154CRL %patch $31B60 $0AA2154CRL %patch $31B7E $0AA2154CRL
#Keen on pole shoot horizontally
%patch $31B9C $0AA2154CRL %patch $31BBA $0AA2154CRL
#Keen on pole shoot up
%patch $31BD8 $0AA2154CRL %patch $31BF6 $0AA2154CRL
#Keen on pole shoot down
%patch $31C14 $0AA2154CRL %patch $31C32 $0AA2154CRL


Animations

Pole related animations are cached with Keen's main animations whenever he is placed in a level. They can be broken into several groups. The first is Keen sitting on a pole, the second is climbing a pole, the first frame of which is the same as sitting on a pole. The third group is moving down a pole which consists of four unique animations.

Then there are three shooting on poles groups. Each uses the same animation(s) for its first and second frames and has different animations for whether Keen is facing left or right.

Patch: Keen 4
#Keen sitting on a pole
%patch $2FD60 $00BBW $00B4W %patch $2FD6A $0000W
#Wait for key press
#Keen going up a pole
%patch $2FD7E $00BBW $00B4W %patch $2FD88 $0008W %patch $2FD9C $00BCW $00B5W %patch $2FDA6 $0008W %patch $2FDBA $00BDW $00B6W %patch $2FDC4 $0008W
#Keen going down a pole
%patch $2FDD8 $00B7W $00B7W %patch $2FDE2 $0008W %patch $2FDF6 $00B8W $00B8W %patch $2FE00 $0008W %patch $2FE14 $00B9W $00B9W %patch $2FE1E $0008W %patch $2FE32 $00BAW $00BAW %patch $2FE3C $0008W
#Keen on pole shoot horizontally
%patch $2FE50 $00C2W $00C3W %patch $2FE5A $0009W
#Pause before shooting
%patch $2FE6E $00C2W $00C3W %patch $2FE78 $0006W
#Pause before going back
#Keen on pole shoot up
%patch $2FE8C $00BEW $00BFW %patch $2FE96 $0009W
#Pause before shooting
%patch $2FEAA $00BEW $00BFW %patch $2FEB4 $0006W
#Pause before going back
#Keen on pole shoot down
%patch $2FEC8 $00C1W $00C0W %patch $2FED2 $0009W
#Pause before shooting
%patch $2FEE6 $00C1W $00C0W %patch $2FEF0 $0006W
#Pause before going back

Patch: Keen 5
#Keen sitting on a pole
%patch $3110E $00A6W $009FW
#Sit on pole
%patch $31118 $0000W
#Wait for Keypress
#Keen going up a pole
%patch $3112C $00A6W $009FW
#Go up pole
%patch $31136 $0008W %patch $3114A $00A7W $00A0W
#Go up pole
%patch $31154 $0008W %patch $31168 $00A8W $00A1W
#Go up pole
%patch $31172 $0008W
#Keen going down a pole
%patch $31186 $00A2W $00A2W
#Go down pole
%patch $31190 $0008W %patch $311A4 $00A3W $00A3W
#Go down pole
%patch $311AE $0008W %patch $311C2 $00A4W $00A4W
#Go down pole
%patch $311CC $0008W %patch $311E0 $00A5W $00A5W
#Go down pole
%patch $311EA $0008W
#Keen on pole shoot horizontally
%patch $311FE $00ADW $00AEW
#Pole shoot l/r
%patch $31208 $0009W
#Pause before shot
%patch $3121C $00ADW $00AEW
#Pole shoot l/r
%patch $31226 $0006W
#Pause before stop shooting
#Keen on pole shoot up
%patch $3123A $00A9W $00AAW
#Pole shoot up
%patch $31244 $0009W
#Pause before shot
%patch $31258 $00A9W $00AAW
#Pole shoot up
%patch $31262 $0006W
#Pause before stop shooting
#Keen on pole shoot down
%patch $31276 $00ACW $00ABW
#Pole shoot down
%patch $31280 $0009W
#Pause before shot
%patch $31294 $00ACW $00ABW
#Pole shoot down
%patch $3129E $0006W
#Pause before stop shooting

Patch: Keen Dreams
#Keen sitting on a pole
%patch $24BFA $0091W $008AW %patch $24C04 $0000W
#Wait for key press
#Keen going up a pole
%patch $24C18 $0091W $008AW %patch $24C22 $0008W %patch $24C36 $0092W $008BW %patch $24C40 $0008W %patch $24C54 $0093W $008CW %patch $24C5E $0008W %patch $24C72 $008DW $008DW %patch $24C7C $0008W
#Keen going down a pole
%patch $24C90 $008EW $008EW %patch $24C9A $0008W %patch $24CAE $008FW $008FW %patch $24CB8 $0008W %patch $24CCC $0090W $0090W %patch $24CD6 $0008W
#Keen on pole shoot horizontally
%patch $24CEA $0094W $0096W %patch $24CF4 $0008W
#Pause before shooting
%patch $24D08 $0095W $0097W %patch $24D12 $0001W %patch $24D26 $0095W $0097W %patch $24D30 $000AW
#Pause before going back
#Keen on pole shoot up
%patch $24D44 $0098W $009DW %patch $24D4E $0008W
#Pause before shooting
%patch $24D62 $0099W $009EW %patch $24D6C $0001W %patch $24D80 $0099W $009EW %patch $24D8A $000AW
#Pause before going back
#Keen on pole shoot down
%patch $24D9E $009FW $009AW %patch $24DA8 $0008W
#Pause before shooting
%patch $24DBC $00A0W $009BW %patch $24DC6 $0001W %patch $24DDA $00A0W $009BW %patch $24DE4 $000AW
#Pause before going back


Sounds

There are several sounds that relate to Keen being on poles. The first is played when Keen jumps off a pole, it can also be considered a jump sound. The second is played when Keen moves left or right at the top of a pole and falls off. The third is played when Keen moves down off the bottom of a pole. All three sounds can be blocked.

Patch: Keen 4
#Keen on poles sounds
%patch $C690 $02
#Keen jump off pole sound
%patch $C76A $14
#Keen move l/r off a pole top sound
%patch $C86B $14
#Keen moves of pole end sound
#Don't play sounds
%patch $C68F $EB $0A
#Don't play Keen jump off pole sound
%patch $C769 $EB $0A
#Don't play Keen move l/r off a pole top sound
%patch $C86A $EB $0A
#Don't play Keen moves of pole end sound

Patch: Keen 5
#Keen on poles sounds
%patch $BAAE $02
#Keen jump off pole sound
%patch $BB88 $14
#Keen move l/r off a pole top sound
%patch $BC89 $14
#Keen moves of pole end sound
#Don't play sounds
%patch $BAAD $EB $0A
#Don't play Keen jump off pole sound
%patch $BB87 $EB $0A
#Don't play Keen move l/r off a pole top sound
%patch $BC88 $EB $0A
#Don't play Keen moves of pole end sound

Patch: Keen 6
#Keen on poles sounds
%patch $B891 $02
#Keen jump off pole sound
%patch $B96B $14
#Keen move l/r off a pole top sound
%patch $BA6C $14
#Keen moves of pole end sound
#Don't play sounds
%patch $B890 $EB $0A
#Don't play Keen jump off pole sound
%patch $B96A $EB $0A
#Don't play Keen move l/r off a pole top sound
%patch $BA6B $EB $0A
#Don't play Keen moves of pole end sound


Clipping

Keen's clipping is set to 0 when he jumps onto poles,allowing him to move vertically through solid ground with poles going through it. It must be restored to a value of 1 when he leaves a pole.

Patch: Pole clipping
#Pole clipping -Keen 4
%patch $B921 $0000W
#Pole clipping -Keen 5
%patch $AC03 $0000W
#Pole clipping -Keen 6
%patch $AB37 $0000W
#Pole clipping -Keen Dreams
%patch $6C8B $0000W


Sprite-tile interaction

Keen uses two different tile interactions when on poles. The first is used for Keen 'floating' in various situations and is used when Keen is sitting on a pole or moving up it. The second is unique and used for Keen moving down a pole and involves checks that let him fall off of pole bottoms.

Patch: Keen 4
#Sitting on poles
%patch $2FD78 $0B801A7BRL
#Move up poles
%patch $2FD96 $0B801A7BRL %patch $2FDB4 $0B801A7BRL %patch $2FDD2 $0B801A7BRL
#Move down poles
%patch $2FDF0 $0B802071RL %patch $2FE0E $0B802071RL %patch $2FE2C $0B802071RL %patch $2FE4A $0B802071RL