Keen 4 has two different endings

Request patches for Keens 4-6.
Post Reply
Posts: 10
Joined: Thu Dec 28, 2017 8:40 am

Keen 4 has two different endings

Post by Bubbbatom »

Hi there,

If it's at all possible I'm after a patch that enables Keen 4 to have two endings triggered by separate events. One ending would be triggered when Keen rescues all of the council members. The second ending would be triggered when Keen completes a particular level.

I was thinking the second ending could use the "About iD" section of the F1 help screen. If this were the case then I would like it so that the "About iD" section was not accessable in the F1 help screen as it would be one of the endings.

Hopefully this request is somewhat realistic!

User avatar
Posts: 315
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat

Re: Keen 4 has two different endings

Post by Nisaba »

Bubbbatom wrote:
Fri Mar 29, 2019 7:17 am
so, this is just a proof of concept that it is possible to have two endings triggered by separate events.

what you can see below is a patch that triggers an alternative message which gets displayed before entering a certain level. afterwards the game skips the official ending sequence and jumps right into the high scores.
to make this compatible with your mod, we need to adjust the jump condition of your BwB level and add an extra (blank) level which needs to be the last level of your game. this level will trigger the alternative ending message.

I assume your BwB level is level #18, right? this patch defines infinite replays of exactly one level:

Code: Select all

# BwB: Level 18 only 
%patch $60FD $12 $74
And this patch displays the demo text whilst Keen enters level #19. this text sheet can get adjusted to your liking. afterwards the game jumps into the high score section. if needed you can mute the music by deleting the last section of this patch.

Code: Select all

# What to display with nonexistent levels
%patch $9CB8 $1288W #Text
%patch $9CC4 $9FFDW #Memory variable 1
%patch $9D7D $9FFDW #Memory variable 2
%patch $9CDA $90 $90 $90 $90 $90

# Level state for entering nonexistent levels - Display image, go directly to the high scores
%patch $6BCD $0EB2W #Got Foot state ($08)
%patch $6BCF $0F $54 

# Trigger message for levels equal or above 19
%patch $DF7C $83 $3E $7A68W  $13 $72 $05 $83 $06 $7A70W  $05

# Don't stop music during message
%patch $9153 $90 $90 $90 $90
%patch $9CDA $90 $90 $90 $90 $90
what I can't get to work yet is to alter this code when Keen completes a particular level. I tried to solve this issue by connecting two levels, which wasn't successful. both patches seem to be conflicting one another.
unfortunately I'm not even close to Levellass' patching skills, so I need to go on and do some good old trail & error with absolutely no guarantee of success...

that said: I haven't seen your patch-file so I don't know whether or not other patches might not like these things above. I guess you just have to test it.
but I think we can call it a solid starting point. pros: you don't have to mess with the F1 help text sheets. And hey, nearly all specifications fulfilled...

Posts: 2997
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Keen 4 has two different endings

Post by levellass »

Hey there, my currently stalled project has a two different endings option triggered by a variable. (In that case whether or not the player cheated during gameplay.) This is the relevant rough patch, but as it goes with the rest of my mod, patch conflict may occur.

Now my game sues an unused chunk, the 'This level is not available in demo mode' chunk. What we need to do is set this value AND the memory value (Which will need to be changed by TWICE the amount the ending chunk is changed, here it's increased by 2.) For that I have a little check code that sees if Keen has completed a certain level. I use a modified version of the 'Win on level XX' patch.

The only major hiccup is that we need a little space to get the game to call not one but TWO possible endings, using values in a different place in memory. This may need to be shifted around, here I dumped it in the Wetsuit's collision.

Code: Select all

#Memory offset and ending document to use (Default values)
%patch $2F474 $1287W  $9FFBW

#End sequence calls variables
%patch $9CB7  $A1 $0604W
%patch $9D7C  $A1 $0606W

#Check level 2 is done, if so change variables
%patch $6B4B $A7EDW  $02 $75 $4C $B8 $9FFDW  $A3 $0606W  $B8 $1288W  $A3 $0604W  $EB $94

#Call right memory address call
%patch $9CC3  $9A $11A21010RL     $90 $90 $90 $90

#Call the right memory address code
%patch $12A30 $55 $8B $EC $56 $8B $76 $06 $8B $44 $0A $A1 $9FFBW  $81 $3E $0604W
                  $1287W  $74 $03 $A1 $9FFDW  $89 $46 $FE $A3 $C8B3W  $5E $5D $CB
One side effect of this patch is that if the game is won in the level way, then a new game is started and it's won the Oracle way, the level way sequence will still play, you'll want a 'reset' patch somewhere to prevent this.

Post Reply