Patch:Ending sequence (Keen 4)

From KeenWiki
Jump to: navigation, search

The ending sequence in Keen 4 occurs after Keen has saved eight Council Members, the screen goes dark, the ending sequence of text and images plays, followed by the high scores level. The ending sequence is mostly due to a loaded text chunk that allows the game to load images and text in a defined sequence. This chunk is handled completely uniquely, not allowing the player just to scroll through it as fast as they wish, but making them wait until the page is 'ready.'


No ending sequence

This patch skips the ending sequence entirely; instead the game simply goes straight to the highscores (Or entering a new score.) when Keen wins.

Patch: Keen 4
#No ending sequence, go straight to high scores
%patch $9C7D $CB


EGAGRAPH text chunk

This is the EGAGRAPH chunk used for the ending sequence. Everything that happens after Keen wins the game is dependent on this chunk. Note that when altering this value an associated variable has to be altered by twice the amount. (As an example, changing the chunk to $1286, or one less means changing the variable to $9FF9 or two less.)

Patch: Keen 4
#Ending sequence document
%patch $9CB8 $1287W
#Text
%patch $9CC4 $9FFBW
#Memory variable 1
%patch $9D7D $9FFBW
#Memory variable 2


Background color

The background color of the ending sequence is the same as that of the help sections and so cannot be changed without also altering the help section. By default it is $04, or red. The next two lines of the patch give the area of the screen affected by the color. (This makes it possible to display a color plus black as a background.

Patch: Keen 4
#Help\Ending pages background color
%patch $95FB $0004W
#Color dark red used for screen background
%patch $95FF $00C8W
#200x...
%patch $9603 $0140W
#320...


Page border images

Like the help section the ending sequence screen is bordered by four images, top, bottom, left and right. However, since the ending screen and help screen are based on the same code the top and side images are shared and altering the ending sequence alters the help screens.

Patch: Keen 4
#Top of help screen (At 0,0)
%patch $9613 $0050W
#Bitmap
#Left of help screen (At 0,8)
%patch $9623 $0051W
#Bitmap
%patch $9627 $0008W
#Vertical position
#Right of help screen (At 312,8)
%patch $9636 $0052W
#Bitmap
%patch $963A $0008W
#Vertical position
%patch $963E $0138W
#Horizontal position
#Bottom of help screen(At 8, 176)
%patch $964E $0053W
#Bitmap
%patch $9652 $00B0W
#Vertical position
%patch $9656 $0008W
#Horizontal position
#Bottom of ending screen
%patch $9664 $0054W
#Bitmap
%patch $9668 $00C0W
#Vertical position
%patch $966C $0008W
#Horizontal position
#Don't show...
%patch $9612 $EB $0E
#Top help image
%patch $9622 $EB $11
#Left help image
%patch $9635 $EB $12
#Right help image
%patch $964D $EB $12
#Bottom help image
%patch $9663 $EB $12
#Bottom ending image
%patch $9612 $EB $63
#All images


Ending sequence doesn't have border images

This patch rearranges the screen code so that the ending sequence has no border images while the help screens do. This can help distinguish both kinds of screen. As a side effect the location and image values are shifted slightly from those in the section above, rendering all above patches dealing with them incompatible. Instead alterations must be made to the blue values in this patch.

As another note this means that the end sequence's bottom border image is not used and can be used for something else. There are modifications to this patch that allow one or more help border images to appear in the ending sequence.

Patch: Ending sequence 'Ending sequence doesn't have border images
#Ending sequence doesn't have border images
%patch $9612 $0B $FF $74 $4D $B8 $0050W $50 $33 $C0 $50 $50 $9A $1D060C79RL $83 $C4 $06 $B8 $0051W $50 $B8 $0008W $50 $33 $C0 $50 $9A $1D060C79RL $83 $C4 $06 $B8 $0052W $50 $B8 $0008W $50 $B8 $0138W $50 $9A $1D060C79RL $83 $C4 $06 $B8 $0053W $50 $B8 $00B0W $50 $B8 $0008W $50 $9A $1D060C79RL $83 $C4 $06 $EB $14

Patch: Ending sequence 'Patch modifiers, use ONE
#End sequence pages also display...
%patch $9616 $37
#...bottom border
%patch $9616 $23
#...bottom and right borders
%patch $9616 $10
#...bottom, right and left borders


Ready for next page images

When the current page of graphics and text has loaded and is ready for the player to press a key to move to the next page, a flashing animation of two images appears in the lower right of the page indicating this. By default this animation is of a dark\light green arrow. Both of these images and their location can be altered.

Both images must be cached first before being displayed.

Patch: Ending sequence 'page ready' animation
#Cache images for display
%patch $9CA0 $0030W
#Dark green arrow
%patch $9CAC $002FW
#Light green arrow
#Display Dark green arrow at 184,298
%patch $9D04 $002FW
#Image
%patch $9D08 $00B8W
#Vertical location
%patch $9D0C $012AW
#Horizontal location
#Display Dark green arrow at 184,298
%patch $9D37 $0030W
#Image
%patch $9D3B $00B8W
#Vertical location
%patch $9D3F $012AW
#Horizontal location


Don't show animation

This patch stops both images being displayed when the page is ready. This can make it difficult for the player to tell when they can press a key, however in some situations it may be desirable. Using just one line of the patch will make only one image appear, which is more subtle.

Patch: Don't show ending sequence 'page ready' animation
#Don't show ending sequence 'page ready' animation
%patch $9D0F $90 $90 $90 $90 $90 %patch $9D42 $90 $90 $90 $90 $90


Ending sequence doesn't wait for keypresses

This patch skips the animation and waiting when a page has loaded. This means that the player can do nothing once the ending sequence starts except wait for it to end. However this can be easily altered to make the ending sequence 'automatic'. By the use of timed bitmaps and texts a page can be lingered on for any desired amount of time.

Patch: Ending sequence doesn't wait for keypresses
#Ending sequence doesn't wait for keypresses
%patch $9D03 $EB $66


Ending sequence doesn't wait for keypresses for first x pages

This patch skips the animation and waiting when a page has loaded, but only for the first few pages. The value highlighted in blue is the number of pages that will pass on 'automatic' before the player is required to press a key to progress. As a side effect the 'ready for next page' animation sequence does not appear, though a replacement can be added into the ending chunk.

This value uses a stat in brown that can be changed during the game, changing how much of the ending sequence is automated.

Patch: Ending sequence doesn't wait for keypresses
#Ending sequence doesn't wait for keypresses for first 6 pages
%patch $9D03 $FF $06 $7A1EW $83 $3E $7A1EW $08 $72 $5D $9A $14600F43RL $0B $C0 $75 $54 $EB $F5


Music played during ending sequence

This is the song played in the ending sequence. Due to the way music works it is actually the level whose music is played. See Patch:Music.

Patch: Keen 4
#Ending Sequence (Slug Village)
%patch $9CD7 $0007W


Don't change music for ending sequence

This requires two patches, one to keep the same music playing after the Council Member is got, the second to stop the music changing in the ending sequence. The side effect is the member's background music will be the same as the levels. (If the first line is removed then the E.S. music will be the same as the member's music.)

Patch: Keen 4
#Ending sequence has same music as last level
%patch $F4CD $90 $90 $90 $90 $90
#Don't change music for member
%patch $F5E7 $90 $90 $90 $90 $90
#Don't change music after member rescued
%patch $9CDA $90 $90 $90 $90 $90
#Don't play E.S. music