Spawning Keen off camera

Request patches for Keens 4-6.
Post Reply
User avatar
Nisaba
Posts: 320
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Spawning Keen off camera

Post by Nisaba »

Is it possible to spawn Keen (K4-6) off camera?
If so: how to?


(I assume it is the same "problem" like this bug over here: http://www.shikadi.net/keenwiki/Keen_4_ ... ies_Beyond
...maybe there exists a workaround?)
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

When Keen is spawned the game takes note that he is the 'player' sprite, one that can't be removed or tampered with. By default the camera will always center on him. Attempting anything else depends very much on what you want to do. DO you want a still camera that never moves? One that stars elsewhere and 'slides' to Keen? Something else?
User avatar
Nisaba
Posts: 320
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Post by Nisaba »

hey there, thanx for reply.
the idea concerns only chosen single levels, in which Keen falls into the screen of action.
offside: the camera is 'waiting'.
on-screen: camera follows Keen as usual.
I was thinking about a blocking element which limits the camera-movement at level start. but your option b) sounds promising, too (sliding camera).
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Ok, so there are two options for that, one is that the camera slides to where Keen is, the other is the camera stays still and Keen slides, walks or other actions his way onscreen. For both the player probably won't be able to do anything until the camera and Keen 'sync' What would you prefer and for which episode?
User avatar
Nisaba
Posts: 320
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Post by Nisaba »

well, both are attractive, aren't they? for my special needs I think option B (Keen slides on-screen) sounds promising.

one important thing to add: this option mustn't be globally set. only a single level (or two) do need this little extra...

and it's again K4 (for a start).
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Ok, looking at this it's gonna be much easier for me if your Well Of Wishes level is level 1 instead of level 17. (If you want multiple W.O.W. levels they'd be levels 1, 2, 3... etc) And yeah, the W.O.W levels don't have to be the ones where Keen spawns off camera, it's just I'll probably need to tweak the game's camera scrolling code, which relates to the W.O.W.

That ok with you?
User avatar
Nisaba
Posts: 320
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Post by Nisaba »

not sure if I got this right...

what I need is:
1x World of Warcraft level (I don't care which number it has (1-17), but it needs to behave like a WoW level)
1x Keen spawns off camera and slides onscreen level (which is not! the WoW but could be level #17 if code tweaking requires so)

does this answer your question?
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Right, you seem to want Keen to rise up off the screen bottom, which is much easier tan making him walk onscreen. This patch turns the 'I' Keen into a Keen spawn that will make him rise up to the level of the I Keen from 5 tiles below before becoming playable.

There are a few issues with this. The I Keen must have an animation to place properly, here I use the raindrop splash. You can make your own invisible animation or hide it behind a tile or background.

The distance here is 5 tiles lower, $0500W, not sure if that's enough. Changing the lowering distance requires also changing both the rising Keen's timer and the I Keen's timer (They must match exactly.) This patch is set up so Keen rises neatly onto floor level. The rising speed here is $0004W, this can be changed but needs the timers to be changed too.

If you have trouble with this I have modified the mod you sent me to use this patch in the first level.

Code: Select all

#**************************#
#Keen-vs-camera
#**************************#

#Disable EGAGRAPH check in Keen 4
%patch $3CE5 $90 $90

#New Keen spawn, 'I' Keen
%patch $EECB $00A9W #'I Keen' (At $E999)

#Change pointers to free up space
%patch $EE87 $0069W #Left Facing Keen (At $E959)
%patch $EE89 $0081W #Map Keen (At $E971)

#Compact Keen inits
%patch $E954 $B8 $0001W  $EB $03 $B8 $FFFFW  $50 $FF $76 $FC $57 $9A $0B80000ERL
                     $83 $C4 $06 $C7 $06 $CB3DW  $0001W  $EB $12
%patch $E971 $FF $76 $FC $57 $9A $0D8F050ARL     $83 $C4 $04 $C7 $06 $CB4FW
             $0001W  $9A $0D8F0003RL     $B8 $2A3ARW $8A $16 $EC $7A $8E $C0
             $26 $08 $16 $00FDW  $E9 $0464W
%patch $E999 $B8 $0001W  $50 $FF $76 $FC $57 $9A $037D0526RL     $EB $BE

#New Keen spawn=$037D0526RL
%patch $3CF6 $55 $8B $EC $8B $1E $D6 $A7 $C7 $07 $0002W  $C7 $47 $02 $0002W
             $C7 $47 $20 $0001W  $8B $46 $06 $B1 $08 $D3 $E0 $89 $47 $0A $8B
             $46 $08 $D3 $E0 $05 $FF0FW  $89 $47 $0C $8B $46 $0A $89 $47 $0E
             $C7 $47 $10 $0001W  $B8 $0CD4W  $50 $53 $9A $09DC118CRL     $83
             $C4 $04 $5D $CB

#New action sequence, Keen final position ticks, becomes Keen =$0CD4W
%patch $2FB44 $00D7W $00D7W $0000W $0000W $0000W $0006W $0000W $0000W #Make Keen
              $037D056ARL   $00000000L    $09DC176ERL   $013DW
%patch $2EFAD $00D7W $00D7W $0000W $0000W $0000W $0186W $0000W $0000W #Wait for Keen's arrival
              $037D056ARL   $00000000L    $09DC176ERL   $098CW

#Action behavior, create a Keen offscreen =$037D056ARL
%patch $3D3A $55 $8B $EC $56 $8B $76 $06 $B8 $0001W  $50 $9A $06BD1E11RL
             $83 $C4 $02 $8B $44 $0A $8B $1E $D8 $A7 $89 $47 $0A $8B $44 $0C
             $05 $0600W  $89 $47 $0C $C7 $47 $10 $FFFFW  $C7 $07 $001FW  $C7 #Keen image depth =480
             $47 $06 $0000W  
             $8B $44 $0E $8B $1E $D8 $A7 $89 $47 $0E $B8 $011FW  $50 $53 $9A
             $09DC118CRL     $83 $C4 $04 $5E $5D $CB

#Keen action, rise up to meet Keen-final =$011FW
%patch $2EF8F $0082W $0082W $0001W $0000W $0000W $0186W $0000W $0004W
              $00000000L    $00000000L    $09DC176ERL   $0000W
User avatar
Nisaba
Posts: 320
Joined: Fri Jan 01, 2016 11:15 pm
Location: patch.pat
Contact:

Post by Nisaba »

yaus! what a nice surprise. haven't noticed your answer yet, seems I totally missed it. this workaround is pretty nice! tweaking around a bit and trying things out is so much fun.

but fortunately I couldn't synch the I Keen with the elevator platform so Keen can actually slide into action via this kind of lift.
It seems that the elevator has a speeding which is something in between $0009 and $000A

Another thing which bothers me is that I wasn't able to shorten the I Keen length from 5 tiles to say 2 tiles below before becoming playable. which screws to tweak?

plus for some strange reason I Keen spawns twice

so, yeah. before customizing sprite 4SPR0216.BMP I kindly ask for your offer of sending me the modified version of yours.
levellass
Posts: 3001
Joined: Wed Oct 11, 2006 12:03 pm
Location: Ngaruawahia New Zealand

Post by levellass »

Ok, given what you're trying to do it might be best for you to send me your failed copy so I can see why needs to be done.

The depth Keen spawns from is 6 tiles, not 5, sorry. It's adjusted on the last part here:

Code: Select all

%patch $3D3A $55 $8B $EC $56 $8B $76 $06 $B8 $0001W  $50 $9A $06BD1E11RL
             $83 $C4 $02 $8B $44 $0A $8B $1E $D8 $A7 $89 $47 $0A $8B $44 $0C
             $05 $0600W
Keen's rising speed can also be changed by altering this line, specifically $004W and $0186W, changing $0186W makes Keen move faster, for a shorter period of time, this might be useful in more 'delicate' tweaks of Keen's speed.

Code: Select all

%patch $2EF8F $0082W $0082W $0001W $0000W $0000W $0186W $0000W $0004W 
Post Reply