Shootable QED

Request patches for Keens 4-6.
User avatar
Gridlock
Posts: 71
Joined: Sat Feb 05, 2011 7:04 am

Shootable QED

Post by Gridlock »

Hello,

I have a request for The Alphamatic. I hate to ask more of you all given how busy you are, but this is a bit time sensitive if I want the game out soon. If I don't get this implemented soon, I'll have to give up on it.

I would like to modify the QED so that Keen must shoot it x amount of times to destroy it. This would involve Keen's bullets hitting the QED sprite, spawning an explosion sprite, and playing a sound effect. After the QED's health has been depleted to zero, it would perform its normal explosion sequence (both tiles and the explosion sprite), then load the ending as usual.

Fortunately, part of this patch has already been written here: http://www.shikadi.net/keenwiki/Patch:Q ... o_(Sprite)

I've modified it slightly so that it responds to Keen's bullets and has a health of 25 (for now). The impact explosion is still a shockshund shot explosion.

Code: Select all

#Q.E.D. collision
%patch $9E88 $55 $8B $EC $56 $8B $76 $08 $83 $3C $03 $74 $03 $5E $5D $CB $B8
             $2FE0W  $50 $56 $9A $090B1242RL     $83 $C4 $04 $C7 $44 $00 $0000W
                 $8B $76 $06 $FF $4C $40 $74 $03 $5E $5D $CB $FF $74 $2E $FF
             $74 $2C $9A $0F920628RL     $83 $C4 $04 $FF $74 $2E $FF $74 $30
             $9A $0F920628RL     $83 $C4 $04 $FF $74 $32 $FF $74 $2C $9A $0F920628RL
                         $83 $C4 $04 $FF $74 $32 $FF $74 $30 $9A $0F920628RL
                 $83 $C4 $04 $68 $0003W  $68 $0003W  $FF $74 $2E $FF $74 $2C
             $68 $0002W  $FF $36 $9E51W  $68 $0020W  $90 $90 $90 $90 $90    $83
             $C4 $0E $56 $9A $06B91E47RL    $44 $44 $FF $0E $6F5EW  $74 $03
             $5E $5D $CB $9A $0F920677RL    $5E $5D $CB

#New QED action uses collision
%patch $334C6 $FFFFW $FFFFW $0000W $0000W $0001W $0008W $0080W $0000W
              $00000000L    $090B0DD8RL   $00000000L    $3186W
However, there are some issues. First, this doesn't cause the QED tiles to change to the destroyed tiles. Also, the explosion spawns too far left by about 1/2 to 1 tile. I'm using the original QED level to test this as well, so it's not a tile location problem.

The impact explosion sprite and sound effect are a bit trickier, and I have a few ideas. I don't plan on using the spirogrip, so its sprites and 2 sounds could potentially be used here.

For the impact explosion sprites:

One possibility is to replace the shockshund explosion with a custom set of explosion frames created from the spirogrip. Another possibility is to use the spirogrip frames to spawn frames over the QED as it takes damage; basically glass crack sprite frames on top of the QED tiles. For example, every 3 hits the frame would advance to show it more cracked. The spirogrip has lots of sprites, so maybe both of these ideas could be combined.

For the impact sound:

This could be a single sound that plays each time the QED is hit, two sounds that alternate for each hit, or one sound that plays for a normal hit and a second that plays when the glass breaking animation described above progresses a frame.


I hope this isn't too ambitious or tricky. I would greatly appreciate any thoughts on how to do this/if it's possible.

Oh, and the basic level idea here is to create a vertical shaft that Keen must ascend via moving platforms. The QED would be at the very top of the shaft, and Keen would have shoot upwards at it while standing on a moving platform, dodging various obstacles at the same time.

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

Post by levellass »

Right, all options should be possible, what one do *you* want to see?
User avatar
Gridlock
Posts: 71
Joined: Sat Feb 05, 2011 7:04 am

Post by Gridlock »

Great! My preference would be to split up the spirogrip so that 8 frames are used for glass crack frames, while the other 4 are used for a custom shot impact sprite in place of the shockshund shot explosion.

For the health, I think it'd be nice if the QED started as normal with full health. After the first shot, the first spirogrip frame for the glass crack would appear. Then, after another 3 shots, you'd get the second glass crack frame. This would continue until you reach the 8th spirogrip glass crack frame. Then, after three more shots, the final QED animation would occur and lead into the ending.

I'm pretty flexible with all this, so let me know if you have questions or need to modify this plan at all. I really appreciate your help!
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

And what do you want for the sounds?

Also, at present the destruction spawns four identical explosion sprites in a square (2E-2C, 2E-30, 32-2C, 32-30) but with no change in tiles. Do you want this to remain the case? The number of spawned explosions plus their location can be changed, or they can be scrapped entirely, replaced by an exploding QED sequence.

Finally, you're definitely not using the spriogrip? That frees up a lot of options.
User avatar
Gridlock
Posts: 71
Joined: Sat Feb 05, 2011 7:04 am

Post by Gridlock »

For sounds, let's use the spirogrip's two sounds. One sound plays when a shot impacts the QED and the glass break animation doesn't change, and another plays when the glass break animation does change. We can still use the normal QED/fuse destroyed sound (I think they're the same sound?) when the QED is completely destroyed.

For the QED destruction, I basically just want it to remain the same as in the original Keen 5. This includes the change to the block of tiles and the spawning of the final QED explosion sprite. The only difference will be the location. The current upper left corner is at 4803 in the level, although I'm assuming that location patch can be changed pretty easily if necessary without side effects.
User avatar
Nisaba
Posts: 320
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Post by Nisaba »

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

Post by levellass »

Ok, still having some problems with this patch, but here is the bare bones version.

Here the EM or H Spirogrip spawns the QED, to avoid certain issues with the fuse smash stuff. It has 24 health and Keen can shoot it, his shot forming a custom smashed sprite using the first 4 Spirogrip frames. When out of health fuse smashes appear and the game is won.

There's a lot to be added in, but I'm trying t pin down a mysterious bug and this patch allows alpha testing without the fancy effects.

Code: Select all

#Custom shot smash actions, use Spirogrip =$2824W
%patch $32B64 $0189W $0189W $0000W $0000W $0000W $000CW $0000W $0000W 
              $00000000L    $00000000L    $090B17B5RL   $2842W
%patch $32B82 $018AW $018AW $0000W $0000W $0000W $000CW $0000W $0000W 
              $00000000L    $00000000L    $090B17B5RL   $2860W
%patch $32BA0 $018BW $018BW $0000W $0000W $0000W $000CW $0000W $0000W 
              $00000000L    $00000000L    $090B17B5RL   $287EW
%patch $32BBE $018CW $018CW $0000W $0000W $0000W $000CW $0000W $0000W 
              $00000000L    $11C40456RL   $090B17B5RL   $0000W

#Remove fragment collision from Mine fragment
%patch $32A6A $11C40D61RL

#Smashed shot collision, do explode stuff if QED health is 0
%patch $12096 $55 $8B $EC $56 $8B $76 $08 $83 $3E $6F34W  $00 $74 $03 $E9 $0085W  $FF $74 $2E
              $FF $74 $2C $9A $0F920628RL     $83 $C4 $04 $FF $74 $2E $FF $74
              $30 $9A $0F920628RL     $83 $C4 $04 $FF $74 $32 $FF $74 $2C $9A
              $0F920628RL     $83 $C4 $04 $FF $74 $32 $FF $74 $30 $9A $0F920628RL
              $83 $C4 $04 $B8 $0002W  $50 $B8 $0004W  $50 $B8 $000BW 
              $50 $B8 $0010W  $50 $33 $C0 $50 $50 $9A $174E0D75RL     $83 $C4
              $0C $B8 $0002W  $50 $B8 $0004W  $50 $B8 $000DW  $50 $B8 $0010W 
              $50 $33 $C0 $50 $B8 $0004W  $50 $9A $174E0D75RL     $83 $C4 $0C
              $9A $0F920677RL     $56 $9A $06B91E47RL     $83 $C4 $02 $FF $0E
              $6F34W  $5E $5D $CB


#Spirogrip always produces QED
%patch $F4E4 $0280W $0280W $0280W

#Spirogrip spawn produces QED, caches Spirogrip
%patch $EFD0 $C7 $06 $6F34W  $0018W  $57 $56 $9A $11C41D56RL     $83 $C4 $04
             $C7 $06 $C2A5W  $0001W  $C7 $06 $C291W  $0001W  $E9 $03B8W

#New collision: Respond to Keen's shots =$11C40B61RL
%patch $127A1 $55 $8B $EC $56 $8B $76 $08 $83 $3C $03 $75 $F1 $C7 $04 $0001W #Custom smash shot
              $C7 $44 $1C $2842W  $FF $0E $6F34W
               $5E $5D $CB

#QED initial state- uses collision
%patch $334C6 $018DW $018DW $0000W $0000W $0001W $0008W $0000W $0000W
              $00000000L    $11C40B61RL   $090B17B5RL   $3186W
User avatar
Gridlock
Posts: 71
Joined: Sat Feb 05, 2011 7:04 am

Post by Gridlock »

Oh wow, I've been so busy I had no idea you posted this several weeks ago. I'll give it a try when I get a chance. Emphasis on the when.
User avatar
Gridlock
Posts: 71
Joined: Sat Feb 05, 2011 7:04 am

Post by Gridlock »

Hey Levellass, I've finally found some time to try out this patch. The barebones version does seem to work for my purposes. Have you set up the QED tile change yet? Even with patching the new QED coordinates I can't seem to get the tiles to switch to the destroyed QED fuse (unless I'm doing something wrong).

I should have more time to work on this, but I'm not sure how busy you currently are. Thanks!
User avatar
Gridlock
Posts: 71
Joined: Sat Feb 05, 2011 7:04 am

Post by Gridlock »

Just a note: I've noticed that sometimes you can shoot the fuse continuously and it won't get destroyed. This seems to happen about 1/3 - 1/2 of the time, but I can't figure out exactly what steps are needed to reproduce it. Just a random guess, but is it possible that the health value could go negative without setting off the destroy sequence?

Anyway, if you need a place to test this, I could send you the latest copy of the game (it's almost finished). Let me know when you feel up to working on this.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Shootable QED

Post by levellass »

Hey there,

I'm up to it now actually, between frantically cooking up turkey and baked deserts. Might be good to get a January release on this.
User avatar
Gridlock
Posts: 71
Joined: Sat Feb 05, 2011 7:04 am

Re: Shootable QED

Post by Gridlock »

Fantastic! I'll send you the latest build by PCKF pm.

Just a warning: In a week's time, my free time is going to drop off the face of the Earth, at least for a while. I hate to impose a deadline, but it would be best if we could wrap this patch up before then.

Found another bug with the current patch: health points are not preserved between savegames. If you load a save, the health reverts to 24.

Oh, and if we are still doing the glass "crack" sprites we'll probably want those to be layered in front of foreground tiles (the sprite currently appears behind).

One other minor patch request (not sure if this really needs a new topic). Can the shikadi mine fragments be altered so they don't become inactive when offscreen? In a few spots, the fragments get preserved offscreen until later, and Keen can bump into them and die a rather random death.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Shootable QED

Post by levellass »

I shall start work on all these tomorrow, it should hopefully only take an hour's effort to organize everything. The hectic New Years has rather thrown my schedule into chaos, many apologies.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Re: Shootable QED

Post by levellass »

Right, after an *unbelieveable* number of annoyances this *should* be the patch you're after. You WILL have to adjust the crack sprite's hitbox and location since at present the QED can only be hit once before changing animation and hiding inside solid tiles. This should solve the 'immortal QED' problem too. Remember to totally delete all other QED patches to avoid complicates and errors!

The health needed to get each QED animation can be seen in its behavior and easily adjusted.

Code: Select all

#Spirogrip always produces QED
%patch $F4E4 $0280W $0280W $0280W

#Spirogrip spawn produces QED, caches Spirogrip, anim
%patch $EFD0 $57 $56 $9A $06B90B00RL     $83 $C4 $04
             $C7 $06 $C2A5W  $0001W  $C7 $06 $C291W  $0001W  $E9 $03BEW

#Disable Add VBLs (Free $7690-$7715)
%patch $768D $E9 $0086W

#New QED spawn, foreground, set health =$06B90B00RL
%patch $7690 $55 $8B $EC $33 $C0 $50 $9A $06B91DCDRL     $83 $C4 $02 $8B $1E
             $40 $9E $C7 $07 $000DW  $C7 $47 $02 $0001W  $C7 $47 $20 $0003W
             $C7 $47 $06 $0000W  $83 $3E $6F34W  $01 $73 $06 $C7 $06 $6F34W  $0018W  $8B $46 $06 $B1 $08
             $D3 $E0 $89 $47 $0A $8B $46 $08 $D3 $E0 $05 $FF00W  $89 $47 $0C
             $C7 $47 $0E $0001W  $C7 $47 $10 $0001W  $B8 $2824W  $50 $53 $9A
             $090B11C4RL     $83 $C4 $04 $C7 $06 $6F5CW  $0000W  $5D $CB

#When Keen dies reset fuse
%patch $C048 $06 $B8 $0BB2W  $50 $EB $04 $B8 $0BD0W  $50 $FF $36 $3E $9E
             $9A $090B1242RL     $83 $C4 $04 $C7 $06 $6F34W  $0000W  $C7
             $06 $6F5CW  $0000W

%patch $7A72 $90 $90	#Debug keys always on
%patch $7A79 $90 $90	#-F10

#New collision: Respond to Keen's shots =$11C40B61RL
%patch $127A1 $55 $8B $EC $56 $8B $76 $08 $83 $3C $03 $75 $F1 $C7 $04 $0001W #Custom smash shot
              $C7 $44 $1C $2842W  $FF $0E $6F34W  $FF $0E $6F5CW  $83 $3E $6F5CW
                  $00 $75 $06 $C7 $06 $6F5CW  $0003W  $B8 $0005W  $50 $9A
              $196E09EFRL     $83 $C4 $02 $5E $5D $CB

#QED behavior: Set sprite depending on health
%patch $127EA $55 $8B $EC $56 $8B $76 $06 $83 $3E $6F34W  $17 $75 $05
              $C7 $44 $1E $018DW   $83 $3E $6F34W  $14 $75 $05
              $C7 $44 $1E $018EW   $83 $3E $6F34W  $11 $75 $05
              $C7 $44 $1E $018FW   $83 $3E $6F34W  $0E $75 $05
              $C7 $44 $1E $0190W   $83 $3E $6F34W  $0B $75 $05
              $C7 $44 $1E $0191W   $83 $3E $6F34W  $08 $75 $05
              $C7 $44 $1E $0192W   $83 $3E $6F34W  $05 $75 $05
              $C7 $44 $1E $0193W   $83 $3E $6F34W  $02 $75 $05
              $C7 $44 $1E $0194W   $5E $5D $CB

#QED initial state- uses special-shot collision
%patch $334C6 $0000W $0000W $0000W $0000W $0001W $0008W $0000W $0000W
              $11C40BAARL   $11C40B61RL   $090B17B5RL   $3186W

#Custom shot smash actions, use Spirogrip =$2824W
%patch $32B64 $0189W $0189W $0000W $0000W $0000W $000CW $0000W $0000W 
              $00000000L    $00000000L    $090B17B5RL   $2842W
%patch $32B82 $018AW $018AW $0000W $0000W $0000W $000CW $0000W $0000W 
              $00000000L    $00000000L    $090B17B5RL   $2860W
%patch $32BA0 $018BW $018BW $0000W $0000W $0000W $000CW $0000W $0000W 
              $00000000L    $00000000L    $090B17B5RL   $287EW
%patch $32BBE $018CW $018CW $0000W $0000W $0000W $000CW $0000W $0000W #Here
              $00000000L    $11C40456RL   $090B17B5RL   $0000W

#Remove fragment collision from Mine fragment
%patch $32A6A $11C40D61RL

#Shot collision: when health depleted smash fuse =$11C40456RL
%patch $12096 $55 $8B $EC $56 $8B $76 $08 $83 $3E $6F34W  $01 $73 $EF $FF $74 $2E
              $FF $74 $2C $9A $0F920628RL     $83 $C4 $04 $FF $74 $2E $FF $74
              $30 $9A $0F920628RL     $83 $C4 $04 $FF $74 $32 $FF $74 $2C $9A
              $0F920628RL     $83 $C4 $04 $FF $74 $32 $FF $74 $30 $9A $0F920628RL
              $83 $C4 $04 $B8 $0002W  $50 $B8 $0004W  $50 $B8 $000BW 
              $50 $B8 $0010W  $50 $33 $C0 $50 $50 $9A $174E0D75RL     $83 $C4
              $0C $B8 $0002W  $50 $B8 $0004W  $50 $B8 $000DW  $50 $B8 $0010W 
              $50 $33 $C0 $50 $B8 $0004W  $50 $9A $174E0D75RL     $83 $C4 $0C
              $9A $0F920677RL     $56 $9A $06B91E47RL     $83 $C4 $02 $C7 $06 #Penalty for savegame scumming
              $6F34W $0003W   $5E $5D $CB
This patch will change things so Keen's shots track the QED's health.

Code: Select all

#Track
%patch $CF2D $6F34W

Try this out and get back to me.
User avatar
Gridlock
Posts: 71
Joined: Sat Feb 05, 2011 7:04 am

Re: Shootable QED

Post by Gridlock »

I was able to give this patch a quick try and it seems to do what I need it to. Unfortunately, since I just moved halfway across the US, I don't currently have the computer setup to properly dig into editing the hitbox details at the moment. Once I get things sorted out then I'll get those graphics and hitboxes fixed to make sure everything is working properly. I should have a better computer to work with by the end of this coming week.

I did try this out by removing the solid QED tiles entirely, and it seems to work as intended. Though I can't confirm that the tile change occurs at the end, I at least get the explosion sprites and get the game to load the ending.

I also haven't checked how the sound works yet. I did include the two sounds I plan on using in the folder I sent you. I'm assuming that we'll use spirogrip sound slots and you can just tell me which sound numbers to replace?

Thanks!
Post Reply