Patch:Cities

From KeenWiki
Jump to navigation Jump to search

Cities are found in Keen 2 and are the objective of the game. Keen must 'save' eight cities from destruction by destroying the Tantalus ray in each city's level. This page covers patches relating not to the levels themselves, but the cities as goals, the text used in the game and how the cities are 'saved' Related patches are Patch:Tantalus ray. Mention is also made of cities saved in the Game Over High Score Window.


Have cities saved at game start

This patch has Keen have the cities saved when he starts a game. If he has all cities saved then when he exits any level he will win the game. (This can be used to make a one level mod.) The second patch allows some cities to NOT be saved at game start, starting with London. (This allows Keen to say, have saved six cities at game start.)

Keen 2

#Keen has got cities at game start
%patch $8ACC  [$0001W] #SAVE all cities

%patch $8ABF  [$0001W] #Not save x cities, starting with London


What is needed to win the game

By default the game is won when 8 cities are saved. The number of cities can be altered. Changing the value to 0 wins the game when any level is exited. Note however that if Keen somehow saves more cities than this value he will never be able to win the game. (This will happen if for example it is set to 0 but Keen saves a city.)

The game does this by starting at a certain variable and checking the next 8 to see if they have a value of 1. Each value of 1 is added to a total, and if that total is exactly 8 the game is won.

There are two other repeats of this process; the first occurs when Keen gets a high score; to tell the player how many cities were saved. The second is in the High score screen itself to list the cities saved by each score entry.

Number of saved cities needed to win

#Number of cities needed to win
%patch $8430 {$9AF4W}    #Start checking here...
%patch $8438 [$08]       #...check next 8 variables to see...
%patch $8432 [$01]       #...if they're 1...
%patch $843E [$08] {$75}   #...if exactly 8 are, win

#Check cities saved when entering a score
%patch $86D8 {$9AF4W}    #Start checking here...
%patch $86E0 [$08]       #...check next 8 variables to see...
%patch $86DA [$01]       #...if they're 1

#Check cities saved when showing highscores
%patch $887E {$9AF4W}    #Start checking here...
%patch $8886 [$08]       #...check next 8 variables to see...
%patch $8880 [$01]       #...if they're 1


Tantalus levels and what is saved in them

By default a city is saved when Keen shoots or touches the purple Tantalus ray sprite in its level. These patches control how levels are assigned to a specific city. This is done via a 'pointer list' to various bits of code (Seen in the section below.) Each value points to a bit of code for that level. Using this it is possible to make any level you wish a Tantalus level, or indeed, do other interesting things if you have the patching ability.

In the list the first entry is for level 4, the 2nd for level 5 and so on. The value 476FW means 'Not a Tantalus level' Other values are easy enough to figure out. To set this up the game takes the current level and removes 4 from it. The list has a length of 12 entries.

The second part of this patch changes what is 'saved'; by default each Tantalus level saves a different city game variable. If the values are set to $0000W then the cities will not be saved and it is possible to rewrite this so that Keen gets ammo or keycards when he shoots a Tantalus (This will of course mean the city is still NOT saved.) Using these patches may require some knowledge of Patch:Game stats.

Keen 2

#Reading the list
%patch $472E [$47D4W] #Where to read pointer list from
%patch $4724 [$04]    #First list level is level 4
%patch $4727 [$0C]    #List is 12 entries long

#Pointer list
%patch $47D4 [$4731W] #Level 4 (London)
             [$476FW]
             [$4739W] #Level 6 (Cairo)
             [$4741W] #Level 7 (Sydney)
             [$476FW]
             [$4749W] #Level 9 (NY)
             [$476FW]
             [$4751W] #Level 11 (Paris)
             [$476FW]
             [$4759W] #Level 13 (Rome)
             [$476FW]
             [$4761W] #Level 15 (Moscow)
             [$4769W] #Level 16 (Washington)

#What is obtained when Tantalus is shot (Cities are saved)
%patch $4733 {$9AF4} [$0001W] #London
%patch $473B {$9AF6} [$0001W] #Cairo
%patch $4743 {$9AF8} [$0001W] #Sydney
%patch $474B {$9AFA} [$0001W] #New York
%patch $4753 {$9AFC} [$0001W] #Paris
%patch $475B {$9AFE} [$0001W] #Rome
%patch $4763 {$9B00} [$0001W] #Moscow
%patch $476B {$9B02} [$0001W] #Wash D.C.


Cities unsaved when Keen dies

By default if Keen dies in a Tantalus level that level's city will be 'unsaved'. This can be a problem if the Tantalus level has been changed since Keen may end up losing a saved city for no reason. This patch is near identical in structure to the one above except is unsaves cities instead of saving them.

Keen 2

#Reading the list
%patch $7CCD [$7D15W] #Where to read pointer list from
%patch $7CC1 [$04]    #First list level is level 4
%patch $7CC4 [$0C]    #List is 12 entries long

#Pointer list
%patch $7D15 [$7CCEW] #Level 4 (London)
             [$7D0CW]
             [$7CD6W] #Level 6 (Cairo)
             [$7CDEW] #Level 7 (Sydney)
             [$7D0CW]
             [$7CE6W] #Level 9 (NY)
             [$7D0CW]
             [$7CEEW] #Level 11 (Paris)
             [$7D0CW]
             [$7CF6W] #Level 13 (Rome)
             [$7D0CW]
             [$7CFEW] #Level 15 (Moscow)
             [$7D06W] #Level 16 (Washington)

#What is unsaved when Keen dies
%patch $7CD0 {$9AF4} [$0000W] #London
%patch $7CD8 {$9AF6} [$0000W] #Cairo
%patch $7CE0 {$9AF8} [$0000W] #Sydney
%patch $7CE8 {$9AFA} [$0000W] #New York
%patch $7CF0 {$9AFC} [$0000W] #Paris
%patch $7CF8 {$9AFE} [$0000W] #Rome
%patch $7D00 {$9B00} [$0000W] #Moscow
%patch $7D08 {$9B02} [$0000W] #Wash D.C.


City text (Names)

These patches alter the city text that appears in Keen's Status Window. By default the text only appears when Keen has saved the city. Text relating to how many cities the player saved can be found under Patch:High Scores. This requires knowledge of Patch:Text patches.

Keen 2

#City names:
%patch $199AB "London" $00
%patch $199B2 "Cairo" $00
%patch $199B8 "Sydney" $00
%patch $199BF "New York" $00
%patch $199C8 "Paris" $00
%patch $199CE "Rome" $00
%patch $199D3 "Moscow" $00
%patch $199DA "Wash D.C." $00

#Where city text is read from:
%patch $10A4 [$222BW]
%patch $10C0 [$2232W]
%patch $10DC [$2238W]
%patch $10F8 [$223FW]
%patch $1118 [$2248W]
%patch $1138 [$224EW]
%patch $1158 [$2253W]
%patch $1178 [$225AW]