Sonic the Hedgehog/Game Mechanics and Glitches

From SDA Knowledge Base

Jump to: navigation, search

Game Mechanics

Speed cap

In Sonic 1, the game imposes a horizontal speed cap of 6 p/f whenever all of the following is true:

  • Sonic isn't rolling or jumping from a roll
  • Sonic is travelling above the normal maximum running speed on flat ground
  • The player holds the button corresponding to the direction of travel

Sonic 2 partially fixed Sonic 1's very restrictive speed cap, but it still activates in limited situations. Specifically, the following conditions have to be met:

  • Sonic is not on the ground
  • Sonic has air control (see: rolljumping)
  • Sonic is travelling above the normal maximum running speed on flat ground
  • The player holds the button corresponding to the direction of travel

If all these conditions are met, Sonic's vertical speed reverts to the normal maximum running speed 6 p/f. Surprisingly, this is actually beneficial in some levels, see Chemical Plant 1 and 2, and Metropolis 1.

In Sonic 2, Sonic 3 and Sonic & Knuckles, the speed cap can be overcome by other means of acceleration such as boosters, slope jumps and running down hills. The games will handle this higher speed as the new speed cap until you slow down below the normal cap.

Given the right conditions, running would allow you to accelerate indefinitely. Rolling however has a set speed cap of 16 p/f no matter the situation in all games.

Air physics

Horizontal acceleration is higher while in the air, which is why jumping at the beginning of a stage is common in Sonic 1. Whenever a character jumps, the vertical and horizontal speeds are added as vectors, with the addition of the power of your jump (6.5 p/f as Sonic and 6 p/f as Knuckles) and the angle of the slope you're currently on. Jumping on the very frame you land makes this calculation treat all slopes as having the angle 0 degrees (the angle of air).

Whenever a character has an upwards speed between 0 and 4 p/f, an "air drag" effect takes affect if the vertical velocity is above the normal maximum running speed. In all other situations (e.g. falling down or travelling up faster than 4 p/f) the air behaves like a vacuum and except for acceleration normal ground physics apply.

If a character is currently jumping and travelling upwards faster that 4 p/f, it can be instantly set to 4 p/f by releasing the jump button.


Spindashing

Spindashing has 8 possible speeds, between 8 pixels per frame (p/f) and 12 p/f in half integers. Every time a button is pressed you add 2 to the base value 8, which then subsequently decreases faster the higher the total value is. Because of this, the minimum requirement to get a 12 speed is 6 button presses, commonly referred to as a "6-tap".

Since you always decelerate while rolling unless going down a slope, getting back to running by jumping into ceilings, down slopes or inside loops are things you generally want to do after spindashing.

There's no guaranteed way to get a certain spindash speed, so usually runners do 3-taps or other increments in order to get close to the desired speed.

Air Abilities (S3 and S&K only)

In common for all air abilities is that they can only be executed while having an upwards velocity of less than 4 p/f. This is why you have to release the jump button and press it again in order to fly or instashield at the beginning of a jump, but can hold the button and press a new one at the apex of a jump.

Universal timer

There's two different timing properties of moving objects in this game. The universal timer is where an object starts moving the instant you start the level, and will therefore be in a certain position at a certain time, every time.

Camera timer

The other kind is this one, which only starts moving once it's brought onto the screen (or near the screen - when the object is first rendered, in any case). Knowing which objects have which timing properties is important to good times when you have to deal with them.

Path switcher

This is an invisible item in the game that allows the levels to work as structured. There are three different levels of background/foreground and Sonic is always in one of them at any one time, and these items seamlessly switch Sonic from background to foreground and vice versa. This is especially necessary for things like loops to work, because if you didn't have them they would just be solid all the time and you wouldn't be able to enter it. Knowing where these are and how they work is key to some tricks in this game.

Mechanics specific to Sonic

Height

Sonic is a bit taller than Tails which means some zips, clips and tricks work differently or not at all. An example of a zip that Sonic can do but not Tails is the one right before the Lava Reef 2 boss skip and an example of a zip Sonic can't do is the Death Egg 2 level wrap. Whenever Sonic is doing a rolljump, he sinks 5 pixels into the ground on the first frame as opposed to Tails who only sinks 1 pixel. This is the main reason Sonic can clip into the ground at the spring in Marble Garden 1 but not Tails.

Insta-shield

In Sonic 3 there's a timer for instashielding that prevents you from doing it more often than about every second or so. This was removed in S&K.

Having used an air ability sets a value in the ram even if you would switch ability mid jump, as is the case with Sonics shields. For example, if you were to instashield into a bubble monitor, the game would prevent you from bouncing until you land, but still make the small bounce you always get when landing after bouncing on an object.

The fire shield instantly sets your horizontal velocity to 8 p/f and vertical velocity to 0. Therefore it's faster to spam it on flat ground as much as possible, but not while having a higher speed.

The electrical shield sets your vertical speed to 5.5 p/f upwards. It also protects against some damaging electrical hazards such as the capacitors in Death Egg, but not the sparks flying off of them.

The bubble shield sets your vertical velocity to 8 downwards and then 7.5 p/f upwards, which means for example that bouncing from a destroyable object will give you more height regardless of starting point, but bouncing from a higher point without an object won't.

Mechanics specific to Knuckles

Landing from a glide

When Knuckles lands from a glide, while it looks like he goes into a crouching animation he actually goes into a separate one, meaning you cannot spindash for 15 frames (1/4 of a second) after landing.

Superglide

Simply jump on an object (an enemy or an item box) and glide just before you hit it. This causes you to translate your falling speed upwards, and since you're gliding you have a much lower rate of acceleration towards the ground. In layman's terms, you end up a lot higher than a standard jump.

Advanced Techniques

Ramp jump

Sonic's jump speed and height are dependent on both your speed going into the jump and the slope of the ground you jump off. Running up a slope causes your jump to become much higher, while running down a slope will make you jump quite flat to the ground, gaining speed. This applies even if the slope is very small.

Loop jump

Similar concept, but inside a loop. If you're moving through the loop from left to right, a loop jump is from the top-left to the bottom-left. It's kinda finicky because if you land at different angles you get different speeds, but in the best case it is faster, and it's also a very convenient way to switch from rolling to running.

Zip

A zip occurs when Sonic is stuck in a wall somehow and presses left or right. Since collision detection is designed to stop you from going into a wall in the first place, pushing left against a wall makes the game push you back to the right so you aren't embedded in it. As a result, when you're already inside a wall holding left or right causes you to travel in the opposite direction much faster than you can attain by normal play.

Level wrap

This is what happens when a zip causes you to bypass the left edge of the screen. The game treats your X-coordinate in memory as a number less than 0 - but position coordinates are unsigned, so instead of a negative number it's a VERY large positive one - which correlates to the end of the stage. This requires some very specific circumstances depending on the level, but it can be used to skip to the end of Oil Ocean 2 and Metropolis 2, as well as Metropolis 3 if playing as Sonic and Tails, or Casino Night 2 if playing as Knuckles.

Screen wrap

Similar concept to the level wrap, but using vertical coordinates instead. In levels that wrap around infinitely vertically (in Sonic 2, only the three acts of Metropolis act in this way), instead of using absolute values for vertical position, it uses values linked to the camera position. The top of the camera is position 0, and anything above it is negative, which since position values are unsigned, is a large positive number, which causes the screen to scroll downwards to that position. In the time it takes to scroll down, any sprite objects cease to exist until they are brought back onto the screen, and your character can move into them.

Physics information

Personal tools