From KeenWiki
Jump to navigation Jump to search

Vortimoms are dangerous grunt enemies found in Keen 3. This page lists patches relating to Vortimom 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

Vortimoms use sprite type 4 which means they push Keen about but are harmless to everything else. They produce shots of type 16, the standard 'enemy shot' type in Keen 3 which kill a number of enemies (but do not affect the Vortimom.) The sprite collision section will provide some patches relating to this.

Keen 3

#Vortimom sprite type:
%patch $3CEF $04 #Vortimom
%patch $4549 $10 #Vortimom's shots

Sprite Behavior

The Vortimom has only two behaviors, walking, and shooting. The Vortimom will shoot randomly when walking. The Vortimom's shot has its own behavior. The shooting behavior is quite complex as it deals with what happens when the Vortimom is next to a wall or shootable sprite when shooting. This produces a number of special zap\zot sprites (instead of having the bullet pass through the wall\sprite as may otherwise occur.) These sprites are dealt with on another page.

$440CW #Walk, shoot randomly, turn when hitting walls
$44B9W #Create bullet, return to walking
$466EW #Move across screen, hit solid tiles (Vortimom shot)
$470CW #Vortimom collision
$46C6W #Vortimom's shot collision

When spawned

%patch $3D12 {$440CW}

In level

%patch $4469 {$44B9W} #Shoot randomly
%patch $4539 {$440CW} #Walk after shooting

%patch $456D {$466EW} #Vortimom's shot

%patch $3D17 {$470CW} #Vortimom collision
%patch $4578 {$46C6W} #Vortimom's shot collision

Vortimom shoots multiple shots

This patch makes the Vortimom shoot several shots each time she shoots. The shots are produced very rapidly (no pause between them) and the shoot sound is played each time. The blue value is the number of shots to produce. The second line of the patch stops the Vortimom's shots hitting each other and smashing. (This means of course that two Vortimoms will be able to shoot past each other.) If the second line is omitted nearly all of the shots will zap/zot as soon as they are produced. The second line alter the Bullet's collision code, specifically overwriting its ability to not smash against zap/zot sprites. This means shooting one in a row of shots will destroy that entire row.

Vortimom shoots multiple shots

#Vortimom shoots multiple shots
%patch $44E9 [$04] $77 $3C $FF $06 $993CW $90 $90
%patch $46D7 $3D $10

Pause before Vortimom shoots and shooting time

The Vortimom pauses a short time before creating a bullet (shooting). During this time she uses her shooting animation but is perfectly still. It can be considered a 'charging' of sorts. This pause may be anything from 4 to 127 ($7F) game ticks. This is the first patch.

The second patch is similar; it controls how long the Vortimom spends shooting in total. (So the Vortimom goes to shooting, pauses before making a shot then pauses again before returning to walking.) This should always be longer than the pause before shooting, but doesn't have to be. The pause's actual length will be the pause value less' the 'pause before shooting' pause. (By default this is $32 - $1E = $14 ticks.) The same rules apply as with the first patch.

Pause before Vortimom shoots

#Pause before Vortimom shoots
%patch $44E0 $1E

Pause before Vortimom returns to walking

#Pause before Vortimom shoots
%patch $452C $32

Longer pause before Vortimom shoots

This patch allows the pause before the Vortimom shoots to be as long as desired, anywhere from 4 to 524287 game ticks long. This can be used if the modder desires a detectably long shoot pause. (Say if making the Vortimom into a weapon that charges before producing an especially dangerous bullet.) The pause value is highlighted in blue and here uses the default pause value.

Longer pause before Vortimom shoots

#Longer pause before Vortimom shoots
%patch $44DC $81 $3E $993AW [$001EW] $7E $57 $90

No pause before Vortimom shoots

This patch removes the pause entirely, the Vortimom shoots instantly.

No pause before Vortimom shoots

#No pause before Vortimom shoots
%patch $44DC $EB $07

Walking behavior code

This is the complete code for the Vortimom walking. The first line checks to see whether the Vortimom is facing right or left, this is used to set the walking animation on line 2. On line 3 the number of walking frames (2) and animation speed (4) are set.

On line 4 a random check is made, if this is less than $5D then the Vortimom will execute the 'go to shooting' code on lines 5 and 6. This code sets a number of variables (Mostly setting things like the speed ton 0.) before changing the Vortimom's behavior.

After this the gravity and tile checks are called. Both are $E8 $xxxxW; replacing the first with $90 $90 $90 will cause the Vortimom not to fall when she walks off of edges (She will in fact act more like a moving platform.) Replacing the second in the same way will make the Vortimom 'ghost' through tiles. (The two can be combined to make a sprite that just walks through the level shooting.)

After the tile check is called three checks are made. The first is if the tile the Vortimom is touching blocks from the top (Can be walked on.) After this, on the last two lines, the left and right walls are checked for, if one is found the Vortimom will turn. These last two lines thus also contain the Vortimom's walking speeds.

Walking behavior code

#Vortimom walk behavior
%patch $440C $55 $8B $EC $83 $EC $04 $56 $83 $3E {$9930W}  [$00] {$7E} $08 $C7 $06
             $9938W  [$0057W]  $EB $06 $C7 $06 $9938W  [$0055W]  $A1 $61 $53 $B1 #Walking animations
             [$04] $D3 $E8 $25 [$0001W]  $8B $16 $9938W  $03 $D0 $89 $16 $9938W  #Walking frames, animation speed
             $A1 $991AW  $8B $16 $9918W  $89 $56 $FC $89 $46 $FE $E8 $86F8W  #Random check
             $3B $06 $40 [$5D] {$73} $19 $A1 $9930W  $F7 $D8 $A3 $993EW  $33 $C0
             $A3 $9930W  $A3 $993CW  $A3 $993AW  $C7 $06 $9942W  {$44B9W}  $E8 #Shoot
             $1E46W  $E8 $1E86W  $8B $F0 $F7 $C6 [$0002W]  {$75} $23 $8B $46 $FE #Gravity, tile check
             $8B $56 $FC $89 $16 $9918W  $A3 $991AW  $A1 $9930W  $F7 $D8 $A3
             $9930W  $A1 $9930W  $D1 $E0 $99 $01 $06 $9914W  $11 $16 $9916W
             $F7 $C6 [$0004W]  {$74} $06 $C7 $06 $9930W  [$FFCEW]  $F7 $C6 [$0001W]  #Turn left at walls
             {$74} $06 $C7 $06 $9930W  [$0032W]  $5E $8B $E5 $5D $C3             #Turn right at walls

Shooting behavior code

This is the complete code for the Vortimom shooting. The first line checks to see whether the Vortimom is facing right or left, this is used to set the walking animation on line 2. On line 3 there is a pause before the Vortimom shoots (See above sections.)

On line 4 a 'shot check' is made, if the Vortimom has already shot once, it will not shoot again. (To make multiple shots see the patch in the above sections.) Following this the shot variable is set to 1 and sound $26 is played (The shooting sound.) On line 5 another direction check is made, this time to set the Vortimom's shot's direction and speed, highlighted in blue at the end of the line. On line 6 the shot height is set, this is -1 by default. (See position section below.)

On line 7 the Vortimom's shot creation code is called ($E8 $0019W; this is what actually produces the shot and it can be sued by other enemies.) On the last two lines the 'pause before returning to walking' is checked (See sections above.) before the Vortimom's behavior is set to walking again on the last line.

Shooting behavior code

#Vortimom shooting behavior code
%patch $44B9 $55 $8B $EC $56 $83 $3E $993EW  [$00] {$7D} $08 $C7 $06 $9938W      #Direction check
         [$0059W]  $EB $06 $C7 $06 $9938W  [$005AW ] $A1 $993AW  $03 $06 $40 $5D #Shooting animations
             $A3 $993AW  $83 $3E $993AW  [$1E] {$7D} $02 $EB $56 $83 $3E $993CW  #Shoot pause
             [$00] {$75} $3C $C7 $06 $993CW  [$0001W]  $B8 [$0026W]  $50 $E8 $8470W  #Has shot check, sound
             $59 $83 $3E $993EW  [$00] {$7D} $05 $BE [$FF6AW]  $EB $03 $BE [$0096W]  #Direction check, shot speeds
             $56 $A1 $991AW  $8B $16 $9918W  $81 $C2 $00 [$FF] $15 [$FFFFW]  $50 #Shot position
             $52 $FF $36 $9916W  $FF $36 $9914W  $E8 $0019W  $83 $C4 $0A $83 #Call shots
             $3E $993AW  [$32] {$7E} $0C $A1 $993EW  $A3 $9930W  $C7 $06 $9942W  #Stop shooting pause
             [$440CW]  $5E $5D $C3

Vortimom just randomly produces shots

This patch simplifies the shooting code so that the Vortimom doesn't use shooting animations or pause. Instead it simply produces bullets while walking (with the shooting sound.) not changing its animation or slowing down.

Vortimom just randomly produces shots

#Vortimom just randomly produces shots
%patch $44B9 $55 $8B $EC $56 $A1 $993AW  $03 $06 $40 $5D $A3 $993AW $B8      #Shot sound
         [$0026W]  $50 $E8 $849BW  $59 $83 $3E $993EW  [$00] {$7D} $05 $BE [$FF6AW]  #Direction check, shot speeds
             $EB $03 $BE [$0096W]  $56 $A1 $991AW  $8B $16 $9918W  $81 $C2 $00
             [$FF] $15 [$FFFFW]  $50  $52 $FF $36 $9916W  $FF $36 $9914W  $E8    #Shot position, call shots
         $0044W  $83 $C4 $0A $A1 $993EW  $A3 $9930W  $C7 $06 $9942W  [$440CW]  #Return to walking
             $5E $5D $C3

Speed and Jump Height

The default speed of Vortimoms is +-50 when walking. They will head towards Keen when spawned by default. Their shoots move somewhat faster at +-150

Starting speeds

%patch $3D3C [$0032W] #If left of Keen (Move right)
%patch $3D35 [$FFCEW] #If right of Keen (Move left)

In level

#When walking about randomly:
%patch $44A6 [$FFCEW] #Hits right wall (Go left)
%patch $44B2 [$0032W] #Hits left wall (Go right)

#Shot speed:
%patch $4502 [$FF6AW] #Left speed
%patch $4507 [$0096W] #Right speed

Sprite Collision

Vortimoms interact with Keen's and the enemy shots (Including the Vortimom's and enemy shooter shots. This produces a shot Vortimom. (See behavior section.) The shot Vortimom 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 and animate'

The Vortimom's shot has its own collision, and it will not collide with Vortimoms (But will hit any other sprite, except type 19.) When the shot is destroyed it becomes a zap/zot sprite.

Vortimoms have a 'strength' of 5, but this can be altered.


%patch $3D17 {$470CW}   #Vortimom collision
%patch $4717 $3F $0F  #Vortimom killed by Keen's shot
%patch $3D1C [$0005W]   #Vortimom strength

%patch $4741 {$7EC0W} #Dead Vortimom behavior
%patch $473C {$6A00W} #Dead Vortimom collision

Vortimom's shots

%patch $4578 {$46C6W}   #Vortimom's shot collision
%patch $46D2 $3D $04  #Vortimom shots don't hit Vortimom
%patch $46D7 $3D $13  #Vortimom shots don't hit zap/zots


The Vortimom's animations are pretty standard. The number of frames used affects both bullet moving right and moving left.

When spawned

%patch $3D41 [$0055W] #Start

In level

%patch $44C8 [$0059W] #Shooting right
%patch $44D0 [$005AW] #Shooting left

%patch $4426 [$0055W] #Walking right
%patch $441E [$0057W] #Walking left
%patch $4430 $01    #Frames used - 1
%patch $442C $04    #Animation speed

%patch $4737 [$005BW] #When shot
%patch $4732 $02    #Frames used

%patch $45F8 [$0039W] #Bullet right
%patch $4581 [$003BW] #Bullet left
%patch $467C $01    #Frames used - 1


These are the sounds the sprite uses. The Vortimom has an unusually large number of sounds to choose from.

Keen 3

%patch $44F3 $26 #Vortimom shooting sound
%patch $45CA $25 #Vortimom shot hit right wall and Vortimom (If next to right wall and shoots)
%patch $4640 $25 #Vortimom shot hit left wall and Vortimom (If next to left wall and shoots)
%patch $4692 $25 #Vortimom shot hit tiles sound
%patch $46DE $25 #Vortimom shot hit sprites sound
%patch $4723 $27 #Vortimom death

#Don't make sounds:
%patch $44F2 $EB $06 #Vortimom shooting sound
%patch $45C9 $EB $06 #Vortimom shot hit right wall and Vortimom (If next to right wall and shoots)
%patch $463F $EB $06 #Vortimom shot hit left wall and Vortimom (If next to left wall and shoots)
%patch $4691 $EB $06 #Vortimom shot hit tiles sound
%patch $46DD $EB $06 #Vortimom shot hit sprites sound
%patch $4722 $EB $06 #Vortimom death

Shooting height

This controls the height at which the Vortimom's shots are spawned. It is divided into two values, the first in a 'fine-tuner', the number of pixels down from the Vortimom's sprite's top the bullet appears. The second value is much rougher and is worth 256 pixels when +-1 It is really only useful when making the shot appear a negative number of pixels below (That is above) the sprite, when it will be changed to $FFFFW.

There are two sets of values here, BOTH affect the shot's spawn height. (It appears that another enemy was planned to use the Vortimom's shot as well, a similar situation that works can be seen with the Guard Robot and Vorticon Elite in Keen 2.) The sum total of their default effects is to spawn a shot 13 pixels from the top of the Vortimom sprite ($FF + $0D = $0C) When working with these values remember that neither can be set to zero.

Keen 3

#Vortimom shooting height (Default = $FFFFF0, if zero then no shot appears)
%patch $4514    [$FF]
%patch $4516 [$FFFFW]

#Vortimom BULLET height (Default $00000D, if zero then no shot appears)
%patch $4560    [$0D]
%patch $4562 [$0000W]