From the translator: parts of the review are small, so I decided to translate two parts at once.Links to other parts of the series:Part 1: hard tilesPart 2: RunningParts 5 and 6: the loss of rings and being under waterParts 7 and 8: springs and gizmos, super speedsPart 3: Jumping
Acceleration in the air')
When Sonic is in the air, he can accelerate faster than on the ground. Two times faster, to be exact: 0.09375. Let's call this value
air .
There is no friction in the air (but there is a complex resistance effect, which will be discussed below), and almost always, when Sonic has a certain horizontal speed in the air, he will keep it until the player changes it or Sonic hits the wall.
In addition, there are also no differences for slowing down, when pressing the "left" button,
air will always be subtracted from the horizontal speed, and when you press the "right" button,
air will be added to it.
Sonic's maximum speed in the air is the same as on the ground, and is equal to 6.
GravityGravity has a value of 0.21875 (
grv ). This value is added to the vertical speed in each step in which the Sonic is not on the ground. She makes him fall down while sliding off a cliff and does not allow him to move upwards endlessly while jumping.
Maximum vertical speedIt seems that in the game
Sonic 1 Sonic's vertical speed is not limited in any way. When falling,
grv continues to increase to vertical speed, infinitely increasing it.
A restriction is introduced in the
Sonic CD , in it Sonic cannot fall faster than 16 pixels per step. This restriction is important so that Sonic never overtook the camera and did not fly through the ground, because he could move so fast that he did not even collide with it. I think this restriction was imposed because of the increased height of the levels, for example in the Collision Chaos, and the endless vertical mine in Tidal Tempest. Without this limitation, Sonic could accelerate to enormous speeds in some areas, which could lead to disruption of the game process.
{ Y speed = Y speed + grv if Y speed > 16 then Y speed = 16 }
WindageAt each step in which the Sonic is in the air, a special formula is applied to the horizontal speed of Sonic, but only if certain conditions are present. First, the vertical speed must be negative. Secondly, the vertical speed must be greater than -4 (for example, -3 or -3.5 greater than -4). Thirdly, the absolute value of the horizontal velocity must be greater than 0.125. If these conditions are met, the horizontal speed is multiplied by a factor of 0.96875.
{ if Y speed < 0 and Y speed is > -4 { if absolute(X speed) >= 0.125 then X speed = X speed * 0.96875 } }
Actually, this is only an approximate calculation, and here's why: since the original games use 2 bytes to store the Sonic's speed value, where the first is the pixels and the second is subpixels, the speed of 6.5 pixels per step will be expressed in hexadecimal value $ 0680. In decimal form, this is 1664. Of course, Sonic does not move at a speed of more than a thousand pixels per step! 1 pixel = $ 100 (256), half pixel = $ 80 (128). Therefore, in the original game, the air resistance should be calculated as follows:
{ if Y speed < 0 and Y speed is > -$0400 { X speed = X speed - ( X speed div $0020 ) ; "div" - } }
If we carried out these calculations for relatively low horizontal speeds, which will always be less than $ 20 (32), this would have hardly affected the horizontal velocity. Why? Because if the integer division of any number is less than 32 by 32, the result would be 0. Therefore, in the original game, before calculating the air resistance, it is not necessary to check whether the horizontal speed is greater than a certain value - if the horizontal speed is equal to or less than $ 001F, then in any case nothing will happen.
Therefore, more accurately emulate air resistance as follows:
{ if Y speed < 0 and Y speed is > -4 { X speed = X speed - ( ( X speed div 0.125 ) / 256 ) } }
In any case, the difference between the two methods is rather insignificant, just the second is technically more accurate.
Air resistance is calculated at each step before
grv is added to the vertical velocity.
Jump speedNow we are used to this, but at the time of the release of the game
Sonic the Hedgehog, there were a lot of games that used a fixed jump height. No matter how quickly the player released the jump button - the character still went up by the same number of pixels. Games such as
Mario and
Sonic were among the first to have more flexible and responsive controls, providing improved sensations from controlling a character, and therefore much more interesting and gentle gameplay.
How is the variable height of the jump?
When you press the up button, when Sonic is on the ground, the vertical speed becomes -6.5 (
jmp ). In a game without a changeable jump height, no subsequent calculations would be performed after this, except for the addition of gravity, and the character’s speed would gradually decrease under its influence. The result would be a leap of exactly 1 second to a height of 100 pixels. This type of jump is obtained if the player presses the jump button and holds it until Sonic reaches the top of his trajectory. But the trick to creating a variable jump height is to release the button.
When a player releases the jump button in the air after the jump, the computer checks if the Sonic is moving up (i.e., the vertical speed is negative). If so, then it checks if the vertical speed is less than -4 (for example, -5 is less than -4). If so, then the vertical speed is set to -4. Thus, you can complete the jump at any time by releasing the jump button. If the player releases the button in the next step after the jump, Sonic makes the shortest jump.
In the step where the computer detects the click of a jump button, Sonic does not actually move up. Therefore, in the next step, he can recognize the release of the jump button and Sonic will begin to move up at a speed of -4, without moving up at a speed of
jmp .
The check for releasing the jump button is performed before moving Sonic to a new position and adding
grv to the vertical speed.
Unfortunately, the computer checks that the jump button is pressed before Sonic moves. If the player presses the jump button, he exits the rest of the cycle, so the Sonic does not move during the step where the player jumps, neither in a vertical nor in a horizontal position. This is wrong, because the horizontal speed is not lost, and it must continue to move. This disadvantage can be eliminated in the new engine.
Tales jumps in the same way as Sonic, and Nackles jumps a little lower, because it has a slightly smaller
jmp value, -6.

Part 4: rotation
FrictionWhen Sonic starts spinning when you press

on the cross, but can no longer accelerate. As if the player did not press the button for a long time and strongly in the direction of movement, he would behave as if the player is not pressing anything. The only thing that is involved in this case is friction, here it has a value of 0.0234375 (half of normal), so it seems that Sonic is rolling smoothly, like a wheel or a ball. In fact, Mega Drive calculates the friction during rotation, halving the value of normal friction. If you use the Game Genie to change the value of friction, then the friction of rotation will always be two times less.
SlowdownHowever, Sonic may still slow down during rotation. When the button is pressed in the direction opposite to its movement, the horizontal speed will decrease by 0.125. In addition, unlike walking behavior, friction during rotation continues to operate, even if the player presses a button in the direction of movement. Therefore, in reality, when slowing down, the horizontal speed decreases at each step by 0.125 + 0.0234375, or by 0.1484375.
It is strange that the same anomaly of deceleration, as when running, occurs during rotation. If the absolute value of the horizontal velocity is less than 0.1484375, then this value is subtracted, instead of equating the horizontal velocity to zero, and becomes equal to 0.5 in the opposite direction. Therefore, in a surprising way, Sonic can turn as he spins, even if he cannot accelerate! This bug is fixed in
Sonic 3 and Knuckles , probably the programmers themselves found this behavior undesirable.
Max speed(Note: this is currently tested for Sonic 1 and 2. It is not yet known whether this is true for a Sonic 3K or Sonic CD.)Despite the fact that Sonic can not roll faster by itself, this does not mean that any hill will not be able to give it a little extra impetus. Hills and slopes can be used to rotate at very high speeds. As in the case of running, when rotating Sonic has a maximum speed limit, although it is much higher and reaches 16 pixels per step. However, unlike running, Sonic in no way can overcome this speed limit. If its
gsp reaches a value of 16 and tries to increase further, it will automatically be set to 16.
ConditionsIn
Sonic 1 and
2 games,
Sonic cannot start spinning if his absolute horizontal speed is greater than 0.53125.
In
Sonic 3 and Knuckles, this value is increased to 1.03125. This is very convenient because you can hold the "down" button to rotate. If Sonic had to stop before he was crouched, the player would have difficulty in quickly turning on the rotation.
In
Sonic 3 and Knuckles, Sonic stops spinning if his absolute horizontal speed falls below 0.5. Perhaps this way they wanted to eliminate the anomaly associated with turning in the other direction during rotation in previous games.
Jump in rotationIn
Sonic 1, 2, 3 and
Knuckles, the player cannot control the Sonic's trajectory in the air using the direction buttons when jumping in rotation. Therefore, it is difficult to start the rotation to gain speed, and then make an accurate jump. In
Sonic 3 and
Sonic & Knuckles, the player can regain control of the directional buttons by executing W Kaiten Attack.
W Kaiten AttackHe is
Insta-Shield , he is also
W Spin Attack (W 回 転 ア タ ッ ク) (in Japan), he is also
Twin-Spin Attack in
Sonic Generations - this is a special movement first used by Sonic in
Sonic the Hedgehog 3 . Jumping and then pressing the jump button in the air again creates a short flash that increases Sonic's attack radius and makes it temporarily invulnerable. This technique is useful for attacking bosses who are slightly outside the range of attack, and covered with spikes of enemies, such as Orbinaut. None of the characters, except Sonic, can use this technique.
Orbinaut However, in a
Sonic CD, a player can control a jump made in rotation, as if it were an ordinary jump. It seems that this is more honest with the player.