Patch:Vorticon (Keen 3)

From KeenWiki
Jump to: navigation, search

Vorticons are dangerous grunt enemies found in Keen 3. This page lists patches relating to Vorticon sprites. It is divided into sections relating to the various sprite properties the patches involve. Being fluent with various sprite patch pages will help when working with these patches.

Sprite Type

Vorticons use sprite type 2 which means they kill Keen on contact. They do not otherwise interact with other sprites.

Patch: Keen 3
#Vorticon sprite type:
%patch $3C2B $02

Sprite Behavior

The Vorticon has three behaviors. They can walk\jump, slide along the ground or just walk towards Keen. They chase Keen and can be hard to evade. This is actually achieved in a very simple manner, the Vorticon starts out walking randomly\towards Keen and will randomly jump either normal or 'high' After jumping high it will land and animate so it appears as if it is 'looking' for Keen. After that it will return to walking about randomly.

The first behavior seeks Keen and jumps, the second is jumping\falling\sliding on the ground (In that order) after a jump has started. The third is just standing still and animating, and appears to be the cause of Vorticons sticking into walls.

$414AW #Walk, jump randomly, turn when hitting walls
$4227W #Vorticon fall or slide along ground
$4275W 'Look for Keen'
$42D0W #Vorticon collision

Patch: When spawned
%patch $3C4E $414AW

Patch: In level
%patch $419D $4227W 
#Fall\slide when jumping and hits walls
%patch $4211 $4227W
#Fall and slide after jumping randomly
%patch $4252 $4275W
#'Look for Keen' after landing\stopping sliding
%patch $42C6 $414AW
#Walk, jump randomly after 'looking for Keen'
%patch $3C53 $42D0W
#Vorticon collision

Complete Vorticon search for Keen code

This is the complete code for the Vorticon while searching. On the first line the speed is set to 0. On the second line the animations frames and animation are set. On the third the time the Vorticon searches for and the speed after searching are set. On the last line is the Vorticon's behavior after searching and calls to tile collision and gravity.

Patch: Vorticon look for Keen code
#Vorticon look for Keen code
%patch $4275 $55 $8B $EC $C7 $06 $30 $99 $0000W $A1 $61 $53 $B1 $05 $D3 $E8 $25 $0003W $05 $0041W $A3 $38 $99 $A1 $3A $99 $03 $06 $40 $5D $A3 $3A $99 $83 $3E $3A $99 $50 $7C $29 $C7 $06 $30 $99 $005AW $A1 $16 $99 $8B $16 $14 $99 $3B $06 $0C $71 $7C $10 $7F $06 $3B $16 $0A $71 $76 $08 $A1 $30 $99 $F7 $D8 $A3 $30 $99 $C7 $06 $42 $99 $414AW $E8 $1FE9W $E8 $2029W $5D $C3

Speed and Jump Height

When first spawned Vorticons will head horizontally towards Keen. Their maximum jump height is 300, (Actual jumps will be randomly less than this by various amounts.) and their 'slow' walking speed is +-90. Their 'fast' walking speed is +-120.

Vorticons will stop moving when they land and look for Keen and will bounce off of walls when jumping. It is notable that one speed was given the wrong value, the 'quick left' speed should have been $FF88 but instead was given the 'slow left' speed value.

Patch: Starting speeds
#Starting speeds
%patch $3C78 $005AW
#If left of Keen (Move right)
%patch $3C71 $FFA6W
#If right of Keen (Move left)

Patch: In level
#When walking about randomly:
%patch $41D3 $FFA6W
#'Quick' left speed (Programmed wrong!)
%patch $41F9 $FFA6W
#Slow left speed
%patch $41DB $0078W
#Quick right speed
%patch $4205 $005AW
#Slow right speed
#Jump height
%patch $418D $012CW
#When jumping, falling or sliding across the ground:
%patch $4264 $FFA6W
#Bounce off right walls
%patch $4270 $005AW
#Bounce off left walls
#'Look for Keen':
%patch $427C $0000W
#Speed after landing\while 'searching' (Stand still)
%patch $42A3 $005AW
#Speed when going bask to walking (Right.)

Sprite Collision

Vorticons interact with Keen's and the enemy shots (Including the Vortimom's and enemy shooter shots. This produces a shot Vorticon. (See behavior section.) The shot Vorticon also resets its collision and behavior, the new collision, used for most dead sprites ignores all other sprites, the new behavior likewise is just 'fall an animate'

Vorticons have a 'strength' of 1 that is not readily apparent, but this can be altered. It pays to have some knowledge of Patch:Jump conditions when working with these patches.

Basic patches

These are the bare bones patches relating to the Vorticon's collision.

Patch: Keen 3
%patch $3C53 $42D0W   
#Vorticon collision
%patch $42DC $3D $0F
#Vorticon killed by Keen's shot
%patch $42E1 $3D $10
#Vorticon killed by enemy shot
%patch $3C58 $0001W
#Vorticon strength
%patch $430B $7EC0W
#Dead Vorticon behavior
%patch $4306 $6A00W
#Dead Vorticon collision

Complete collision code

This is the complete collision code for the Vorticon. it contains (and is thus incompatible with) many of the patches above. It pays to have some knowledge of Patch:Vorticons Sprite Parameters when working with these patches.

The check for Keen's shot appears on the first line, if the colliding sprite is Keen's shot type, the next check is skipped. On the second line the game checks for the enemy shot type, if it is not present, the rest of the code is skipped. Now a third check is performed, apparently this checks if the colliding sprite has a strength of 2, and if so, skips over a jump to the end of the code. (The point of this is not known, and it is very inelegant.)

The end of the second line is where the death code begins. First sound $0027 is played. (Replacing $E8 $8676W $59 with $90 $90 $90 $90 will stop it being played.) On the third line the animation speed is set to 0 and the misc variable B set to 2. On line 3 the animation is set to $4B. These three changes are used when the 'dead sprite' behavior is run, to make the sprite animate as it dies, then stop. ($0002 is the number of frames to animate in this special case.) Finally on the third line the sprite's collision is set to $6A00 (Dead sprite collision) and its behavior to $7EC0 (Dead sprite behavior.)

Patch: Keen 3
#Vorticon collision
%patch $42D0 $55 $8B $EC $56 $57 $8B $76 $04 $8B $7E $06 $83 $3D $0F $74 $05 $83 $3D $10 $75 $28 $FF $4C $24 $74 $02 $EB $21 $B8 $0027W $50 $E8 $8676W $59 $C7 $44 $2A $0000W $C7 $44 $2C $0002W $C7 $44 $28 $004BW $C7 $44 $34 $6A00W $C7 $44 $32 $7EC0W $5F $5E $5D $C3


Patch: When spawned
%patch $3C7D $0047W 

Patch: In level
%patch $4236 $0049W 
#Jumping right
%patch $423E $004AW
#Jumping left
%patch $4289 $0047W
#'Looking for Keen'
%patch $4286 $03
#And next 3 frames
%patch $4162 $003FW
#Walking right
%patch $415A $0043W
#Walking left
%patch $416C $03
#And next 3 frames
%patch $4301 $004BW
#When shot
%patch $42FC $02
#Frames used


These are the sounds the sprite uses.

Patch: Keen 3
%patch $42ED $27 
#Vorticon death
#Don't make sounds:
%patch $42F0 $90 $90 $90 $90
#Vorticon death

Sprite spawning

This is the complete code for the Vorticon's spawning. As it contains many patches elsewhere on this page, it is incompatible with them.

The Vorticon has a normal sort of spawn code. its sprite type is set to 2, its behavior to walking Vorticon, its collision to 'make shot Vorticon' with a strength of 1. Finally it looks for keen and moves towards him using a speed of +-250.

Patch: Vorticon spawn
#Vorticon initiation pointer
%patch $3BFA $3ADFW
#Initiation: Goes to Vorticon (Code at $3ADF + $13C + 5 = $3C20)
%patch $3ADF $56 $57 $E8 $013CW $59 $59 $E9 $00D1W
#Vorticon spawn code
%patch $3C20 $55 $8B $EC $56 $E8 $2396W $8B $F0 $C7 $04 $0002W $8B $46 $04
#Sprite type = 2
$99 $B1 $0C $E8 $AF8BW $89 $44 $04 $89 $54 $06 $8B $46 $06 $99 $B1 $0C $E8 $AF7CW $89 $44 $08 $89 $54 $0A $C7 $44 $32 $414AW
#Behavior = $414A
$C7 $44 $34 $42D0W $C7 $44 $24 $0001W $8B $44 $06 $8B $54 $04
#Collision = $42D0, health = 1
$3B $06 $0C $71 $7C $0F $7F $06 $3B $16 $0A $71 $76 $07 $C7 $44
#Check for Keen
$20 $FFA6W $EB $05 $C7 $44 $20 $005AW $C7 $44 $28 $0047W $5E
#Speed +-5A sprite = 47
$5D $C3