Patch:Gravity
Gravity is what pulls objects down in the game. In Keen Vorticons this is a constant acceleration to a maximum downwards speed. How gravity works in Keen galaxy and Dreams is unknown, but it likely to be similar.
In Keen Vorticons gravity is a single subroutine that must called by something in order for that object to experience gravity. It is thus possible to make something ignore gravity with a simple patch as well as make custom gravity codes and make various objects use it.
Change strength of gravity
There are three variables to alter to change the game's gravity; the acceleration, which controls how fast objects reach maximum downwards speed, and two values that set the maximum speed.(the first checks to see if anything is falling faster than a certain speed and the second is what the speed is set to if so. They should be equal.) Changing the acceleration will change the jump height of everything in-game, while changing the maximum fall speed will change the 'pace' of the game (Increasing it will make things fall faster, making the game seem faster.)
In Keen Galaxy and Dreams there is also an 'apex check' that deals with sprites reaching the very peak of their jumps. (In essence syncing them up.) It should be the negative of the gravitational acceleration. There is also no less than three types of gravity, the first strong, the second slightly weaker and the third weakest of all. Each gravity is used by different things. (For example Keen uses gravity 1 while Mad Mushroom use gravity 2.
Keen 1
#Change the game's gravity:
%patch $2C37 [$03] #Acceleration (How fast jumps/falls change)
%patch $2C3C [$00C8W] #Max fall speed 1
%patch $2C44 [$00C8W] #Max fall speed 2
Keen 2
#Change the game's gravity:
%patch $5A79 [$03] #Acceleration (How fast jumps/falls change)
%patch $5A7E [$00C8W] #Max fall speed 1
%patch $5A86 [$00C8W] #Max fall speed 2
Keen 3
#Change the game's gravity:
%patch $62C1 [$03] #Acceleration (How fast jumps/falls change)
%patch $62C6 [$00C8W] #Max fall speed 1
%patch $62CE [$00C8W] #Max fall speed 2
Keen 4
#Change the game's gravity 1:
%patch $B0A1 [$04] #Acceleration (How fast jumps/falls change)
%patch $B0A5 [$46] #Max fall speed 1
%patch $B0AB [$0046W] #Max fall speed 2
%patch $B08A [$FC] #Jump apex check
#Change the game's gravity 2:
%patch $B120 [$03] #Acceleration (How fast jumps/falls change)
%patch $B124 [$46] #Max fall speed 1
%patch $B12A [$0046W] #Max fall speed 2
%patch $B109 [$FD] #Jump apex check
#Change the game's gravity 3:
%patch $B18E [$46] #Max fall speed 1
%patch $B194 [$0046W] #Max fall speed 2
Keen 5
#Change the game's gravity 1:
%patch $A3C9 [$04] #Acceleration (How fast jumps/falls change)
%patch $A3CD [$46] #Max fall speed 1
%patch $A3D3 [$0046W] #Max fall speed 2
%patch $A3B2 [$FC] #Jump apex check
#Change the game's gravity 2:
%patch $A448 [$03] #Acceleration (How fast jumps/falls change)
%patch $A44C [$46] #Max fall speed 1
%patch $A452 [$0046W] #Max fall speed 2
%patch $A431 [$FD] #Jump apex check
#Change the game's gravity 3:
%patch $A4B6 [$46] #Max fall speed 1
%patch $A4BC [$0046W] #Max fall speed 2
Keen 6
#Change the game's gravity 1:
%patch $A2AE [$04] #Acceleration (How fast jumps/falls change)
%patch $A2B2 [$46] #Max fall speed 1
%patch $A2B8 [$0046W] #Max fall speed 2
%patch $A297 [$FC] #Jump apex check
#Change the game's gravity 2:
%patch $A32D [$03] #Acceleration (How fast jumps/falls change)
%patch $A331 [$46] #Max fall speed 1
%patch $A337 [$0046W] #Max fall speed 2
%patch $A316 [$FD] #Jump apex check
#Change the game's gravity 3:
%patch $A39B [$46] #Max fall speed 1
%patch $A3A1 [$0046W] #Max fall speed 2
Keen Dreams
#Change the game's gravity:
%patch $7C99 [$03] #Acceleration (How fast jumps/falls change)
%patch $7C9D [$50] #Max fall speed 1
%patch $7CA3 [$0050W] #Max fall speed 2
%patch $7C86 [$FD] #Jump apex check
Disable gravity
These patches completely disable gravity for the entire game. While it is possible to disable gravity for certain sprites specifically these patches will affect everything. Unless this is treated carefully the game quickly becomes unplayable.
Keen 1
#Disable gravity:
%patch $2C2A $C3
Keen 2
#Disable gravity:
%patch $5A6C $C3
Keen 3
#Disable gravity:
%patch $62B4 $C3
Sideways gravity
This patch creates a 'breeze' in levels; a sort of sideways gravity that pulls everything sideways all the time. Note that this patch will be incompatible with any other patches that use the $55EF line to free up space, such as the 'shoot up\down patch', so check your patchfile before adding this patch.
The value marked in blue is the 'breeze', set here to very low rightwards. Negative values will pull things left. This patch can also be part of an 'automatic level scrolling' patch.
Keen 1
#Levels have a breeze (Pull ALL sprites and Keen in one direction steadily)
%patch $55EF $EB $4A
%patch $4D1E $E9 $08D0W
%patch $55F1 $B8 $0000W $A3 $823EW $B8 [$0040W] $A3 $823CW $33 $C0 $E9 $F724W
No maximum fall speed
These patches stop things from reaching a maximum speed; normally things can only fall so fast, with these patches things can fall at increasingly rapidly.
No maximum fall speed
#No maximum fall speed -Keen 1
%patch $2C38 $EB $0E
#No maximum fall speed -Keen 2
%patch $5A7A $EB $0E
#No maximum fall speed -Keen 3
%patch $62C2 $EB $0E
#No maximum fall speed for Keen 4
%patch $B0A2 $EB $09 #Gravity 1
%patch $B121 $EB $09 #Gravity 2
%patch $B18B $EB $09 #Gravity 3
#No maximum fall speed for Keen 5
%patch $A3CA $EB $09 #Gravity 1
%patch $A449 $EB $09 #Gravity 2
%patch $A4B3 $EB $09 #Gravity 3
#No maximum fall speed for Keen 6
%patch $A2AF $EB $09 #Gravity 1
%patch $A32E $EB $09 #Gravity 2
%patch $A398 $EB $09 #Gravity 3
#No maximum fall speed -Keen Dreams
%patch $7C9A $EB $09