PATCHES GALORE: Keen 1 Sprite Properties (don't miss this!)

Completed patches for Keen1.
Post Reply
xtraverse
Patch Crafter
Posts: 290
Joined: Tue Sep 02, 2003 6:42 pm
Location: Easter Island
Contact:

PATCHES GALORE: Keen 1 Sprite Properties (don't miss this!)

Post by xtraverse »

I made quite an interesting find today while researching ice launchers. First I'll start off with the boring discovery:

You can change the location a mini ice cube goes to with the following patches. I'm not quite sure how the values work, but the ice cubes go down right, down left, up right, and up left respectively. The default values are shown.

Code: Select all

%ext ck1
%version 1.31

#ice cube 1
%patch $21D9 $2C $01
%patch $21DF $2C $01

#ice cube 2
%patch $2215 $2C $01
%patch $221A $D4 $FE

#ice cube 3
%patch $2251 $D4 $FE
%patch $2256 $2C $01

#ice cube 4
%patch $228D $D4 $FE
%patch $2292 $D4 $FE

%end
Now I'll talk about sprite properties that can be applied to the creation of any sprite. When creating a sprite, certain values are moved into locations relative to [SI]. Right now I'll talk about plain old [SI]. [SI] seems to affect the interaction between Keen and the sprite. Following are patches to mod the [SI] value of the ice cubes with the default values. Ice cubes are in the same order as the previous patch.

Code: Select all

%ext ck1
%version 1.31

%patch $21B0 $0C $00
%patch $21EC $0C $00
%patch $2228 $0C $00
%patch $2264 $0C $00

%end
Following are the meanings of values you can have there.

Code: Select all

$00 $00 #no sprite is created
$01 $00 #nothing
$02 $00 #pushes keen, if you jump on it right, a stunned yorp emerges
$03 $00 #kills (used by gargs)
$04 $00 #kills (used by vorticons)
$05 $00 #pushes keen
$06 $00 #pushes keen (used by butler bot)
$07 $00 #shots zap/zot against it
$08 $00 #shots zap/zot against it (used by falling block)
$09 $00 #shots zap/zot against it
$0A $00 #shots zap/zot against it
$0B $00 #kills (used by robots, can also kill vorticons and gargs)
$0C $00 #nothing (used by mini ice cubes)
$0D $00 #shots zap/zot against it
$0E $00 #nothing
$0F $00 #freezes/stuns keen
The next important value is [SI+0x32]. This determines what the sprite actually does.

Code: Select all

%ext ck1
%version 1.31

%patch $21B5 $21 $51
%patch $21F1 $21 $51
%patch $222D $21 $51
%patch $2269 $21 $51

%end
Following are the meanings of the values you can have there. Note that there are many possible values that I have no idea what they might do. I only list the ones I saw used in the Keen engine. Note that when I say the sprite acts like a creature, I mean that it does the same type of things. However a sprite that acts like a Vorticon will not kill Keen on touch unless it is set to in [SI].

Code: Select all

$4F $19 #acts like a Yorp
$51 $1B #acts like a Garg
$0E $1C #acts like a Vorticon
$C7 $1D #acts like a butler bot
$75 $1F #acts like a robot
$92 $21 #starts creating a ton of mini ice blocks, then crashes
$19 $29 #crashes
$60 $33 #no movement, never disappears
$E8 $47 #stays stationary, then disappears
$08 $48 #zaps/zots when hits something?
$9D $48 #sinks down changing sprite images
$21 $51 #normal movement, then disappears
The final value I'm going to talk about is [SI+0x34]. This value for the most part determines what happens to the sprite when Keen shoots it.

Code: Select all

%ext ck1
%version 1.31

%patch $21BA $60 $33
%patch $21F6 $60 $33
%patch $2232 $60 $33
%patch $226E $60 $33

%end
Following are the values I saw used in Keen. You can try other values and see what happens.

Code: Select all

$68 $1A #creates dead yorp when shot
$CE $1B #creates dead garg when shot
$6E $1D #creates dead vorticon when shot
$94 $1E #shots zot/zap against it, it keeps going and goes farther than usual if shot
$45 $20 #shots zot/zap against it, it keeps going
$A6 $22 #hits keen and is destroyed, shots make zot/zap against it
$BB $22 $creates falling block when shot
$27 $29 #crashes
$60 $33 #nothing special happens
$00 $4A #zots/zaps against keen
$49 $48 #shots zot/zap against it, it's destroyed
If you guys find the patching offsets of the [SI] variables for other sprites, you can obviously change what they do. Also, any more information you can find about values in the [SI] locations please post here. If anyone could find out the differences are between various [SI] values that appear to be same or how the ice cube directions work exactly I'd be very grateful.
Last edited by xtraverse on Fri Nov 05, 2004 11:09 pm, edited 2 times in total.
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

I love you XTRA!!!

*drool*

W0oah! Now this is awesome!! How did you find it? Anyways, garg, I can't play around with this patch until a lot later today.. :) Wow again..
User avatar
adurdin
Site Founder
Posts: 549
Joined: Fri Aug 29, 2003 11:27 pm
Location: Edinburgh, Scotland
Contact:

Post by adurdin »

Here's some of the sprite struct entries that I noted down:

Code: Select all

[si+4]: (long)x-offset (pixels * 256)
[si+8]: (long)y-offset (pixels * 256)
[si+28]: sprite image number
[si+2A]: seems to be another image number
[si+20]: x-velocity (256ths of a pixel per tick)
[si+22]: y-velocity (ditto)
[si+24]: # shots needed to kill

[si+32h]: sprite-tile collision function
[si+34h]: sprite-sprite collision function
User avatar
levellord
Crazy pAtChEr
Posts: 1401
Joined: Thu Nov 20, 2003 11:35 pm
Location: NewZealand
Contact:

Post by levellord »

OMG, do you have any idea what you'e done???

Think of the possibilities! ice cannons that spawn dozens of yorps! Adding a non killing 'garg' to your enemies! Modding enemy properties!!!

OMG!!!
Ezjay
Posts: 158
Joined: Fri Feb 27, 2004 1:15 pm
Location: Amsterdam

Post by Ezjay »

Neat...

It's all like in this topic. It's actually coming true.

And even better: a new patcher. Great work Xtra!
User avatar
adurdin
Site Founder
Posts: 549
Joined: Fri Aug 29, 2003 11:27 pm
Location: Edinburgh, Scotland
Contact:

Post by adurdin »

Looks like I'll have to give Xtraverse a custom title like I did with Keenrush... :)
User avatar
CommanderSpleen
Posts: 1017
Joined: Sun Aug 31, 2003 12:11 pm
Location: The Land of Sparkly Things
Contact:

OMGOMGOMGOMGOMGOMGOMGOMGOMG!!

Post by CommanderSpleen »

Heheheh.

Like, woah. This is trippy. It'll make for some interesting new depth to the ice launcher concept. And if this sort of thing can be applied to other sprites... =(8D)-

OMG! I just noticed the sprite spawning thing suits CK:MB's essence blaster concept beautifully. The main issue with it will be the sprite limit... easy enough to overcome through creating some sort of reason for sending them offscreen though...

>Commander Spleen
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

Great stuff xtra and adurdin! :) Phew, finally I get to test this stuff.
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

So much trippy! So cool!

For example with this the thing can make spawn gargs that have these features:
1. they will stun you when touch ('ice' you)
2. you can shoot them if you want
The best part is that if you set it to that behaviour, interesting stuff will happen: garg will freeze you, keep you in that ice block, and eventually it starts that running phase, and at the same time it will carry Keen that's on ice!! Very cool; imagine what kind of enemies could be done with this..

Cnat'tg ypuen any longer, busjtn mytou outher voolc stuff,,,,,,,, *drool*
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

Notice in those patches the bytes before the actual values are pointless; I was just too lazy to get the actual address, so there is some spare bytes.. I'll fix those tomorrow. :)

Code: Select all

# This should make the shooting bot freeze Keen if Keen touches it. :)
# For some strange reason the bot can't shoot properly.
# Also, seems that it will be erased automaticly for some strange reason if it's far from the place Keen starts the level (could even be just when it's out the screen).

%patch $171C $C7 $04 $0F $00

Code: Select all

# Make shooting robot act as garg. :) Should work no matter where the sprite is -- just be careful since the height of the garg is bigger, so it will clip the tiles and fall through the tile that's below it.

%patch $1765 $C7 $44 $32 $51 $1B

Code: Select all

# Suicidal shooting robot!
# This patch allows you to shoot the shooting robot. It spawns a dead yorp when shot.
# Since there seems to be code in the code some thing that checks if ammo is just on the enemy's clip rectangle -- when the robot shoots it causes it's own death at the same time. :p I'm sure that small drawback can be changed somehow as well.

%patch $176A $C7 $44 $34 $68 $1A
KeenRush
Patch Maker
Posts: 1988
Joined: Sun Aug 31, 2003 2:52 pm
Location: Sand Yego
Contact:

Post by KeenRush »

Code: Select all

# Killer butler bot.
# This makes butler dangerous.
# Too bad there's the same flaw than with the upper shooting robot patch -- if this gets this new value that it will kill Keen instead of pushing, the whole robot will be always erased from the screen if you can't see it (if it's away from the screen).

%patch $1780 $C7 $04 $0B $00

Code: Select all

# Change butler bot to vorticon.
# It's fun to have playful vorticon instead -- this one only pushes you around instead of killing.
# It's interesting to see that enemies changed this way don't disapper even they aren't in the screen.

%patch $17C3 $C7 $44 $32 $0E $1C

Code: Select all

# Make butler bot destroyable.
# If Keen shoots butler bot, make it spawn a shot garg.

%patch $17C8 $C7 $44 $34 $CE $1B

That's all for today -- I'll continue tomorrow after sk00l.

I just want to say:
Ten cheers/w00ts to xtraverse who started the REVOLUTION -- today! :) Yeeaaaaah!
xtraverse
Patch Crafter
Posts: 290
Joined: Tue Sep 02, 2003 6:42 pm
Location: Easter Island
Contact:

Post by xtraverse »

Thanks guys, it didn't know it would be this big of a hit ;)

Here's some fun patches I found:

Code: Select all

%patch $48E9 $0F $00 #robot's shots freeze keen instead of kill him

%patch $20D6 $02 $00 #with all three of these patches, ice launchers launch yorps
%patch $20F3 $4F $19
%patch $213E $68 $1A
xtraverse
Patch Crafter
Posts: 290
Joined: Tue Sep 02, 2003 6:42 pm
Location: Easter Island
Contact:

Post by xtraverse »

The routine that seems to prepare a sprite's creation is called from the following places:

Code: Select all

Call from 0x00001717 # robot
Call from 0x0000177B # butler bot
Call from 0x000017D9 # vorticon
Call from 0x00001847 # garg
Call from 0x00001884 # yorp
Call from 0x000018E7 # rope/falling block sprite
Call from 0x000020CF # ice cube from launcher
Call from 0x000021A9 # mini ice cube 1
Call from 0x000021E5 # mini ice cube 2
Call from 0x00002221 # mini ice cube 3
Call from 0x0000225D # mini ice cube 4
Call from 0x000046BE # keen shot
Call from 0x000048E2 # robot shot
It would be great if someone could make a list of the offsets of the members for the sprite struct of each struct. Next we can move on to Keens 2 and 3 ;)
CaptainKeen
Posts: 78
Joined: Sun Feb 29, 2004 5:30 pm
Location: the Netherlands

Post by CaptainKeen »

omg omg OMG!!!!!!! woa xtra keenrush!!! Yorptastic!!!!!!!

DREAMS DO COME TRUE

now what am I gonna do with my current sprites!!!!

this is truely revolutionary as keenrush said. now I,m glad I didnt release my mod yet.

Looking forward to more of these patches!!!!!!
User avatar
grelphy
Posts: 219
Joined: Fri Sep 05, 2003 12:41 am
Location: the Armageddon Machine

Post by grelphy »

Muhaha... the release date for Vox moved back about thirteen and a half years, teh time it'll take me to finish just playing with this and starting to mod again. ;)

This is totally, outrageously, awesome! Keep up the good work!
Post Reply