A couple Vortimom requests

Request patches for Keens 1-3.
Post Reply
User avatar
Flyingmouse
Posts: 101
Joined: Wed Aug 05, 2009 8:33 pm
Location: Someplace

A couple Vortimom requests

Post by Flyingmouse » Fri Jul 27, 2018 4:27 am

Only took five years for me to actually start modding Keen again... Anyway, I was hoping to get help on a couple patches:

> EDIT: Change of plans - I'd actually prefer to keep the original sprites as is, and create new sprites. See post #8.
> Since I've already disabled the Vortimom from shooting (while still using the original behavior as a turning frame), would it be possible to have the Vortaninja shoot with her projectile as it jumps? I haven't had much luck figuring out how to port behaviors from the Vortimom onto the Vortaninja and have it not break afterwards (my knowledge of transferring behaviors is... limited at best), but if that's an easier method then it should work too.[/s]

> I'm using the health patch for Keen 3, modified a bit to use the pogo (instead of the red keycard) as a kill switch; would it be easier to patch enemies to give the pogo when they hit Keen, or automatically kill Keen through the health system? I did find a similar keycard behavior for Keen 1, but I'm not sure how well it would transfer over given it's a $0AF2 patch... If possible, this would replace the Vortimom's pushing collision.

Edit: If it helps any, $983F-$985E and $0DE9-$0E21 should be available for additional space (I did a bit of cuts on the pop-ups).
Edit 2: Clarified initial patching on first request.
Last edited by Flyingmouse on Fri Aug 17, 2018 6:20 am, edited 2 times in total.

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

Re: A couple Vortimom requests

Post by Nisaba » Sun Jul 29, 2018 6:22 pm

hey there and welcome back!

just wanted to let you know that the clocks a ticking a bit slow around here. unfortunately I can't help you with your requests but I'm certain some wiser forum members will! it might take some time, but that's ok...

User avatar
Flyingmouse
Posts: 101
Joined: Wed Aug 05, 2009 8:33 pm
Location: Someplace

Re: A couple Vortimom requests

Post by Flyingmouse » Mon Jul 30, 2018 12:46 am

Time's not a huge issue, these should be the last two patches I need and I've barely started on art/levels so I can wait.

On another note, Is there an issue I'm not thinking of with using the extra space for Keen collisions? Using this as reference, I copied what I think is the collision code for Keen dying at 7CAF (E8 57 FC EB 00?) over to 0DE9, but calling to it just shunts the camera over to the top-left corner of the map.

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

Re: A couple Vortimom requests

Post by levellass » Wed Aug 01, 2018 3:11 am

Hokay, you might wanna post some of what you've patched to make things easier.

First up for the Vortimom, did you simply stop the Vortimom making a shot or did you make it so that she doesn't use her shooting behavior at all? Due to the way that the behaviors work (The Vortininja is given a jump speed THEN sent to jump) we may well need to simply code up a new behavior for him on the fly. This patch, as you can see, keeps the Vortininja stuck, AND he doesn't make a shot:

Code: Select all

#Ninja shoot-jumps attempt
%patch $4997 $44B9W #Ninja shoots when Keen spotted
%patch $4539 $499DW #After shooting, jump

Second, what health patch is this and what does it do?

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

Re: A couple Vortimom requests

Post by levellass » Wed Aug 01, 2018 3:18 am

Thirdly, $E8 code usually (But not always!) means that you're dealing with a jump In this case you are. The code is $E8 $FC57W which sends the game to $7CAF + 3 + $FC57 = $17909 -> $7909.

If you're moving it to $0DE9 you need to adjust this. This will be $7909 - $DE9 - 3 = $6B1D. We also add an 'end code' thing at the end so that it doesn't have to bounce back to where it started:

Code: Select all

#Move Keen's death call to 0DE9:
%patch $0DE9 $E8 $6B1DW  $5F $5E $5D $C3

This doesn't do much on its own since really this code just says 'Go to Keen's usual death code'. I'm not sure what you aim to accomplish with it.

User avatar
Flyingmouse
Posts: 101
Joined: Wed Aug 05, 2009 8:33 pm
Location: Someplace

Re: A couple Vortimom requests

Post by Flyingmouse » Wed Aug 01, 2018 5:03 am

I'm using the health patch posted in KeenWiki here with the small difference of using the pogo instead of the red keycard to check for hazard tiles:

Code: Select all

#Lives now act as health; Keen dies when hit with 1 health
#SIDE EFFECT: C-T-Space is disabled
%patch $114E $EB $16
%patch $790C $81 $3E $9D1AW  $0001W  $0F $84 $06 $00 $E9 $954BW
%patch $0E64 $81 $3E $9946W  $0000W  $7F $12 $81 $3E $9D46W  $0001W  $7E $0D
             $FF $0E $9D46W  $C7 $06 $9946W  $0100W  $E9 $6AD3W  $E9 $6A98W
#Hazard tiles now give the Pogo, thus killing Keen through invincibility
#SIDE EFFECT: Keen is still killed by hazards in God Mode
%patch $7A32 $E8 $4F $94
%patch $0E84 $C7 $06  $9D1AW  $0001W  $E8 $6A7CW  $C3
Is there any way to, with a keen-sprite collision at 0DE9 (I'm wanting to keep this separate from the pushing behavior), have an enemy trigger the kill switch in the above patch by giving the pogo?

Regarding the Vortininja, I currently have it set up for the Vortimom to play the shooting animation but not fire with this patch, which mostly works, but I've occasionally had her shots randomly appear about 20-30 tiles below her:

Code: Select all

#Vortimom pauses, but doesn't shoot
%patch $4562 $01 $00

User avatar
Flyingmouse
Posts: 101
Joined: Wed Aug 05, 2009 8:33 pm
Location: Someplace

Re: A couple Vortimom requests

Post by Flyingmouse » Tue Aug 07, 2018 8:07 pm

Still unsure on the Vortininja patch, but after a bit of fumbling I found out the second patch required much less work than I thought:
(Note that the example here only works with the disable EKA patch; if needed you can move it elsewhere, but be sure to set up the $E8 call)

Code: Select all

#Disable Extra Keens At counter (needed to free up space starting at 0DE9)
%patch $0DE7 $5D $C3
#0DE9 collision sets lives to 1, then kills Keen (with the health patch, this should kill Keen regardless of health)
%patch $0DE9 $C7 $06 $9D46W $0001W $E8 $6B17W $5F $5E $5D $C3
#Vortimom uses 0DE9 collision:
%patch $7CBC $0DE9W
Edit: wrong formatting on last patch

User avatar
Flyingmouse
Posts: 101
Joined: Wed Aug 05, 2009 8:33 pm
Location: Someplace

Re: A couple Vortimom requests

Post by Flyingmouse » Fri Aug 17, 2018 6:32 am

levellass wrote:
Wed Aug 01, 2018 3:11 am
Due to the way that the behaviors work (The Vortininja is given a jump speed THEN sent to jump) we may well need to simply code up a new behavior for him on the fly.
This actually gave me an idea for getting a bit more freedom with spriting - since there's a lot of free space on the B800 code that I can disable pretty easily, I might be better off just copy-pasting into this space and editing them from there (this would also allow me to keep the original enemies for a small amount of variety). However, I've run into an issue regarding linking this information to sprite spawning - I can't figure out how to set up an E8 call to $12AC0-$13A6F from the initialization codes (specifically $3B1B, $3B25 and $3B42 for Ball, Jack, and Vorticon 2 respectively), since the value necessary to jump that far would be counted as a negative number. Am I better off finding space elsewhere (or just not bothering with this and have the Vortaninja just act like a Vortaninja), or is there some way to call to this position without also running out of space in the initialization code?

User avatar
Fleexy
Site Admin
Posts: 482
Joined: Fri Dec 12, 2008 1:33 am
Location: Blogham Tower
Contact:

Re: A couple Vortimom requests

Post by Fleexy » Fri Aug 17, 2018 3:38 pm

If you can find a bit of space in the middle (just enough for a jump instruction), you could use multiple jumps. The first from the initialization code would jump to the middle, which would immediately jump to the real destination.

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

Re: A couple Vortimom requests

Post by levellass » Fri Aug 17, 2018 11:14 pm

A negative number will work, IF it is early enough in the code that a backwards jump is impossible This is used for several sound calls for example. So does your jump give a sensible result if it's negative? If not it should work going forward, otherwise we can just swap out a behavior of, say the Vortimom, and put the initialization there.

User avatar
Flyingmouse
Posts: 101
Joined: Wed Aug 05, 2009 8:33 pm
Location: Someplace

Re: A couple Vortimom requests

Post by Flyingmouse » Sat Aug 18, 2018 1:01 am

I think I may have found a better (if smaller) option in the unused demo code at $20DC? For example, if I use the following patch...

Code: Select all

#New Ball spawning code
%patch $3B1E $E5BCW # Initialization now jumps to $20DC instead of $3E72
%patch $20DC $55 $8B $EC $56 $E8 $3EDAW  $8B $F0 $C7 $04 $0008W  $8B $46 $04
             $99 $B1 $0C $E8 $CACFW  $89 $44 $04 $89 $54 $06 $8B $46 $06 $99
             $B1 $0C $E8 $CAC0W  $89 $44 $08 $89 $54 $0A $C7 $44 $32 $4C0BW
             $C7 $44 $34 $6A00W  $C7 $44 $24 $0001W  $8B $44 $06 $8B $54 $04
             $3B $06 $0C $71 $7C $0F $7F $06 $3B $16 $0A $71 $76 $07 $C7 $44
             $20 $FE70W  $EB $05 $C7 $44 $20 $0190W  $8B $44 $0A $8B $54 $08
             $3B $06 $10 $71 $7C $0F $7F $06 $3B $16 $0E $71 $76 $07 $C7 $44
             $22 $FE70W  $EB $05 $C7 $44 $22 $0190W  $C7 $44 $28 $006DW  $5E
             $5D $C3 #Second patch copy-pasted from Keenwiki, slightly edited so $E8 calls match
It functions as a ball normally does. I feel like this may be easier in the long run than setting up multiple chained $E8 calls, but would replacing this code have any negative effects on the rest of the game? It seemed to function normally when I played it, but there may be some behind-the-scenes stuff I'm missing.

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

Re: A couple Vortimom requests

Post by levellass » Sat Aug 25, 2018 1:46 am

It appears not, I have a small program that looks for calls to code and it doesn't seem to have found any. This isn't foolproof, it's only rough, but it seems you're in the clear there.

Post Reply