Patch:Garg
Gargs are dangerous, green enemies found in Keen 1. This page lists patches relating to Garg sprites. It is divided into sections relating to the various sprite properties the patches involve. Being fluent with various sprite patch pages will help when working with these patches.
Contents |
Sprite Type
Gargs use sprite type 3 which means they kill Keen on contact.
| Patch: Keen 1 |
|
Sprite Behavior
There are three behaviors associated with the Garg, the walking behavior (Walk back and forth, also charge and jump.) and the searching behavior (Look for Keen, if he's on the Garg's level, charge in Keen's direction.) the third behavior is the Garg collision. Gargs are spawned looking for Keen. The difference between walking and charging is simply speed, which is set during searching.
Behaviors: $1B51W #Garg look for Keen, charge $1AA8W #Garg walk $1BCEW #Garg collision
| Patch: When spawned |
%patch $1871 $1B51W |
| Patch: In level |
%patch $1AD0 $1B51W |
Speed and Jump Height
The default speed of Gargs is +-60 when walking and +-220 when charging. When spawned Gargs will stand still (looking for Keen) by default. They will charge towards Keen after searching for him and finding him otherwise they will walk in a random direction.
There is only one speed for walking\charging that can be in two directions. Gargs will jump at a platform edge ONLY if moving at a certain speed, by default this is the charging speed, so this should be changed to match the charging speed if it is altered. It is possible also to alter the jump condition so that Gargs always jump or jump when walking only. The jump height is the negative of the charging speed, but this is coincidence.
| Patch: In level |
%patch $1B58 $0000W |
Sprite Collision
Gargs interact with both Keen's and Tank's shots. This produces a shot Garg. (See behavior section.) The shot Garg also resets its collision and behavior, the new collision, used for most dead sprites ignores all other sprites, the new behavior likewise is just 'fall and animate'
Basic collision patch
| Patch: Keen 1 |
|
Complete collision code
This is the complete collision patch. Contained in it is all of the Garg's collision code. The first two blue values are the sprite types the Garg responds to, each followed by a jump condition in brown. The next blue value stops the sprite animating, the fourth is the number of frames to use in the stunned animation and the fifth is the sprite animation to use. The sixth and seventh are the shot Garg's behavior and sprite collision. The eighth is the shot Garg's jump height and the ninth and last is the sound played when the Yorp is shot. The last brown value calls the sound playing code. (See sounds section below.)
To customize the collision it may pay to see Patch:Vorticons Sprite Parameters and maybe Patch:Shot sprites.
| Patch: Keen 1 |
|
Indestructible shockable Garg
This patch makes the Garg death more complex. The Garg is indestructible, but it still shows the shot animation every time it is shot (It is shot without dying so to speak.) The second line resets the collision behavior (See first section.) If the second line is changed to another collision aside from the Garg one, the second time the Garg is shot it will use that collision. (For example, changing it to the Yorp collision means the Garg will have two health, the first showing a shocked Garg, the second spawning a dead Yorp.)
Most of the other patches in the basic section can be used with this to change the sound made, etc.
| Patch: Keen 1 |
|
Animations
| Patch: When spawned |
%patch $187B $003CW |
| Patch: In level |
%patch $1B65 $003CW |
Sounds
These are the sounds the sprite uses.
| Patch: Keen 1 |
%patch $1C02 $23 |
Searching and charging
These patches relate to the Gargs searching and charging behavior, whether they search and what they do after searching.
Still charge when Keen\Garg height changes
The Garg\Keen height check is how the Gargs determine if Keen is level with them and thus able to be charged at. If either the Garg or Keen's height changes, they will be unable to charge normally. These patches is used to address the imbalance. There are two patches, only ONE is needed. Here $xx is the difference in height between Keen's sprite and the Garg's sprite in pixels.
| Patch: Make sure that the Garg still charges when Keen/Garg height changes |
|
Don't charge
| Patch: Keen 1 |
|
Charge in random direction
This patch calls the game randomizer at $C0CE instead of using Keen's location to determine direction.
| Patch: Keen 1 |
|
Always charge after searching
With this patch Gargs will always charge towards Keen after looking for him, whether Keen is level with them or not. This makes them much more vicious.
| Patch: Keen 1 |
|
Stand still until Keen is seen
With these two patches, the Gargs will not move at all until Keen is level with them, after which they will charge, either towards or away from him depending on patch. This is useful for making a 'sleeping' enemy that wakes when Keen is near. The two patches are obviously not compatible.
| Patch: Keen 1 |
|
| Patch: Keen 1 |
|
Always search
With this patch Gargs spend all their time searching and thus will tend to attack Keen as soon as they see him.
| Patch: Keen 1 |
|
Searching Gargs slide
With this patch the Garg's speed is not set to 0 when searching, this means they slip and slide when searching This is useful since patching the searching speed only one direction is possible by default.
| Patch: Keen 1 |
|
Instant search
This patch makes the Garg search instant, so that Gargs often seem to chase Keen spontaneously. It helps also to patch the searching sprite into a walking one, since the very brief search time left can still look like a flicker.
| Patch: Keen 1 |
|
Misc
These patches don't fit into the above sections easily.
Shot Garg stuns like a Yorp
This patch makes it so that shot Gargs recover after being stunned; like the Yorps when they are stomped, after a time they will recover, search for Keen and act as if nothing had happened. While stunned using this patch they animate their shot sprites. Stunned Gargs are still deadly.
The first part of this patch changes what the Garg becomes when it is shot, using its new stunned behavior.
The section part is optional, if included then stunned Gargs can be shot again, 'restunning' and restting their 'stun timer'. If it is removed Gargs will not respond to further shots; though they will still block Keen's shots.
The third part of the patch is more complex. The first line contains three variables, the first is the animation speed, the second the number of animation frames minus 1 (That is, 2 by default.) and the third is the start animation frame for the stunned Garg. (Here the first shot frame.) The second line has a blue variable that is the Garg's stunned time, when this much time has passed, the Garg will return to normal. The two brown variables on the third line are the recovered Garg's collision and behavior, making the Garg shootable when it recovers and also changing it's behavior to look for Keen (instead of staying stunned.) The two brown $E8 $xxxxWs on the fourth line are gravity and tile check, replacing the first with $90 $90 $90 makes the stunned Garg not fall and hit the ground, replacing the second makes it ghost through tiles.
The third part of the patch makes sure that neither Yorps nor Gargs pause when offscreen when stunned. Each line in it checks for the stunned behavior, and if it is found, changes the sprite to either searching Yorp or searching Garg. (Gargs also have their collision reset so they can be shot again.)
This patch may be incompatible with patches that use the $0AA2 offset, though it is designed to work with the Keen ammo limit patch. (With unique sound and without.) Check your patchfile if conflicts occur.
| Patch: Keen 1 |
|