Patch:Viva

From KeenWiki
Jump to: navigation, search

Viva is the system used in Keen 6 to allow the palyer to collect extra lives. There are two collectables that can be acquired; the first is Viva, which are tiles that can be collected, 100 giving the player an extra life, the second collectable is the Queen Viva, both a tile and sprite that can be collected to give an extra life directly.

This page covers patches relating to both collectables in three sections, Viva, Queen Viva tiles and Queen Viva sprites. Viva is an item and its patches relate to item patches. It may also pay to check Patch:Jump conditions and Patch:Game stats to assist in using these patches.


Viva

These are 16x16 foreground tiles with a specific property allowing the player to get them. When 100 are obtained an extra life is gained. The following patches relate to both getting a single Viva and an extra life.


What the Viva give

This is what is increased when the player obtains a Viva. By default the Viva counter is incremented by 1.

Patch: Keen 6
#What to increase
%patch $C16F $FF $06 $7592W


What is needed to get 1UP

This is what is required to obtain an extra life. By default this is exactly 100 Viva. The game code is set up so that it is impossible for the player to get more than one Viva at a time, but if this happened the player might not get an extra life and continue obtaining more Viva.

Replacing the $75 with $EB will mean the player never gets an extra life (And can accumulate Viva in perpetuity.) Replacing it with $90 $90 will mean the player gets an extra life with every Viva.

Patch: Keen 6
#What is needed needed (100 Viva)
%patch $C174 $7592W $3D $0064W $75


Can only get a maximum of x Viva, no 1UP

This patch changes the game so that the player can only get a certain number of Viva. After this their Viva counter does not increase anymore. This effectively puts a 'cap' on Viva. (And renders them useless, unless other patches make use of them.)

Patch: Keen 6
#Can only get a maximum of x Viva, no 1UP
%patch $C16F $A1 $7592W $3D $xxxxW $73 $04 $FF $06 $7592W $5F $5E $5D $CB


What is changed when 1UP obtained

Two things are changed when an extra life is obtained, firstly the player's life counter is incremented by 1, and secondly the Viva counter is set to zero, requiring them to obtain another 100 Viva.


Patch: Keen 6
#What to change
%patch $C17D $7592W $0000W
#Set Viva to 0
%patch $C18D $FF $06 $75A6W
#Increase Keen's life count


Sounds played

There are two sounds played, one when the Vivalet is got, the other when an extra life is gained.

Patch: Keen 6
#Play sounds
%patch $C15A $000AW
#Get Viva
%patch $C182 $0011W
#Get 1UP

Patch: Keen 6
#Don't play sounds
%patch $C15D $90 $90 $90 $90 $90
#Get Viva
%patch $C185 $90 $90 $90 $90 $90
#Get 1UP


Produce 1UP sprite

When the player obtains an extra life a 1UP sprite is produced to indicate this fact. It moves upwards and has no clipping (So it can move through any tiles without getting stuck.) and moves in an upwards direction appearing in front of all tiles (So even hidden items can be seen when they are obtained.)

Patch: Keen 6
#Produce 1UP
%patch $C1A3 $0001W
#Object type
%patch $C1A8 $0003W
#Foreground = 3 (In front of everything)
%patch $C1BE $FFFFW
#Vertical direction (Upwards)
%patch $C1CA $1F28W
#Produce 1UP
%patch $C1DD $0000W
#With clipping = 0


Queen Viva

These are either 16x16 foreground tiles with a specific property allowing the player to get them or item sprites that gives the player an extra life when the player touches them. As items proper, patches relating to Vitalin are covered on the items page.


1UP and viva got sprites

There are four Viva-related sprites. The first is the 1UP produced when a 1UP item sprite is taken, patches relating to that sprite can be found on the items page. The second is the 1UP produced when a 1UP tile is obtained. These too are treated on the items page. The last two relate to Viva tiles; the first is the 'Viva got' that appears when any Viva is taken while the second is the 1UP produced when the 100th Viva is taken.


Sprite Type

Both the 'Viva got' and 1UP sprites are type 1 or 'misc', not affecting anything in particular.

Patch: Keen 6
#Viva stuff sprite types
%patch $C1A3 $01
#100 Viva 1UP
%patch $F468 $01
#Viva splash


Sprite Actions

Actions relating to these sprites are quite simple. Both are produced in only one situation. The 'Viva got' is produced when Viva tiles are obtained and proceeds to a four action sequence that then vanishes. The 1UP is a variation of the standard 'item got' sprite so altering what it becomes will alter other item got sprites.

Actions:
$19E2W #Items got
$1A00W #Viva got 1
$1A1EW #Viva got 2
$1A3CW #Viva got 3
$1A5AW #Viva got 4

Patch: Keen 6
#Extra sprite shown when player gets 100 drops 1UP
%patch $C1CA $19E2W
#'Got' item vanishes
%patch $3272E $0000W
#Sprite produced when Viva are got
%patch $F47D $1A00W
#Viva splash sequence
%patch $3274C $1A1EW %patch $3276A $1A3CW %patch $32788 $1A5AW %patch $327A6 $0000W


Sprite Behavior

None of these sprite actions have any behavior. Changing the 1UP's behavior will also change the behavior of other 'items got' sprites.

Patch: Keen 6
#Items got
%patch $32722 $00000000L
#Viva got
%patch $32740 $00000000L %patch $3275E $00000000L %patch $3277C $00000000L %patch $3279A $00000000L


Speed and Jump Height

Items do not move by default either in their code or animation motion. The got items action rises and this rising speed is controlled by its animation motion.

Patch: Keen 6
#Items got
%patch $3271E $0000W $0008W
#Viva got
%patch $3273C $0000W $0000W %patch $3275A $0000W $0000W %patch $32778 $0000W $0000W %patch $32796 $0000W $0000W


Sprite Collision

Items, and all actions associated with them, are not meant to interact with other sprites. As such they have no sprite interaction at all.

Patch: item sprite collisions -Keen 6
#Items got
%patch $32726 $00000000L
#Viva got
%patch $32744 $00000000L %patch $32762 $00000000L %patch $32780 $00000000L %patch $3279E $00000000L


Animations

The 'Viva got' and 1UP sprites are cached with in-level Keen when he spawns. The 1UP sprite's specific animation is set when it is created, its action itself has no animation of its own. (If one is given then it will change the animations of all other 'item got' sprites.) The 'Viva got' however has its own animations, a different one for each action.

The animation speeds of the 'Viva got' control how long it appears onscreen before vanishing. That of the 1UP controls how long it moves upwards before vanishing. (Changing it will change all other 'item got' sprites.)

Patch: Keen 6
#Item got animation
%patch $32712 $0000W $0000W %patch $3271C $0028W
#Time before vanishing
#Viva got animations
%patch $32730 $0092W $0092W %patch $3273A $0008W
#Animation speed
%patch $3274E $0093W $0093W %patch $32758 $0008W
#Animation speed
%patch $3276C $0094W $0094W %patch $32776 $0008W
#Animation speed
%patch $3278A $0095W $0095W %patch $32794 $0008W
#Time before vanishing


Sounds

There are two relevant sounds, one played when a drop is obtained and another when 100 Vitalin are obtained. For patches relating to these sounds see the sounds section near the top of this page.


Clipping and foreground

Both the 'Viva got' and 1UP sprites have a foreground value of 3 so that they will appear in front of all other sprites and tiles. (So the player can see what has happened.) and no clipping. (So they are not pushed about by tiles.) These can be altered without affecting the properties of the usual 'item got' sprites.

Patch: Keen 6
#1UP
%patch $C1A8 $0003W
#Foreground
%patch $C1DD $0000W
#Clipping
#'Viva got'
%patch $F464 $0003W
#Foreground
%patch $F45F $0000W
#Clipping


Sprite-tile interaction

All the sprites use the 'draw sprite' tile interaction; this means they do not specifically interact with tiles. Since they have no clipping by default they will not even be stopped by solid tiles. Altering the 1UPs collision will affect other 'item got' sprites.

Patch: Keen 6
#1UP
%patch $3272A $08F4180ARL
#Viva got
%patch $32748 $08F4180ARL %patch $32766 $08F4180ARL %patch $32784 $08F4180ARL %patch $327A2 $08F4180ARL


Action type

The 1UP uses type 1 for its action; this allows it to move smoothly. The 'V' by contrast uses type 0 since they do not have to move or use a behavior.

Patch: Keen 6
#1UP
%patch $32716 $0001W
#Viva got
%patch $32734 $0000W %patch $32752 $0000W %patch $32770 $0000W %patch $3278E $0000W


Deprotect and stick to ground

These sprites have no need for either of these variables and so have a value of 0 for both in all of their actions.

Patch: Sprite deprotect, stick -Keen 6
#1UP
%patch $32718 $0000W $0000W
#Viva got
%patch $32736 $0000W $0000W %patch $32754 $0000W $0000W %patch $32772 $0000W $0000W %patch $32790 $0000W $0000W