PATCH: Exiting a level

Completed patches for Keen1.
User avatar
JosephBurke
Posts: 94
Joined: Sun Aug 31, 2003 9:51 pm

Post by JosephBurke »

*amused* You really are too kind Andrew. :)
User avatar
adurdin
Site Founder
Posts: 549
Joined: Fri Aug 29, 2003 11:27 pm
Location: Edinburgh, Scotland
Contact:

Post by adurdin »

Really, it's not so much kindness as my own enjoyment. Making any patches is fun in itself, and the resulting deification boosts my ego :b

No, really, mostly it's the fun of making the patch, and then playing the mods that people make.
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

I bet. :) If I only could, I would make patches.
xtraverse
Patch Crafter
Posts: 290
Joined: Tue Sep 02, 2003 6:42 pm
Location: Easter Island
Contact:

..

Post by xtraverse »

Hey andy, could you explain a little more about how this patch works? I'm curious on how to modify it. Also, would it be a similar procedure for Keens 2 and 3, just different offsets?
User avatar
adurdin
Site Founder
Posts: 549
Joined: Fri Aug 29, 2003 11:27 pm
Location: Edinburgh, Scotland
Contact:

Post by adurdin »

A similar patch for Keen 2 and 3 would be quite simple.
If you disassemble the patch using debug or some other utility, you'll find that the code is the following:

Code: Select all

4F43 31C0          XOR     AX,AX
4F45 A39EAA        MOV     [AA9E],AX
4F48 A3A0AA        MOV     [AAA0],AX
4F4B A3A2AA        MOV     [AAA2],AX
4F4E A3A4AA        MOV     [AAA4],AX
4F51 A3C8AA        MOV     [AAC8],AX
4F54 90            NOP...
This sets the "got keycard" variables at data locations AA9E, AAA0, AAA2, and AAA4 to zero, and also sets the shots variable at data location AAC8 to zero. The rest of the code is NOP (no-operation) commands, to fill up the space which was originally a verbose loop to clear the keycard variables.
xtraverse
Patch Crafter
Posts: 290
Joined: Tue Sep 02, 2003 6:42 pm
Location: Easter Island
Contact:

..

Post by xtraverse »

So how did you manage to make a patch that would only do that on level 1? Did you check the bytes at a certain location (maybe that holds the level number) and do some sort of "if" in assembly?

A suggestion I have is that you write an article that gives the memory locations where certain significant information is stored during the game, that would help the rest of us write our own patches.
User avatar
adurdin
Site Founder
Posts: 549
Joined: Fri Aug 29, 2003 11:27 pm
Location: Edinburgh, Scotland
Contact:

Post by adurdin »

Here's the code that the "set shots to zero only on level 1" patch uses:

Code: Select all

4F43 31C0          XOR     AX,AX
4F45 A39EAA        MOV     [AA9E],AX
4F48 A3A0AA        MOV     [AAA0],AX
4F4B A3A2AA        MOV     [AAA2],AX
4F4E A3A4AA        MOV     [AAA4],AX
4F51 833E048301    CMP     WORD PTR [8304],+01
4F56 7503          JNZ     4F5B
4F58 A3C8AA        MOV     [AAC8],AX
4F5B 90            NOP
4F5C 90            NOP
4F5D 90            NOP
It checks the word at data location $8304, which stores the current level number. If it is not equal to one, then it skips over the line which resets the shots to zero.

Your suggestion about an article is a good one. Maybe also a bit of a tutorial on using DEBUG to make patches? I'll see what I can do.
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

That would be nice. Though, I probably still would need to ask patches here. :o
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Post by CommanderSpleen »

I just noticed that this patch causes keycards to remain even when Keen dies. Can this be fixed? It'd make things much easier when designing levels.

I'll see what I can do with it as-is, anyway.

>CommanderSpleen
User avatar
XkyRauh
Posts: 1114
Joined: Sun Aug 31, 2003 9:14 pm
Location: San Diego, California

re: Keeping Keycards

Post by XkyRauh »

This is gonna sound completely corny, but it's one method: Have Keen drop through a shallow vertical passage containing all 4 keycards and all 4 doors at the start of a level you're worried about cheating on. This way, even if he already has a Yellow and a Green Keycard when entering a level, he'll still snag all 4, and open all 4 doors, leaving him with nothing.

Yes, it makes the beginning of that level a little jostling and noisy, but it cuts out the need for additional patching--and you might not want him to lose the keycards on *every* level. ;-)

--Xky
User avatar
myrrth sicopath
Posts: 31
Joined: Sat May 01, 2004 11:30 pm
Location: Marooned on Mars

Post by myrrth sicopath »

I just got a WICKED idea.

Here it is:

Have sections of the world map in the colors of the keycards. In each color, the levels begin with Keen next to a locked door (to be opened with a card of the color of the map) and a hole with enough points for an extra life (in case the player entered a level by mistake or something). Then the player knows that he or she must have that particular color of keycard to enter and advance through one of those levels. At the end of each level, have another keycard to keep and use for a new level of that color.

I don't think I can use this for what I'm doing, but any takers? :D
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

I probably won't use this kind of stuff much, but it's good idea.
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

Post by levellord »

I would use it if such a patch existed for Keen 2.
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

Keys on Map Patch Upgrade?

Post by CommanderSpleen »

I just noticed that this patch causes keycards to remain even when Keen dies.
I was just thinking over the weekend about bringing this issue back to light again. Can the Keys on Map (TM) patch be modified so that when Keen dies, as opposed to exists the level through the door, all keys are lost?

The main problem with the patch as-is still remains that Keen can die in a level mid-puzzle and emerge from the level with a keycard that can be used either in another level or to access locked areas of the map prematurely.
Keen drop through a shallow vertical passage containing all 4 keycards and all 4 doors at the start of a level you're worried about cheating on.
I was using this method during my early level development, in addition to making sure the player can't die after collecting a map-key (a one-way tile leads to the exit room containing the door and a key, and nothing that can kill the player). I can stick with this method, as it works well enough for what it's worth, and it's probably possible to only make one card reset upon exiting/dying and thus not need to worry about the three doors at the start of the level, but upgraded patch is preferable. *hopes*

>Commander Spleen
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

Post by levellord »

Or just make the level a block so that the player can't get past until the level is complete.
Post Reply