Patch:Keen 6 map items
This page lists patches for the three items used to pass obstacles on the map in Keen 6. These are the Bloogstar rocket pass, the Rope and grappling hook and the Stupendous sandwich. Patches relating to the map obstacles themselves are covered at Patch:Map (Keen 6). This page is a sprite page, since the map items are sprites. For patches relating to other items in Keen 6 see Patch:Items.
As a note, the rope and grappling hook that is placed on the map by Keen is also covered on this page, as it is too simple to have its own page, at least at present. The Bloogstar Rocket and Grabbiter have their own pages. (But again the sandwich and rocket pass do not.) Note also that Molly technically counts as a special item, using the same sprite collision as special items. The Satellite is not counted and has its own page, though it is similar in function.
The page is divided into three sections. The first deals with the items as sprites, objects that appear in the level that do things. The second deals with the items on the map, what happens when Keen does or does not have the items. Finally there is a short section on how the items appear in the status window.
Contents
- 1 Items as sprites
- 2 Items on the map
- 3 Items and the status window
Items as sprites
This section covers all patches relating to the items as sprites. Thing such as their speeds and animations. Roughly speaking anything that does not involve the map level.
Sprite Type
The Map item's sprite types are important since they are checked in the special item collision code to determine what happens when Keen contacts the sprite. As such changing them will interfere with Keen getting items or winning the game (in the case of Moloy.)
Patch: Keen 6 |
|
Sprite Actions
The map items have a set of simple actions as they do not do much. Each item is spawned with its first action. The first three items proceed to do nothing, their action doesn't change. Molly however has a four action cycle she remains in indefinitely.
Actions: $1D06W #Sandwich $1D24W #Rope $1D42W #Card $1D60W #Molly 1 $1D7EW #Molly 2 $1D9CW #Molly 3 $1DBAW #Molly 4
Patch: Keen 6 |
|
Sprite Behavior
The map items have no behaviors at all. This includes Molly.
Patch: Sprite behaviors |
|
Speed
As none of the map items move, their animation speeds are zero.
Patch: Sprite speeds |
|
Sprite Collision
The map items all use the same collision, which is unusual since they achieve different things. Even Molly uses this collision.
Collision values
These are the collision values for the map item's actions. Notice they all use the same collision, despite being very different objects.
Patch: Keen 6 |
|
Collision code
The special item collision is complicated but composed on simple parts. On the first line Keen's sprite type is checked for, if found the following code is run. (So only Keen can interact with special items.) After this the code checks the item's sprite type to see what should be done next.
The first check is for the Rope's sprite type, $001CW. If this is found code is skipped to the end of line 4, setting the level state to $000AW (Get rope, exit level.)
Right after this Molly's type is checked for and if found, code is skipped to line 6, setting the level state to $000CW (Win game.)
After this the Sandwich's type is checked for and if found, code is skipped to the start of line 4, setting the level state to $0009W (Get Sandwich, exit level.)
Finally the Card's type is checked for and if found, code is skipped to the middle of line 5, setting the level state to $000BW (Get Card, exit level.)
Patch: Keen 6 |
|
Level state and items
These patches allow simple alterations of the level state each item sets when it is obtained. This is in fact responsible for things like getting the item or (in Molly's case) winning the game. A value of '0' will do nothing.
Patch: Keen 6 |
|
Item doesn't win level
This patch makes an item (In this case the Grappling Hook) not win the level when obtained, merely vanish after its window has appeared. To do this the item must be given a new collision that makes it disappear. (This patch assumes that the mod does not use the Dreams-style level entry window patch.)
Here $0E420A8ARL calls the grappling hook window. $0E4209FCRL would call the Sandwich and $0E420B18RL the Passcard.
Patch: Keen 6 |
|
Animations
Each item has a single animation to itself, and does not animate at all by default, though this can easily be changed. There are two other animations related to the rope and grappling hook, one for the rope being thrown by Keen, the second for the rope sitting on the map. Notice that the rope being thrown animates.
Interestingly each item has its own cache despite only using a single animation. (In other games only this animation is cached at spawning and no dedicated cache would be needed.)
Patch: Keen 6 map item animations |
|
Clipping and foreground
Molly's clipping cannot be patched as it uses a default value. The remaining items have no clipping by default meaning they will ignore tiles. Molly's foreground variable is 0 meaning that she appears behind all tiles while the other items have a value of 2 which allows them to appear in front of most tiles and sprites, making them more prominent.
Patch: Keen 6 |
|
Patch: Keen 6 |
|
Item sounds
The sprites themselves have no sounds but sounds are played when various text windows appear relating to the items. These are covered in the second section of this page.
Probability
Molly is the only map item with any sort of randomness. As an artifact of her being intended to walk she randomly starts the level moving right or left with a 50:50 chance of either.
Patch: Keen 6 |
|
Sprite-tile interaction
None of the items interact with tiles in any complex way, so they use a generic interaction code.This includes Molly and is part of the reason why she could clip through doors in version 1.4 of the game.
Patch: Sprite tile interactions |
|
Action type
Needing to react quickly to Keen the three most basic items have type 2 actions. Molly's actions are type 0, as she doesn't need to do anything particular involved.
Patch: Sprite action types |
|
Deprotect and stick to ground
The map items, including Molly, have no need for either of these variables and so has a value of 0 for both in all of their actions.
Patch: Sprite deprotect, stick |
|
Sprite spawn code
The first three items have near identical spawning codes while that of Molly is more complex and is contained on a different page. There is only one kind of each item initiation pointer.
The initiation codes are quite simple, they spawn the item and set the item's cache in the code $C7 $06 $CDxxW $0001W.
In the spawning code the last blue highlighted value is the sprite action the sprite uses as it proceeds to act in-level. $C7 $02 $xxxxW sets the sprite activity, $C7 $07 $xxxxW sets the sprite type, $C7 $20 $xxxxW sets the foreground value. Finally $D3 $E0 $05 $xxxx is how far down (Or more usually up) the sprite is spawned from where it is placed. This is necessary for sprites that walk on the ground as they can only be placed in the level at multiples of 16 pixels high while their actual height can be anything. Molly uses this to position herself in-level.
Molly, but no other map items always starts the level moving down and randomly chooses whether to move left or right. (This is an artifact of when she was designed to be able to move.) $C7 $47 $10 $xxxxW is the vertical direction the sprite starts moving in, either $0001W (Facing down), $FFFFW (Facing up) or $0000W (Neither, seldom used.) $C7 $47 $0E $xxxxW is the horizontal direction. The random check is $9A $1CF30034RL $3D $0080W
Patch: Keen 6 |
|
Items on the map
This section of the page contains patches relating to the various text windows produced on the map relating to the items.
Map item checks
On the map there are three checks to see if Keen has a particular item. If he does not one sequence will occur. (A text window.) and if he does another will occur. See Patch:Game stats and Patch:Jump conditions. By default the game checks to see whether or not the item's value is 0.
Patch: Keen 6 sounds |
|
Don't need items
These patches skip the item checks; Keen will not need the item to pass a map obstacle.
Patch: Keen 6 |
|
Sounds
These are the various sounds relating to the map items. They are produced when items are got, used or when Keen attempts to do something without the correct item. Each sound can be silenced.
Patch: Keen 6 map item sounds |
%patch $EE25 $2D |
Items text windows
This is the text used in levels when Keen runs into an item or item obstacle with and without his items. There are around eight variables for each window that must be considered. Most windows play a sound (patches that block this sound can be found in the subsection above.)
The windows must cache the graphics they are using before they appear. In this case there will be two matching values, one to cache and one to display. Notice that bitmaps are referred to by their 'chunk number', that is, what graphic chunk they are in EGAGRAPH.CK6; this is the bitmap number (When exported via ModKeen, Keengraph numbers the bitmaps 'correctly') plus six. The bitmap is placed right in the window by a certain number of pixels. By default this is the same as the image's width so that the displayed bitmap is 'right aligned'. Paired with this is a second, equal variable that moves the text in the opposite direction so that it is not centered in the window (and thus overwriting the bitmap.) These variables can be 'reversed' by making them negative. (Changing $0030W to $00D0W and $30 to $D0 for example.)
There is also the window height and width which are self explanatory and finally the text call which determines where the window's text is called from. (See Patch:Text patches and Patch:Text windows.)
Patch: Keen 6 item map texts |
|
Don't show Keen's bitmap in windows
These patches prevent Keen's portrait bitmap appearing in the various windows. This slightly reduces the memory each window takes.
Patch: Don't show Keen's bitmap in windows |
|
Complete window codes
These patches are the entire codes for various map item windows. They are rather simple once understood. See Patch:Text windows.
Rope Obtained window
This is the complete window code for the window that appears when the rope is obtained. The first line plays sound $2D, the second line caches Keen's head bitmap ($0023W) which is then displayed on line 4. Notice that bitmaps are referred to by their 'chunk number', that is, what graphic chunk they are in EGAGRAPH.CK6; this is the bitmap number (When exported via ModKeen, Keengraph numbers the bitmaps 'correctly') plus six. The window's size is set on line 3 as being $08x$1A
The image is aligned right by $0030W pixels. By default this is the same as the image's width so that the displayed bitmap is 'right aligned'. Paired with this is a second, equal variable that moves the text in the opposite direction so that it is not centered in the window (and thus overwriting the bitmap.) These variables can be 'reversed' by making them negative. (Changing $0030W to $00D0W and $30 to $D0 for example.)
Finally the text call on line 6 which determines where the window's text is called from. (See Patch:Text patches.) The value $001EW is the 'pause' before the player can dismiss the window by pressing a key. Finally after the window has been displayed the sandwich variable is set to 1 on the last line. (The rope is given.)
Patch: Keen 6 |
|
Sandwich Obtained window
This is the complete window code for the window that appears when the sandwich is obtained. The first line plays sound $2D, the second line caches Keen's head bitmap ($0023W) which is then displayed on line 4. Notice that bitmaps are referred to by their 'chunk number', that is, what graphic chunk they are in EGAGRAPH.CK6; this is the bitmap number (When exported via ModKeen, Keengraph numbers the bitmaps 'correctly') plus six. The window's size is set on line 3 as being $08x$1A
The image is aligned right by $0030W pixels. By default this is the same as the image's width so that the displayed bitmap is 'right aligned'. Paired with this is a second, equal variable that moves the text in the opposite direction so that it is not centered in the window (and thus overwriting the bitmap.) These variables can be 'reversed' by making them negative. (Changing $0030W to $00D0W and $30 to $D0 for example.)
Finally the text call on line 6 which determines where the window's text is called from. (See Patch:Text patches.) The value $001EW is the 'pause' before the player can dismiss the window by pressing a key. Finally after the window has been displayed the sandwich variable is set to 1 on the last line. (The sandwich is given.)
Patch: Keen 6 |
|
Rocket Passcard Obtained window
This is the complete window code for the window that appears when the Rocket Passcard is obtained. The first line plays sound $2D, the second line caches Keen's head bitmap ($0023W) which is then displayed on line 4. Notice that bitmaps are referred to by their 'chunk number', that is, what graphic chunk they are in EGAGRAPH.CK6; this is the bitmap number (When exported via ModKeen, Keengraph numbers the bitmaps 'correctly') plus six. The window's size is set on line 3 as being $08x$1A
The image is aligned right by $0030W pixels. By default this is the same as the image's width so that the displayed bitmap is 'right aligned'. Paired with this is a second, equal variable that moves the text in the opposite direction so that it is not centered in the window (and thus overwriting the bitmap.) These variables can be 'reversed' by making them negative. (Changing $0030W to $00D0W and $30 to $D0 for example.)
Finally the text call on line 6 which determines where the window's text is called from. (See Patch:Text patches.) The value $001EW is the 'pause' before the player can dismiss the window by pressing a key. Finally after the window has been displayed the rocket passcard variable is set to 1 on the last line. (The card is given.)
Patch: Keen 6 |
|
Items and the status window
These patches relate to the display of the special items in the game's status window; for an explanation of how the patches work see here.
Patch: Keen 6 status window items placement |
|