Patch:Vorticon (Keen 2)

From KeenWiki
Jump to navigation Jump to search

Vorticons are dangerous grunt enemies found in Keen 2. 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.

Keen 2

#Vorticon sprite type:
%patch $3BF5  $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.

$3E19W #Walk, jump randomly, turn when hitting walls
$3EE6W #Vorticon fall or slide along ground
$3F33W #'Look for Keen'
$3F8CW #Vorticon collision

When spawned

%patch $3C18 {$3E19W}

In level

%patch $3E6C {$3EE6W} #Fall\slide when jumping and hits walls
%patch $3EE1 {$3EE6W} #Fall and slide after jumping randomly
%patch $3F10 {$3F33W} #'Look for Keen' after landing\stopping sliding
%patch $3F82 {$3E19W} #Walk, jump randomly after 'looking for Keen'

%patch $3C1D {$3F8CW} #Vorticon collision

Vorticon jumps in the dark

This patch allows the Vorticon to continue jumping 'in the dark' (When the lights have been turned off.)

Vorticon jumps in the dark

#Vorticon jumps in the dark
%patch $3E58 $90 $90

Look for Keen time

This patch controls how long the Vorticon spends 'looking for Keen' before returning to walking.

Look for Keen time

#Look for Keen time
%patch $3F57 [$0050W]

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 or walking by reversing their speed. Vorticons will always head right after 'looking for Keen'

During walking there is an unusual 'speed swap' that occurs; this results in Vorticons continually swapping between 'fast' and 'slow' speeds left or right. This is overly complicated and not seen in other episode's Vorticons.

Starting speeds

#Starting speeds
%patch $3C42 [$005AW] #If left of Keen (Move right)
%patch $3C3B [$FF88W] #If right of Keen (Move left)

In level

#When walking about randomly:
%patch $3EC9 [$FFA6W]      #Bounce off right walls
%patch $3ED5 [$005AW]      #Bounce off left walls

#Speed swapping while walking:
%patch $3E81 [$005AW]  {$74} #If speed is this...
%patch $3EAE [$0078W]      #Set it to this
%patch $3E88 [$FF88W]  {$74} #If speed  is this...
%patch $3EA6 [$FFA6W]      #Set it to this
%patch $3E8D [$FFA6W]  {$74} #If speed is this...
%patch $3E9E [$FF88W]      #Set it to this
%patch $3E94 [$0078W]  {$74} #If speed is this...
%patch $3EB6 [$005AW]      #Set it to this

#Jump height
%patch $3E5B [$012CW]

#When jumping, falling or sliding across the ground:
%patch $3F22 [$FFA6W] #Bounce off right walls
%patch $3F2E [$005AW] #Bounce off left walls

#'Look for Keen':
%patch $3F3A [$0000W] #Speed after landing\while 'searching' (Stand still)
%patch $3F5F [$005AW] #Speed when going bask to walking (Right.)

Sprite Collision

Vorticons interact with Keen's and the enemy 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.

Keen 2

%patch $3C1D {$3F8CW}   #Vorticon collision
%patch $3F98 $3D $0F  #Vorticon killed by Keen's shot
%patch $3F9D $3D $0B  #Vorticon killed by enemy shot
%patch $3C22 [$0001W]   #Vorticon strength

%patch $3FC1 {$61A2W} #Dead Vorticon behavior
%patch $3FC6 {$75FCW} #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 Vorticon has any health left, and if so, jumps to the end of the code.

The end of the second line is where the death code begins. First sound $0027 is played. (Replacing $E8 $765EW $44 $44 with $90 $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 $56. 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 $61A2 (Dead sprite collision) and its behavior to $75FC (Dead sprite behavior.)

Keen 2

#Vorticon collision
%patch $3F8C $55 $8B $EC $56 $57 $8B $76 $04 $8B $7E $06 $83 [$3D $0A] {$74} $05
             $83 [$3D $0B] {$75} $27 $FF $4C [$24] {$75} $22 $B8 [$0027W]  $50 $E8 $765EW
                 $44 $44 $C7 $44 $2A [$0000W]  $C7 $44 $2C [$0002W]  $C7 $44 $28
             [$0056W]  $C7 $44 $34 {$61A2W}  $C7 $44 $32 {$75FCW}  $5F $5E $5D $C3


The Vorticon's animations are relatively simple and self-explanatory.

When spawned

%patch $3C47 [$0052W] #Start

In level

%patch $3EF5 [$0054W] #Jumping right
%patch $3EFD [$0055W] #Jumping left

%patch $3F47 [$0052W] #'Looking for Keen'
%patch $3F44 $03    #And next 3 frames
%patch $3F40 $05    #Animation speed

%patch $3E30 [$004AW] #Walking right
%patch $3E28 [$004EW] #Walking left
%patch $3E3A $03    #And next 3 frames
%patch $3E36 $04    #Animation speed

%patch $3FBC [$0056W] #When shot
%patch $3FB7 $02    #Frames used


These are the sounds the sprite uses.

Keen 2

#Vorticon death sound
%patch $3FA7 $27

#Don't make Vorticon death sound
%patch $3FA6 $EB $07

Sprite spawning

This is the incomplete 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.

Vorticon spawn

#Vorticon spawn code
%patch $3BEA $55 $8B $EC $56 $E8 $1B86W  $8B $F0 $C7 $04 [$0002W]  $8B $46 $04 #Sprite type = 2
             $99 $B1 $0C $E8 $9C81W  $89 $44 $04 $89 $54 $06 $8B $46 $06 $99
             $B1 $0C $E8 $9C72W  $89 $44 $08 $89 $54 $0A $C7 $44 $32 {$3E19W}  #Behavior = $3E19
             $C7 $44 $34 {$3F8CW}  $C7 $44 $24 [$0001W]  $8B $44 $06 $8B $54 $04 #Collision = $3F8C, health = 1
             $3B $06 $BC $6E $7C $0F $7F $06 $3B $16 $BA $6E $76 $07 $C7 $44 #Check for Keen
             $20 [$FFA6W]  $EB $05 $C7 $44 $20 [$005AW]  $C7 $44 $28 [$0052W]  $5E #Speed +-5A sprite = $52
             $5D $C3