First Keen 4 Mod

Request patches for Keens 4-6.

Is this doable?

Yes
4
80%
NO
1
20%
 
Total votes: 5

User avatar
MoffD
Posts: 62
Joined: Wed Mar 12, 2014 8:50 pm

Post by MoffD »

Buuump.

Just wondering how things are going, I know you're busy but curiosity got the better of me.
;)
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

It's proving the absolute devil to do, the shield at any rate. Lemm is still saying 'wait for the source code' but I'm trying a different tack.
User avatar
MoffD
Posts: 62
Joined: Wed Mar 12, 2014 8:50 pm

Post by MoffD »

levellass wrote:It's proving the absolute devil to do, the shield at any rate. Lemm is still saying 'wait for the source code' but I'm trying a different tack.
Wow, I had no idea the shield would be so hard. I'm sorry you're struggling with it and I appreciate your help immensely.

Is there any specific part that's giving trouble or is it the entire thing?
I think I could get away with removing part of the idea if necessary, just let me know.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Everything works perfectly except getting the shield to appear. The two ways I have for this are altering Keen's sprite drawing code (Which as you can see from the example patch tends to leave shield sprites everywhere and crash the game.) and making a separate shield sprite that follows Keen around. (This tends to get 'left behind' when Keen does things like enter doors.) It is a very vexing problem, the last 10% of the patch.


EDIT: This is a sample shield sprite somewhat like the sparkly stars in Jazz Jackrabbit or Mario. You can see it will move randomishly around Keen but will have to 'catch' him when he does things like enter doors. If this is sufficient then I can easily make it into a shield that appears only when Keen is invincible (And standardize the movement a little more.)

Code: Select all

#Left Facing Keen compact (At $E959)
%patch $EE87 $0069W

#Compact Keen spawns and allow shield to spawn whenever Keen does
%patch $E954 $B8 $0001W  $EB $03 $B8 $FFFFW  $50 $FF $76 $FC $57 $9A $0B80000ERL
                     $83 $C4 $06 $9A $0D8F0003RL     $C7 $06 $CB3DW  $0001W  
             $FF $76 $FC $57 $9A $037D0526RL     $83 $C4 $04 $B8 $2A3ARW  $8A
             $16 $EC $7A $8E $C0 $26 $08 $16 $00FDW  $E9 $046CW
%patch $ED1C $E9 $FC55W

#Disable EGAGRAPH check in Keen 4 (Frees 389 bytes at $3CF6)
%patch $3CE5 $90 $90

#Shield spawn =$037D0526RL
%patch $3CF6 $55 $8B $EC $33 $C0 $50 $9A $06BD1E11RL     $83 $C4 $02 $8B $1E
             $D8 $A7 $C7 $07 $0016W  $C7 $47 $02 $0002W  $C7 $47 $06 $0000W
             $C7 $47 $20 $0003W  $8B $46 $06 $B1 $08 $D3 $E0 $89 $47 $0A $8B
             $46 $08 $D3 $E0 $89 $47 $0C $B8 $0001W  $89 $47 $0E $89 $47 $10
             $B8 $089CW  $50 $53 $9A $09DC118CRL     $83 $C4 $04 $5D $CB

#In High Scores action freed
%patch $D92B $1456W

#Shield waiting action =$089CW
%patch $2F70C $0092W $0092W $0003W $0000W $0000W $0001W $0240W $0240W
              $11A20AF6RL   $00000000L    $09DC176ERL   $089CW

#Schoolfish turns instantly
%patch $12516 $55 $8B $EC $56 $8B $76 $06 $83 $7C $3E $00 $75 $18 $8B $44 $0A
              $8B $1E $D6 $A7 $3B $47 $0A $73 $07 $C7 $44 $0E $0001W  $EB $05
              $C7 $44 $0E $FFFFW  $8B $44 $0C $8B $1E $D6 $A7 $3B $47 $0C $73
              $07 $C7 $44 $10 $0001W  $EB $05 $C7 $44 $10 $FFFFW  $5E $5D $CB
User avatar
MoffD
Posts: 62
Joined: Wed Mar 12, 2014 8:50 pm

Post by MoffD »

levellass wrote:Everything works perfectly except getting the shield to appear. The two ways I have for this are altering Keen's sprite drawing code (Which as you can see from the example patch tends to leave shield sprites everywhere and crash the game.) and making a separate shield sprite that follows Keen around. (This tends to get 'left behind' when Keen does things like enter doors.) It is a very vexing problem, the last 10% of the patch.


EDIT: This is a sample shield sprite somewhat like the sparkly stars in Jazz Jackrabbit or Mario. You can see it will move randomishly around Keen but will have to 'catch' him when he does things like enter doors. If this is sufficient then I can easily make it into a shield that appears only when Keen is invincible (And standardize the movement a little more.)
That looks like it will work, but I'm having some freezes. Not sure if I just need to clean my patch file or not (it happened when I shot a slug while jumping I think.)
Also, do you use dropbox at all? if so it might be easier if I just share a folder with you and when I really start making the mod then you can beta test if you would like.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

I do indeed use dropbox. The patch as it is there is quite rudimentary since I didn't bother to debug it. If it suffices then there is plenty of refining that can be done. My dropbox mail is levellass at gmail.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Some file you have, I think midi2imf.exe is causing my dropbox to hang for some reason.

EDIT: It triggers Avast's antivirus warning that's what's doing it.
User avatar
MoffD
Posts: 62
Joined: Wed Mar 12, 2014 8:50 pm

Post by MoffD »

levellass wrote:Some file you have, I think midi2imf.exe is causing my dropbox to hang for some reason.

EDIT: It triggers Avast's antivirus warning that's what's doing it.
ermmm.... O_O My avast is ignoring it... AND Avira.

Well... to be safe I'll remove it online
Edit: Done.
Let me know if anything else goes wrong, as I paused dropbox syncing for now due to low disk space that needs clearing.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Well I seem to have everything. What's the next step of the plan?
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

*Bump*

Yep, complete working shield patch. Just want to know, do you want it to suck your ammo down at a constant rate while operative, only stopping when a key is pressed or you run out. Or do you want it to take 1 ammo when activated but only work for a short time?


This demo patch doesn't do either, if you have godmode the shield will appear and follow you. (Also if you press 's' to start the Shield):

Code: Select all

#Left Facing Keen compact (At $E959)
%patch $EE87 $0069W

#Compact Keen spawns and allow shield to spawn whenever Keen does
%patch $E954 $B8 $0001W  $EB $03 $B8 $FFFFW  $50 $FF $76 $FC $57 $9A $0B80000ERL
                     $83 $C4 $06 $9A $0D8F0003RL     $C7 $06 $CB3DW  $0001W 
             $FF $76 $FC $57 $9A $037D0526RL     $83 $C4 $04 $B8 $2A3ARW  $8A
             $16 $EC $7A $8E $C0 $26 $08 $16 $00FDW  $E9 $046CW
%patch $ED1C $E9 $FC55W

#Keen stores his in-level position for shield
%patch $D0F4 $8B $44 $0A $A3 $7A4CW  $8B $44 $0C $A3 $7A4EW  $90

#Disable EGAGRAPH check in Keen 4 (Frees 389 bytes at $3CF6)
%patch $3CE5 $90 $90

#Shield spawn =$037D0526RL
%patch $3CF6 $55 $8B $EC $33 $C0 $50 $9A $06BD1E11RL     $83 $C4 $02 $8B $1E
             $D8 $A7 $C7 $07 $0016W  $C7 $47 $02 $0002W  $C7 $47 $06 $0000W
             $C7 $47 $20 $0003W  $8B $46 $06 $B1 $08 $D3 $E0 $89 $47 $0A $8B
             $46 $08 $D3 $E0 $89 $47 $0C $B8 $0001W  $89 $47 $0E $89 $47 $10
             $B8 $1456W  $50 $53 $9A $09DC118CRL     $83 $C4 $04 $5D $CB

#Free sign action
%patch $D92B $0000W
%patch $D937 $0000W

#Shield waiting action =$1456W
%patch $302C6 $0000W $0000W $0002W $0000W $0000W $0001W $0000W $0000W
              $037D0575RL   $00000000L    $09DC176ERL   $1456W

#Shield display action =$011FW
%patch $2EF8F $0092W $0092W $0004W $0000W $0004W $0001W $0001W $0001W
              $037D05A7RL   $00000000L    $09DC176ERL   $011FW

#Shield waiting behavior: When 'S' pressed check shield counter =$037D0575RL
%patch $3D45 $55 $8B $EC $83 $EC $0C $56 $57 $8B $76 $06 $83 $3E $C629W  $00
             $75 $15 $83 $3E $C685W  $00 $74 $13 $81 $3E $7A4AW  $0000W  $74
             $0B $C7 $06 $C629W  $0001W  $C7 $44 $1C $011FW  $5F $5E $8B $E5 $5D $CB

#Shield display behavior (Jump to Keen, dec shield counter) =$037D05A7RL
%patch $3D77 $55 $8B $EC $83 $EC $0C $56 $57 $8B $76 $06 $FF $0E $7A4AW  $8B $1E
             $A7D6W  $A1 $7A4CW  $89 $44 $0A $A1 $7A4EW  $89 $44 $0C

 $5F $5E $8B $E5 $5D $CB

#Fill shield variable
%patch $5CCD $7A4AW $0063W
User avatar
MoffD
Posts: 62
Joined: Wed Mar 12, 2014 8:50 pm

Post by MoffD »

levellass wrote: Yep, complete working shield patch. Just want to know, do you want it to suck your ammo down at a constant rate while operative, only stopping when a key is pressed or you run out. Or do you want it to take 1 ammo when activated but only work for a short time?
Yay! Thanks Lass. (Sorry for not checking in here earlier)

I'm not completely sure at the moment, on one hand the constant drain sounds better for faster gameplay with the player spamming it when needed. For the short time it's more calculated which could be fun for jumping death traps on unsuspecting people... Hmmm... Letsa try with the single use that lasts for a short time, death traps are fun 8)
Edit: Something interesting, it occasionally spawns another scorebox over the previous one and leaves it floating midair.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

That's just the quickpatch; the actual patch doesn't do that.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

This is the current stable patch; the shield is activated using 's' (Key can be changed. I think it was pogo you wanted to trigger it?) and gives ~2s of shield time. ($0080W, adjust to suit.) The shield uses one ammo and has one frame of animation. (Again this can be adjusted.)

Keen cannot activate the shield if he has no ammo, this will play the uh-uh sound. He also cannot activate it while it's still on unless it has almost run out. (So no adding shields together, but if he has enough ammo he can spam the shield and always be protected.)

Keen will not die with the shield on, but this is separate from Godmode so it won't interfere with the cheat. Do inform me of any alterations that are wished.

Code: Select all

#Left Facing Keen compact (At $E959)
%patch $EE87 $0069W

#Compact Keen spawns and allow shield to spawn whenever Keen does
%patch $E954 $B8 $0001W  $EB $03 $B8 $FFFFW  $50 $FF $76 $FC $57 $9A $0B80000ERL
                     $83 $C4 $06 $9A $0D8F0003RL     $C7 $06 $CB3DW  $0001W 
             $FF $76 $FC $57 $9A $037D0526RL     $83 $C4 $04 $B8 $2A3ARW  $8A
             $16 $EC $7A $8E $C0 $26 $08 $16 $00FDW  $E9 $046CW
%patch $ED1C $E9 $FC55W

#Keen stores his in-level position for shield
%patch $D0F4 $8B $44 $0A $A3 $7A4CW  $8B $44 $0C $A3 $7A4EW  $90

#Disable EGAGRAPH check in Keen 4 (Frees 389 bytes at $3CF6)
%patch $3CE5 $90 $90

#Shield spawn =$037D0526RL
%patch $3CF6 $55 $8B $EC $33 $C0 $50 $9A $06BD1E11RL     $83 $C4 $02 $8B $1E
             $D8 $A7 $C7 $07 $0016W  $C7 $47 $02 $0002W  $C7 $47 $06 $0000W
             $C7 $47 $20 $0003W  $8B $46 $06 $B1 $08 $D3 $E0 $89 $47 $0A $8B
             $46 $08 $D3 $E0 $89 $47 $0C $B8 $0001W  $89 $47 $0E $89 $47 $10
             $B8 $0112W  $50 $53 $9A $09DC118CRL     $83 $C4 $04 $5D $CB

#Shield waiting action =$0112W
%patch $2EF82 $0000W $0000W $0002W $0000W $0000W $0001W $0000W $0000W
              $037D0575RL   $00000000L    $09DC176ERL   $0112W

#Shield display action =$0130W
%patch $2EFA0 $0092W $0092W $0004W $0000W $0001W $0004W $0001W $0001W
              $037D05BBRL   $00000000L    $09DC176ERL   $0130W

#Shield vanish action =$014EW
%patch $2EFBE $FFFFW $FFFFW $0000W $0000W $0000W $0004W $0000W $0000W
              $00000000L    $00000000L    $09DC176ERL   $0112W

#Shield waiting behavior: When 'S' pressed =$037D0575RL
%patch $3D45 $55 $8B $EC $83 $EC $0C $56 $57 $8B $76 $06 $83 $3E $C685W  $00 #Check 'S'
             $74 $2E $83 $3E $7A58W  $00 $75 $05 $B8 $000EW  $EB $19 $83 $3E #Ammo, pushbutton
             $7A4AW  $10 $77 $1B $C7 $06 $7A4AW  $0080W  $FF $0E $7A58W  $C7 #Dec ammo, set shield
             $44 $1C $0130W  $B8 $0004W  $50 $9A $187409F1RL     $83 $C4 $02 #Play sound
             $5F $5E $8B $E5 $5D $CB

#Shield display behavior (Jump to Keen, dec shield counter) =$037D05BBRL
%patch $3D8B $55 $8B $EC $83 $EC $0C $56 $57 $8B $76 $06 $8B $1E $A7D6W $A1 
             $7A4CW  $89 $44 $0A $A1 $7A4EW  $89 $44 $0C $83 $3E $7A4AW $00
             $75 $07 $C7 $44 $1C $014EW  $EB $04 $FF $0E $7A4AW  $5F $5E $8B $E5 $5D $CB

#Death also checks for shield variable before letting Keen die
%patch $CC04 $83 $3E $7A4AW  $00 $74 $03 $5D $CB
User avatar
MoffD
Posts: 62
Joined: Wed Mar 12, 2014 8:50 pm

Post by MoffD »

levellass wrote:This is the current stable patch; the shield is activated using 's' (Key can be changed. I think it was pogo you wanted to trigger it?) and gives ~2s of shield time. ($0080W, adjust to suit.) The shield uses one ammo and has one frame of animation. (Again this can be adjusted.)

Keen cannot activate the shield if he has no ammo, this will play the uh-uh sound. He also cannot activate it while it's still on unless it has almost run out. (So no adding shields together, but if he has enough ammo he can spam the shield and always be protected.)

Keen will not die with the shield on, but this is separate from Godmode so it won't interfere with the cheat. Do inform me of any alterations that are wished.

Code: Select all

#Left Facing Keen compact (At $E959)
%patch $EE87 $0069W

#Compact Keen spawns and allow shield to spawn whenever Keen does
%patch $E954 $B8 $0001W  $EB $03 $B8 $FFFFW  $50 $FF $76 $FC $57 $9A $0B80000ERL
                     $83 $C4 $06 $9A $0D8F0003RL     $C7 $06 $CB3DW  $0001W 
             $FF $76 $FC $57 $9A $037D0526RL     $83 $C4 $04 $B8 $2A3ARW  $8A
             $16 $EC $7A $8E $C0 $26 $08 $16 $00FDW  $E9 $046CW
%patch $ED1C $E9 $FC55W

#Keen stores his in-level position for shield
%patch $D0F4 $8B $44 $0A $A3 $7A4CW  $8B $44 $0C $A3 $7A4EW  $90

#Disable EGAGRAPH check in Keen 4 (Frees 389 bytes at $3CF6)
%patch $3CE5 $90 $90

#Shield spawn =$037D0526RL
%patch $3CF6 $55 $8B $EC $33 $C0 $50 $9A $06BD1E11RL     $83 $C4 $02 $8B $1E
             $D8 $A7 $C7 $07 $0016W  $C7 $47 $02 $0002W  $C7 $47 $06 $0000W
             $C7 $47 $20 $0003W  $8B $46 $06 $B1 $08 $D3 $E0 $89 $47 $0A $8B
             $46 $08 $D3 $E0 $89 $47 $0C $B8 $0001W  $89 $47 $0E $89 $47 $10
             $B8 $0112W  $50 $53 $9A $09DC118CRL     $83 $C4 $04 $5D $CB

#Shield waiting action =$0112W
%patch $2EF82 $0000W $0000W $0002W $0000W $0000W $0001W $0000W $0000W
              $037D0575RL   $00000000L    $09DC176ERL   $0112W

#Shield display action =$0130W
%patch $2EFA0 $0092W $0092W $0004W $0000W $0001W $0004W $0001W $0001W
              $037D05BBRL   $00000000L    $09DC176ERL   $0130W

#Shield vanish action =$014EW
%patch $2EFBE $FFFFW $FFFFW $0000W $0000W $0000W $0004W $0000W $0000W
              $00000000L    $00000000L    $09DC176ERL   $0112W

#Shield waiting behavior: When 'S' pressed =$037D0575RL
%patch $3D45 $55 $8B $EC $83 $EC $0C $56 $57 $8B $76 $06 $83 $3E $C685W  $00 #Check 'S'
             $74 $2E $83 $3E $7A58W  $00 $75 $05 $B8 $000EW  $EB $19 $83 $3E #Ammo, pushbutton
             $7A4AW  $10 $77 $1B $C7 $06 $7A4AW  $0080W  $FF $0E $7A58W  $C7 #Dec ammo, set shield
             $44 $1C $0130W  $B8 $0004W  $50 $9A $187409F1RL     $83 $C4 $02 #Play sound
             $5F $5E $8B $E5 $5D $CB

#Shield display behavior (Jump to Keen, dec shield counter) =$037D05BBRL
%patch $3D8B $55 $8B $EC $83 $EC $0C $56 $57 $8B $76 $06 $8B $1E $A7D6W $A1 
             $7A4CW  $89 $44 $0A $A1 $7A4EW  $89 $44 $0C $83 $3E $7A4AW $00
             $75 $07 $C7 $44 $1C $014EW  $EB $04 $FF $0E $7A4AW  $5F $5E $8B $E5 $5D $CB

#Death also checks for shield variable before letting Keen die
%patch $CC04 $83 $3E $7A4AW  $00 $74 $03 $5D $CB
Stellar patching. Can you modify the alt-jump height patch to work while the other's running? I think the duration is fine and the sound is a nice touch.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Doesn't it work? I have both patches in a patchfile here and they seem to be ok; what happens with yours?
Post Reply