gerstrong/Commander-Genius — Issue #17: Read Sprite(AI) speeds from the exe-file
Author: gerstrong
Created: 2012-01-09 04:31:05+00:00
State: open
Labels: Brainstorming, Feature Request

The attached document shows, how speeds for mods can be modified. Teach CG to read those values and convert them.

---------------------

*****************************************
4.) Sprite speeds and jump heights:
*****************************************

This section deals with the speeds of sprites and how hight/fast they can jump.
Unlike previous sections, these are listed by sprite, as each sprite has its own
speeds that can bet set to any value you desire, wheras previous patches required
specific values that were used by individual sprites.

Some special notes on behaviour should be noted:

Some sprites do not move and thus cannot be patched to move [at least yet]

Some sprites can move diagonally and thus have two speed values for the diagonal
speed [Horizontal and vertical speeds] Note that if you want Keen's and the robot's
shots to move diagonally, give them the small icecubettes behaviour]

Some speeds are $FF $FF [Zero speed] MINUS the actual speed. Such speeds are called
'negative' and they make a sprite move left, [unlike 'positive' speeds which make a
sprite move right] This is slightly deceptive though, for a sprites speed does not
always dictate direction. For example, altering the Gargs speed to negative will
not make it always move left, but will make it move *away* from Keen! [The reverse
'negative' of its normal behaviour]

Most sprites have an 'initial' speed, a speed that the sprite uses when it is first
created, but never again. This is important to patch when you want to change the
direction a sprite starts moving in. For example, the Butler Bot starts off moving
$5A $00, or right when it is first created, changing this to a 'negative' value makes
it move left when first created, something that may be very useful in certain
situations, such as if Keen starts a level near the sprite and you want it to head
towards him. Also, since this is an additional speed, you can make a sprite rush
around madly [or crawl slowly] initially, and then move at a different speed later.
[For example you can make a sprite appear 'sleepy' at first, but faster when it '
wakes up'

The Vorticon has many poorly defined speeds that take part in a complex pseudo-random
set of 10 subroutines. This makes it very hard to make it do what you want, so when
in doubt, patch all the speeds.

The Yorp's and Vorticon's speeds may depend on wether they are left or right of Keen,
for example, the Yorp heads toward Keen, reversing its speeds will make it run away
from him.

Speed is byte $40 or $4C (Horizontal) or byte 42 (Vertical) thus you can change a speed
from h to v by patching the byte two before a speed.

***
*Tank Bot:
***

%patch $1747 90 #Initial speed -right
%patch $1F2B -90 #Tank bot 'normal' left speed
%patch $2019 90 #Tank bot 'normal' right speed
%patch $1EFD 0 #Speed when pausing *before* shooting [Standing still]

***
Butler Bot:
***

%patch $17A5 90 #Initial speed, left and right [Initially moves right]
%patch $1E4B 90 #Speed after hitting left wall
%patch $1E31 -90 #Speed after hitting right wall

***
*Vorticon:
***

#Vort initial speeds, towards Keen
%patch $1832 -90 #Minor, initial speed of Vorticons *left* of Keen (Towards him)
%patch $1839 90 #Minor, initial speed of Vorticons *right* of Keen (Towards him)
%patch $1CA4 90 #Minor; Secondary speed of Vorticons *right* of Keen
%patch $1C94 -90 #Minor; Speed 2
%patch $1D10 90 #Minor; Speed 3
%patch $1CB7 -90 #Major; Normal left speed of Vorticons *left* of Keen 1
%patch $1C9C 120 #Major; Normal right speed of Vorticons *left* of Keen 2
%patch $1D41 90 #Major; Speed of vorticons *right* of Keen
%patch $1C8C -120 #Major; Normal left speed
%patch $1D04 -90 #Minor; Jumping and bouncing off walls
%patch $1D1C 0 #Major; Speed when looking around. [Still]
%patch $1CC3 90 #Minor; When using jump animation on ground
%patch $1C49 $2C $01 #Jump height

***
*Gargs:
***

#No initial speed
%patch $1B58 0 ##Speed when Garg looking around [in this case, standing still]
%patch $1BA7 60 #Left AND right speed after looking around, changes when Garg hits a wall
%patch $1B9F 220 #Left AND right speed when charging toward Keen
%patch $1B1E 60 #Right speed after touching a left wall
%patch $1B12 -60 #Left speed after touching right wall

%patch $1B37 220 #Garg ONLY jumps if moving at this speed (Charging)
%patch $1B4C -220 #Height Garg jumps when chasing Keen over a cliff
%patch $1B39 $74 #Garg always jumps, whether it's running or not:

***
Yorp:
***

%patch $18CD 60 #Initial speed for Yorps *left* of Keen [Towards Keen]
%patch $18D4 -60 #Initial speed for Yorps *right* of Keen [Towards Keen]
%patch $1A1C -60 #Speed *towards* Keen of Yorps *right* of Keen after Yorp looks for Keen
%patch $1A14 60 #Speed *towards* Keen of Yorps *left* of Keen after Yorp looks for Keen
%patch $19CE 60 #Right speed of Yorp after Yorp hits left wall
%patch $19C2 -60 #Left speed of Yorps after Yorp hits right wall
%patch $19DA 0 #Speed used when Yorp looking around [Standing still]
%patch $1A5E 0 #Speed of stomped sprite [Standing still]
%patch $1964 128 #Sprite jump height

***
Icecubes:
***

#Up right icecube
%patch $2110 $38 $FF #Up speed
%patch $2115 $C8 $00 #Right speed

#Up icecube
%patch $211C $38 $FF #Up speed

#Down icecube
%patch $2128 $C8 $00 #Down speed

#Up left icecube
%patch $2134 $38 $FF #Up speed
%patch $2139 $38 $FF #Left speed

***
Icecubettes:
***

#down right icecubette
%patch $21D9 $2C $01 #Speed right
%patch $21DE $2C $01 #Speed down

#up right icecubette
%patch $2215 $2C $01 #Speed right
%patch $221A $D4 $FE #Speed up

#Down left icecubette
%patch $2251 $D4 $FE #Speed left
%patch $2256 $2C $01 #Speed down

#Up left icecubette
%patch $228D $D4 $FE #Speed left
%patch $2292 $D4 $FE #Speed up

***
Keens shot:
***

%patch $46EE $00 $00 #Speed down [i.e, none]
%patch $4704 $90 $01 #Speed right for Keen's right shot
%patch $4779 $70 $FE #Speed left for Keen's left shot

***
Keen:
***

%patch $3BAC $06 $00 #Keen's jump height [in *half* tiles]
%patch $3F40 $C8 $00 #Keen's pogo height
%patch $3F3C $FF $FF #Keen's high pogo height [-ve; Make this larger he pogoes lower, make it less, liek $FF $FE and he pogoes higher!]

%patch $410D $3C $00 #How fast Keen walks when exiting levels