Patch:Keen dying (Vorticons)
This page contains patches relating to Keen's death in Keen 1-3, its causes and effects. Other pages relating to Keen's death are listed under Patch:Dead Keen. Patches relating to hazard tiles that can kill the player are found under Patch:Deadly tiles.
In Keen Vorticons Keen can die in a number of ways, the three most basic being: falling out of the level bottom, lethal sprites and lethal tiles.
- 1 What Keen loses when dying or exiting levels
- 2 Sprite Behavior
- 3 Speed
- 4 Sprite Collision
- 5 Animations
- 6 Sounds
- 7 Keen has hitpoints (health)
- 8 Shooting is suicide
What Keen loses when dying or exiting levels
Keen gains\loses four items when dying
This patch changes the value of four things Keen has when he dies. In the example provided below it gives Keen all four keycards (Sets them to 1) when he dies. (Setting them to 0 is useless unless using the change things on level win patch.) The four variables changed are marked in brown, the four values they are set to in blue. To set less than four variables, simply delete a $C7 $06 $AAxxW} $yyyyW string. To add a variable to change simply insert a $C7 $06 $AAxxW} $yyyyW string. A maximum of 10 variables can be altered in this way.
The final 'extra' variable changed is Keen's lives, $FF $0E $AAC6W means 'decrease Keen's lives by 1'; something usually wanted when Keen dies. Removing this will in effect give Keen infinite lives.
See also Patch:Game stats. This patch, and all that are built on it is incompatible with Keen losing ship parts when dying in their levels. Using it will overwrite the relevant code, meaning Keen can get a ship part in a level, die, and still have it. It will also stop Keen losing keycards when he exits a level.
|Patch: Keen 1|
In Keen 1 Keen will lose a ship part if he dies in the level he obtained it. These are the levels the parts are found in by default. If Keen dies in these levels after getting a part, the part will be removed, thus preventing Keen from getting a part and not completing the level. This can come as a shock to modders who find parts they have 'disappearing' when they die in a custom level.
It is possible to make more than one level remove a part on death by altering the brown jumps in the first set of patches, though care is required. Changing the level to something 'impossible' such as level 100 will mean that no level Keen can enter in the game will remove his ship parts. (Or there is a patch to ignore ship part removal entirely.)
This patch can be modified so that Keen loses other things in special levels, like his ammunition. It can also be altered to give Keen things. Only one thing can be changed per level. See also Patch:Ship Parts
|Patch: Keen 1 parts level stuff|
Keen gets\loses something when killed by lethal tiles but not enemies
This patch changes a single game stat every time Keen is killed by a lethal tile. (But not when killed by enemies.) This can do anything from set his ammo to 0 to giving him Ankh time. (Which he can then use at the level start.) If Keen has hitpoints this can be even more useful.
The default item being given in this patch is the red keycard, but anything else will work just as well. This patch also requires the C T Space Cheat to be disabled, which is what the first line does. (It can be made compatible with the C T Space cheat however.)
|Patch: Hazard tiles give Keen a red card when he dies|
There are four references to the dead Keen behavior code. The first stops the camera following dead Keen to the top of the level, this makes Keen's death much quicker. The second changes Keen's code to dead when he dies. The third changes Keen's code when he falls out of the bottom of the level. The fourth stops Keen from 're-dying' on deadly things once dead, this stops him being stuck in an infinite loop of dying over and over.
The last three references are important. If the death behavior is changed then they too must be changed and they must all be the same to avoid any bugs. It is possible to make more than one behavior 'unkillable', though this is difficult.
|Patch: Dead Keen's behavior|
Keen loses level while onscreen
This patch alters things so that the level is lost while Keen is still onscreen, instead of when he flies offscreen. The blue value is the pause before the level is lost.
|Patch: Keen loses level while onscreen|
Screen doesn't follow dead Keen
By default the screen does not follow Keen when he has died; instead the level restarts when he moves offscreen. It is possible to make the screen follow Keen even when he is dead and\or not when he is doing other things. See also Patch:Jump conditions.
|Patch: Screen doesn't follow dead Keen|
Screen follows dead Keen
This patch makes the screen always follow Keen, dead or not. When dead Keen will head to the top of the level by default, only exiting to the map when he reaches the level top.
|Patch: Screen follows dead Keen|
When Keen is killed all his vertical and horizontal motion stops and he hovers in the air for a short time. After this he moves up and left offscreen. By default this is necessary as the level will only restart when he disappears off the top of the screen. His horizontal speed is randomly left or right and doesn't really add much.
|Patch: Dead Keen's speeds|
Keen doesn't stop moving when killed
These patches stop Keen coming to a halt when killed. This means that whatever speed he has when killed he will keep, even moving offscreen in directions other than up. (Keen will not restart the level if he exits via the bottom of the screen.) Once again there are two situations this happens, when killed in-level and when falling out of the level bottom.
|Patch: Keen doesn't stop moving when killed|
Pause before dead Keen flies up offscreen
This is the time Keen spends 'standing still' when killed, before he flies up offscreen. This is by default to take advantage of the long death sound, but modders may not want to wait so long before being able to restart the level.
|Patch: Pause before dead Keen flies up offscreen|
When Keen dies his collision is set to 'nothing' which means he can't be pushed, stunned, etc when dead. This stops bugs where dead Keen could be 'resurrected' by interacting with other sprites. This happens in two occasions, firstly when Keen is killed in-level and secondly when he falls out of the level bottom.
|Patch: Dead Keen's collision|
Don't change Keen's collision
This patch stops Keen's collision being changed when he dies. As noted above this means he can still collide with other sprites, which causes a number of possible 'escapes' from death.
|Patch: Dead Keen's collision|
Keen uses two frames when dead, looping continuously until the level restarts. The animation speed is $04, larger values give slower animation.
|Patch: Dead Keen's animations|
Difference between dead and standing frames: alignment
Since Keen's dead animations are a different height to his normal animations and when he dies Keen's feet stay in the same position, Keen must move down a number of pixels when he dies. By default this is simply the difference in height between the two sprites. As such this may need to be adjusted if graphics are changed. Alternatively this can be exploited for neat effects.
The value here is in 100ths of a pixels, so the default amount is 8 pixels down. (The maximum amount, $7FFFW is 8 tiles down.)
Note that these patches will interfere with and\or be overwritten by the 'Dying removes any points got in level' patch. However that patch contains the value patched below meaning it can be edited directly and have the same effect as this patch.
|Patch: Amount dead Keen is kicked down|
There are two 'death sounds'; the first is played when Keen dies in-level and the second when he dies by falling out of the level. When he falls out of the level his 'plummet sound' is also played.
|Patch: Keen death sounds|
|Patch: Disable Keen death sounds|
Keen has hitpoints (health)
This patch alters things such that Keen has hitpoints or health. This means that when Keen touches an enemy (but not tile!) that should kill him he instead loses 1 hitpoint. When he is out of hitpoints he dies.
The way this patch is set up lives serve as hitpoints and Keen is given temporary invincibility via the Ankh timer. This means the patch is only feasible for Keen 3. This patch also requires the C T Space Cheat to be disabled, which is what the first line does. (It can be made compatible with the C T Space cheat however.)
On the second line the game checks if Keen has a red keycard; if he does he will die instantly no matter how many hitpoints he has. (The card thus acts as a 'kill switch'.) See Patch:Game stats to alter the brown value that controls this. Setting it and the following blue value to $9D46W $0000W will disable this requirement. (But see end of description.)
On the third line the first set of brown-blue-brown values check to see if Keen has any Ankh time. If he does the code is exited and Keen is unaffected. If he does not however the second set of brown-blue-brown values check to see if he has 1 or less lives. If he does then Keen will exit the code and die. (This must be so because when Keen dies he will lose an additional life.)
On the fourth and final line the 'hurt' code is run. This decreases Keen's life count by 1 (marked in brown) and sets his Ankh time to $0120, giving him about a second of invincibility.
Note that using this patch rapidly reduces to normal gameplay unless there is some way to replenish Keen's lives. A good way of doing this is to use the 'reset Keen's lives on level entry' patch in this link.
After the first segment is an optional 'kill switch' patch. This gives Keen the red keycard when he touches a hazard tile which is the same thing that the first segment uses as a 'kill switch'. With this added to the patch Keen will die instantly when touching hazard tiles. With it absent hazard tiles will work with hitpoints.
|Patch: Keen has hitpoints (health)|
Shooting is suicide
It is possible to make it so that when Keen attempts to shoot, he instead dies. This removes a major gameplay mechanic (shooting.) and can lead to accidental deaths. It is incompatible with many shooting related patches. There are three sections to the patch. The first section is optional, it causes Keen to only be able to suicide if he has ammunition. This acts as a check on when Keen can suicide.
The second section causes Keen to die instantly when he shoots. The second section introduces a delay (here of $44 ticks), plays the shooting sound ($0C) and also changes Keen's animation to the first frozen frame ($1C). (Useful since the first section can inhibit animation change.)