From Sonic Retro
|Sonic Physics Guide
- The research applies to all four of the Sega Mega Drive games and Sonic CD.
- For moves like spindash, dropdash, peelout, flying, and gliding, these are detailed in Special Abilities.
Characters in game are are objects like any other (the guide will refer to an in game character object as "the Player", or "Player objects"), and use a lot of the same variables.
However, each character in the classic Sonic games is constructed differently. While similar, they can differ in size, physics constants, and move set.
The sizes of characters are important, they determine how the characters will collide with Solid Tiles (the positions of their Sensors), Solid Objects and more. These sizes are not the exact same as their hitboxes, hitboxes are separate to the solid size of objects.
Note: For all characters, their Push Radius is always 10.
When standing, Sonic's Width Radius is 9 and his Height Radius is 19, resulting in 19 pixels wide and 39 pixels tall. When Jumping or rolling, his Width Radius is 7 and his Height Radius is 14, resulting in 15 pixels wide and 29 pixels tall.
Sonic's hitbox has a width radius of 8, and it's height radius is always 3 pixels shorter than the Player's Height Radius. When crouching, Sonic's hitbox needs to shrink. Problem is, Sonic's Y Position and Height Radius don't actually change at all while crouching. So to tackle this the game manually updates the hitbox's size and position while Sonic crouches, where 12 pixels is added to the hitbox's Y position, and the hitbox's height radius is set to 10. In Sonic 2, this only applies to Sonic. In Sonic 3 onwards, crouching does not affect the hitbox at all for any character.
Sonic's jump_force is 6.5 (6 pixels and 128 subpixels).
Tails is much smaller than the other characters.
When standing, his Width Radius is 9 and his Height Radius is 15, resulting in 19 pixels wide and 31 pixels tall. The only time this changes is when he jumps or rolls, where his Width Radius is 7 and his Height Radius is 14, much like Sonic, resulting in 15 pixels wide and 29 pixels tall. His size is the same as standing when he flies. His hitbox works the same as Sonic's, but does not change when crouching.
Tails' jump_force is 6.5.
Knuckles sizes are the same as Sonic's, except for when he is gliding, climbing and sliding. His hitbox works the same as Sonic's, but does not change when crouching.
Here, his Width Radius is 10 and his Height Radius is also 10, resulting in 21 pixels wide and 21 pixels tall. This makes him wider and shorter compared to normal (resulting in a square shape), which makes sense for his gliding pose. When falling from a glide, he uses his standing sizes. During these moves, his hitbox continues to change height based on his Height Radius.
Knuckles' jump_force is only 6, which results in a lower jump than the others.