Patch:Vorticon (Keen 1)

From KeenWiki
Jump to navigation Jump to search

Vorticons are dangerous enemies found in Keen Vorticons. This page lists patches relating to Vorticons in Keen 1, there are separate pages for the Keen 2 and Keen 3 versions which behave differently. Notably in Keen 1 there is a 'boss Vorticon'. 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.


Boss Vorticons

In a specific level there is a 'boss Vorticon' the chief difference is that this Vorticon has a different strength to normal Vorticons. All Vorticons in this level will be bosses however, not just one.

Keen 1

#Boss Vorticon and regular Vorticon strengths:
%patch $1813 $10     #Level on which Vorticon commander appears
%patch $180D [$0003W] #Strength of regular Vorticon -1
%patch $1819 [$0068W] # Strength of Vorticon commander -1


No boss Vorticons

This patch prevents their being any boss Vorticons in any level.

Keen 1

#No boss Vorticons
%patch $180F $EB $0A


Sprite Type

Vorticons use sprite type 4 which means they kill Keen. This type is also the only sprite type killed by the falling block (See Patch:Jump conditions).

Keen 1

#Vorticon sprite type:
%patch $17E0 $04

Keen 1

#Sprite type killed by falling block:
%patch $2340 $02 $75


Sprite Behavior

Vorticons have the most complex sprite behavior aside from Keen himself in Keen 1. 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 go to 'fall' until it lands and animates 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 (In that order) after a jump has started. The third is just standing still and animating and appears to be the behavior responsible for sticking in walls.

Behaviors:
$1C0EW Walk\jump
$1CC8W Fall, bounce off walls
$1D15W 'Look for Keen'
$1D6EW Vorticon collision

When spawned

%patch $1803 {$1C0EW}

In level

%patch $1C5A {$1CC8W} #Randomly used to make 'high' jumps
%patch $1CF2 {$1D15W} #After jumping high
%patch $1A58 {$1C0EW} #After 'looking' for Keen

%patch $1808 {$1D6EW} #Vorticon collision


Slide behavior code

This is the complete 'slide' behavior code. On the first line the Vorticon's speed is checked. This determines what animation it will use (either $50 or $51). At the end of line 2 gravity and tile collision are called.

The rest of the code is tile interaction; the start of line 3 checks for floors; if found the Vorticon's behavior is changed to 'look for Keen' and it animation timer is set to 0. ('Looking' time depends on this timer.) Line 4 checks for right walls, if they are found the Vorticon's speed is set to $FFA6 (leftwards). Line 5 checks for left walls, if they are found the Vorticon's speed is set to $5A (rightwards).

The sum total of this is to make the Vorticon move along falling, bouncing off walls and 'looking' when it lands on ground.

Keen 1

#Vorticon slide behavior code
%patch $1CC8 $55 $8B $EC $56 $83 $3E {$8240W}  [$00] {$7E} $08 $C7 $06 $8248W  [$0050W]
                 $EB $06 $C7 $06 $8248W  [$0051W]  $E8 $0F46W  $E8 $0F86W  $8B
             $F0 $A9 $02 $00 {$74} $0C $C7 $06 $8252W  {$1D15W}  $C7 $06 $824AW
             [$0000W]  $F7 $C6 $04 $00 {$74} $06 $C7 $06 $8240W  [$FFA6W]  $F7 $C6
             $01 $00 {$74} $06 $C7 $06 $8240W  [$005AW]  $5E $5D $C3


Look for Keen behavior code

This is the complete 'look for Keen' behavior code. On the first line the Vorticon's speed is set to 0. The rest of lines 1 and 2 sets the Vorticon's animation; sprite $4E and 3 frames animating at speed 5.

On line 3 there is a check to see how long the Vorticon has been animating. if it is less than $50 ticks then the last line is called. If it is greater then the Vorticon's speed is set to $5A and two unknown checks are made before the Vorticon's behavior is changed to 'walk\jump'. The last line makes two calls, one to gravity and another to tile collision.

The end result of this is that the Vorticon lands, animates then walks right; it does not appear to actively search for Keen.

Keen 1

#Vorticon 'look for Keen' behavior code
%patch $1D15 $55 $8B $EC $C7 $06 $8240W  [$0000W]  $A1 $5135W  $B1 [$05] $D3 $E8
             $25 [$0003W]  $05 [$004EW]  $A3 $8248W  $A1 $824AW  $03 $06 $14 $5B
             $A3 $824AW  $3D [$0050W]  {$7C} $29 $C7 $06 $8240W  [$005AW] $A1 $8226W
                 $8B $16 $8224W  $3B $06 $6EE0W  {$7C} $10 $7F $06 $3B $16 $6EDEW
                 {$76} $08 $A1 $8240W  $F7 $D8 $A3 $8240W  $C7 $06 $8252W  {$1C0EW}
                 $E8 $0EC1W  $E8 $0F01W  $5D $C3


Speed and Jump Height

The Vorticon also has the most speeds of any sprite in Keen 1, indeed the Keen 2 and 3 versions lack several of the speeds here. The default speed of Yorps is +-90. When spawned Vorticons will head toward Keen by default. When walking randomly Vorticon have two speeds, fast and slow, which are chosen randomly. They also turn when hitting walls. When jumping\falling they simply bounce off walls and also when they are heading towards Keen. The second behavior also bounces off walls. The third behavior sets the speed to zero as the Vorticon 'looks' for Keen then sets it to move right. This may cause it to stick into walls after jumping.

Starting speeds

%patch $1832 [$005AW] #If left of Keen (Move right)
%patch $1839 [$FFA6W] #If right of Keen (Move left)

In level

#When walking about randomly:
%patch $1C8C [$FF88W] #Quick left speed
%patch $1C94 [$FFA6W] #Slow left speed
%patch $1C9C [$0078W] #Quick right speed
%patch $1CA4 [$005AW] #Slow right speed
%patch $1CB7 [$FFA6W] #Bounce off right walls
%patch $1CC3 [$005AW] #Bounce off left walls

%patch $1C49 [$012CW] #Jump height

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

#'Look for Keen':
%patch $1D1C [$0000W] #Speed after landing\while 'searching' (Stand still)
%patch $1D41 [$005AW] #Speed when walking after looking (Right.)


Sprite Collision

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


Basic collision patches

Vorticons also have the most complex sprite collision in Keen 1. They can be killed 'normally' by Keen's shots and the Tank Robot's shots. They will also die when a Chain is shot above them. If placed in level 16 they will be 'Vorticon Commanders' and have far more health then otherwise. All deaths produce 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' Unlike other Keen 1 sprites, Vorticons do not jump in the air when shot.

The sprite produced when a Chain\Falling block kills a Vorticon is different from that or a normally shot Vorticon and can have a different animation, behavior, etc.

Keen 1

#Strength:
%patch $180D [$0003W]  #Strength of regular Vorticon -1
%patch $1813 $10     #Level on which Vorticon commander appears
%patch $1819 [$0068W]  #Strength of Vorticon commander -1

%patch $1808 {$1D6EW}  #Vorticon collision
%patch $1D7A $3F $0A #Vorticon killed by Keen's shot
%patch $1D7F $3F $0B #Vorticon killed by Robot's shot

#When shot to death:
%patch $1DAD {$489DW}  #Dead Vorticon behavior
%patch $1DA8 {$3360W}  #Dead Vorticon collision

#When killed by Falling Block:
%patch $2363 {$489DW}  #Dead Vorticon behavior
%patch $235E {$3360W}  #Dead Vorticon collision


Complete collision patch

This is the complete collision patch. Contained in it is all of the Vorticon's collision code. The first two blue values are the sprite types the Vorticon responds to, each followed by a jump condition in brown. The next blue value is the sound played when the Vorticon dies normally followed by fourth that stops the sprite animating, the fifth is the number of frames to use in the stunned animation and the sixth is the sprite animation to use. The seventh and eighth are the shot Vorticon's behavior and sprite collision. The remaining blue values serve an unknown function. The last brown value calls the border flashing code; replace it with $90 $90 $90 to disable border flashing when a Vorticon dies.

To customize the collision it may pay to see Patch:Vorticons Sprite Parameters and maybe Patch:Shot sprites.

Vorticon collision

#Vorticon collision (78 bytes)
%patch $1D6E $55 $8B $EC $56 $57 $8B $76 $04 $8B $5E $06 $83 $3F [$0A] {$74} $05
             $83 $3F [$0B] {$75} $40 $8B $44 $24 $FF $4C $24 $0B $C0 $75 $36 $B8
             [$0027W]  $50 $E8 $A15FW  $44 $44 $C7 $44 $2A [$0000W]  $C7 $44 $2C
             [$0006W]  $C7 $44 $28 [$0052W]  $C7 $44 $34 [$3360W]  $C7 $44 $32 [$489DW]
                 {$E8 $0BCCW}  $8B $F8 $C7 $45 $08 [$0005W] $C7 $45 $22 [$4A45W]
             $C7 $45 $0A [$0000W] $5F $5E $5D $C3


Animations

The sprite produced when a Chain\Falling block kills a Vorticon is different from that or a normally shot Vorticon and can have a different animation.

When spawned

%patch $183E [$004EW] #Start

In level

%patch $1CD7 [$0050W] #Jumping right
%patch $1CDF [$0051W] #Jumping left

%patch $1D29 [$004EW] #'Looking for Keen'
%patch $1D26 $03    #And next 3 frames
%patch $1D22 $05    #Animation speed

%patch $1C1D [$0046W] #Walking right
%patch $1C25 [$004AW] #Walking left
%patch $1C2F $03    #And next 3 frames
%patch $1C2B $04    #Animation speed

%patch $1DA3 [$0052W] #When shot
%patch $1D9E $06    #Frames used

%patch $2359 [$0052W] #When killed by falling block
%patch $2354 $06    #Frames used


Sounds

These are the sounds the sprite uses. The falling block sound is actually the Chain death sound and is played even if no Type 4 sprites are present.

Keen 1

%patch $1D8E $27 #Shot to death
%patch $2344 $27 #Killed by Falling Block

#Don't make sounds:
%patch $1D8E $EB $07 #Shot to death
%patch $2344 $EB $07 #Killed by Falling Block


Misc

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


Remove border-flash-on-death

Normally when a Vorticon dies the game's border flashes several times. This patch stops this, though in DosBox it is often difficult to see anyway.

Keen 1

#Don't make the border flash when Vorticon dies
%patch $1DAF $90 $90 $90 $90 $90 $90 $90 $90 $90 $90
             $90 $90 $90 $90 $90 $90 $90 $90 $90 $90


Chain doesn't kill Vorticons

Normally shooting a chain sprite causes all Vorticon (Type 4) sprites below/right of it to become dead Vorticon sprites. This patch prevents this. It is also possible to change the sprite type affected to something like $40, which means it won't affect anything present in the level.

Keen 1

#Chain doesn't kill Vorticons when shot
%patch $234C $5F $5E $5D $C3