Patch:Map (Keen 1)

From KeenWiki
Jump to: navigation, search

This page contains patches that relate to the map level in Keen 1. Patches that affect levels in general, such as ones that change tile properties or sprites are not covered here but rather at Patch:Levels. The patches on this page affect the map and only the map.

A related page that covers the 'done' markers that appear only on the map is Patch:Done markers; patches affecting Keen's map sprite are found on Patch:Keen on map (Vorticons). Other map level patches can be found at Patch:Map.


Doors on map

This patch allows you to place doors on the map level. These doors do not "push" Keen like doors in-level, they simply act like blocks unless Keen has the right keycard, in which case he can walk over them. Because keycards are used by default you may want the "do not remove keycards" patch. Note that the keycard is not removed by the map door and the map door does not "open". In-level doors are unaffected.

This patch works by hijacking the map blocking code, so in order to act as a door the door tiles must be blocking on the relevant side(s) or Keen will pass straight through them even without a keycard. This is the exact opposite of in-level doors which cannot be blocking.

The map door checking function uses game stats, it checks for a value of 1 for yellow cards and the three variables after it and responds accordingly. Changing this to $AA94W will make the ship parts act like keys (for map doors only!) Other values can be used too. The blue $03 is the number of possible keys (Default is 3 + 1 = 4). The blue $02 is the first tile property affected by the patch. (In this case $02, the yellow door.) The blue $01 is the value the game checks for.

The map doors patch is not compatible with the v2 patch.

Patch: Keen 1
#Our map-door-checking function
%patch $6884 $3D $0000W $9F $88 $E0 $8B $9F $6E $05 $83 $EB $02 $7C $0F $83 $FB $03 $7F $0A $D1 $E3 $83 $BF $AA9EW $01 $9F $08 $C4 $9E $74 $05 $58 $05 $001AW $50 $C3
#Call the map-door-checking function from appropriate spots
%patch $A71B $8B $87 $34 $0A $E8 $C162W %patch $A808 $8B $87 $C0 $13 $E8 $C075W %patch $A933 $8B $87 $86 $18 $E8 $BF4AW %patch $AA20 $8B $87 $FA $0E $E8 $BE5DW


Map level

This patch controls what level is treated as the map. By default this is level 80 ($50). There are two parts to the patch, the level where Keen's start location is obtained and the level Keen is spawned. Both of these values should match. Note that in the map level sprites do not spawn normally, instead they become level entrances. It is possible to have the map level be the same level as a regular level.

Patch: Keen 1
#Map level
%patch $7C18 $50
#Keen's location
%patch $7D08 $50
#Map file


Mars map location and level for ending sequence

These patches affect where the Mars Map sequence of text boxes occur in the ending sequence. By default the map level is used (level 80), but any other level, even a totally unique one just for the ending sequence can be used.

The position of events is treated rather uniquely; both x and y position, in tiles are given, however they must be worked out in a very odd way. There are two values for each, the first is a number of tiles * $10, the second a number of tiles that needs to be multiplied by $10. As an example the vertical location of $23 tiles down is $30/$10 + $02 * $10 = $03 + $20. If this is confusing, then just fiddling with the values until a desired result is obtained works.

Patch: Keen 1
#Level used
%patch $81CA 80

Patch: Keen 1
#Level position coordinates
%patch $81D7 $30
#x position (x10)
%patch $81DD $00
#x position (Total 0-3 = $03 tiles)
%patch $81E2 $30
#Y position (x10)
%patch $81E8 $02
#Y position (Total 2-3 = $23 tiles)


Sounds

There are several sounds related to the map. The two most basic are Keen's map walking sound (played whenever he moves on the map.) and Keen's map blocked sound. (Played whenever Keen tries to walk into a solid tile on the map.) There is also the 'appear on map' sound that is triggered when Keen starts a game, loads a game or exits a level. (It is related to the Keens Left Window.) Finally there are Teleporter sounds.

Patch: Keen 1
#Sounds
%patch $AC60 $01
#Keen blocked on map sound
%patch $AC65 $01
#Keen walking on map sound
%patch $AF6C $12
#Teleporter sound
%patch $8F82 $29
#Keens left sound
#Don't play sounds
%patch $AC5F $EB $0C
#Keen blocked on map sound disabled
%patch $AC64 $EB $07
#Keen walking on map sound disabled
%patch $AF6B $EB $07
#Teleporter sound disabled
%patch $8F81 $EB $07
#Keens left sound disabled


Disable no clipping with God Mode

This stops Keen from being able to walk all over the map level when he has God mode enabled. The patch is not compatible with the sloped map tiles section of the Patch:Vorticons 2 patch, so if you're using this, use the alternative version provided.

Patch: Keen 1
#Disable map clipping with G O D cheat:
%patch $A626 $EB
#Disable map clipping with G O D cheat (V2 version)
%patch $A621 $EB