Actions

Difference between revisions of "SPG:Animations"

From Sonic Retro

m (-_-)
(Made major edits to the information on this page, correcting errors and omissions. I will add accompanying images in the future to help illustrate what is written. Will also add more later on)
Line 1: Line 1:
Notes: To convert the frame duration into an animation/image speed for Game Maker or a similar program, divide 1 by the frame duration
+
Note: Research applies to all four of the Mega Drive/Genesis games, and Sonic CD. There are varying differences between the games, as each game uses different animations. This will be covered below.
(for example:  1/(8-absolute(X speed))  )
+
* Animation notes for Tails and Knuckles are not yet included. They will be included in due time.
  
If the relation between the X speed and the frame rate means it will wait less than one step before advancing a frame, it is just set to 1. So it is actually, for example '''maximum'''(8-absolute(X speed), 1)
+
Shown below are the speeds of the animations featured in the Sonic games. Such information can be used to replicate accurate animations in a fangame engine.
  
The following is based off of Sonic 1/2. Speeds in other games might be different. Though I think they are pretty much the same for all of them.
+
==Idle Animation==
  
==Sonic Animation Speeds==
+
===Sonic 1===
 +
Every sprite subimage in this animation lasts for '''24 frames'''. Sonic stays still for 288 frames (the subimage occurs 12 times in the animation code) before entering the waiting subimages of the idle animation. When the waiting portion begins, Sonic enters a subimage for 24 frames, then has his eyes wide open for 72 frames. Afterwards, he will alternate between two subimages every 24 frames, making Sonic appear to tap his foot on the ground. This will loop until the player takes action.
  
===Idle===
+
===Sonic 2===
 +
Every sprite subimage in this animation lasts for '''6 frames'''. Sonic stays still for 180 frames (the subimage occurs 30 times in the animation code) before entering the first set of waiting subimages of the idle animation. He then blinks, which lasts for 6 frames, then has his eyes wide open for 30 frames. Afterwards, he will alternate between two subimages every 18 frames, making Sonic appear to tap his foot on the ground. This will loop until the player takes action.
  
The game waits 288 steps before starting the wait animation, and when the waiting is playing, it waits 24 steps before advancing to the next frame.
+
Should the player NOT take action after Sonic taps his foot 4 times (144 frames), he will then look down at his wrist(watch?) for 60 frames, then resume tapping his foot. This foot-tapping/wristwatch sequence will continue 3 more times (204 frames/sequence*4=816 total frames). Afterwards, if no action is taken at this point, Sonic will enter a new animation where he lies down on the floor. It takes 6 frames for him to drop to the ground. He then enters a final alternating sequence tapping his finger against his shoe. Both subimages in this sequence last for 18 frames each.
  
===Walking and Running===
+
===Sonic 3K===
 +
Every sprite subimage in this animation lasts for '''6 frames'''.
  
When walking, the animation waits 8-absolute(X speed) steps before advancing a frame. This is the same in Sonic 1, 2 and 3. This remains even when at full speed (spinning feet).
+
==Walking and Running==
 +
When Sonic is walking or running, the animation waits '''8-absolute(Ground speed) frames''' before advancing to the next subimage. This is the same in Sonic 1, 2 and 3. This remains even when at full speed (spinning feet), or faster. Now, if the result of 8 minus the ground speed means it will wait less than one step before advancing a frame, it is just set to 1. So, to properly emulate this in your engine, here is some pseudo-code
  
===Jumping===
+
  {
 +
      ; the framerate is set to 8 minus the absolute value of ground speed.
 +
      frame_duration = max(8-abs(g_speed),1) ; frame rate minimum is capped at 1.
 +
  }
  
Jumping works slightly differently. The animation waits 5-absolute(X speed) steps before advancing a frame, but the speed does not seem to change after you press the button.  
+
==Jumping/Rolling==
In other words, the animation remains the speed it was when you left the ground until you land.  
+
The spinning animation for jumping/rolling works slightly differently. The animation waits '''5-absolute(ground speed) frames''' before advancing to the next subimage, instead of 8. When rolling along the ground, the speed of the animation will change with Sonic's ground speed. When rolling in the air or jumping, the animation speed will remain constant, due to the fact that ground speed does NOT update in the air. In other words, the animation remains the speed it was when you left the ground until you land.
  
So it is effectively 5-absolute(X speed at take off)
+
==Pushing==
 +
The animation waits '''32 frames''' before advancing to the next subimage when pushing. This remains true in all games.
  
===Rolling===
+
==Balancing==
 +
While balancing, the animation waits '''16 frames''' before advancing to the next subimage.
  
Rolling works the same as jumping, but the speed changes as normal. 5-absolute(X speed)
+
==Braking==
 
+
In Sonic 1, the animation waits 8 frames before advancing to the next subimage while braking. It will continue to loop between the two subimages until Sonic has stopped. In Sonic 2 and Sonic 3K, the animation will stop when it finishes, instead of looping.
===Pushing===
 
 
 
The animation waits 32 steps before advancing a frame when pushing.
 
 
 
===Balancing===
 
 
 
While balancing, the animation waits 16 steps before advancing a frame.
 
 
 
===Braking===
 
 
 
In Sonic 1, the animation waits 8 steps before advancing a frame while braking.
 
  
 
[[Category:Sonic Physics Guide|Animations]]
 
[[Category:Sonic Physics Guide|Animations]]

Revision as of 07:20, 16 February 2013

Note: Research applies to all four of the Mega Drive/Genesis games, and Sonic CD. There are varying differences between the games, as each game uses different animations. This will be covered below.

  • Animation notes for Tails and Knuckles are not yet included. They will be included in due time.

Shown below are the speeds of the animations featured in the Sonic games. Such information can be used to replicate accurate animations in a fangame engine.

Idle Animation

Sonic 1

Every sprite subimage in this animation lasts for 24 frames. Sonic stays still for 288 frames (the subimage occurs 12 times in the animation code) before entering the waiting subimages of the idle animation. When the waiting portion begins, Sonic enters a subimage for 24 frames, then has his eyes wide open for 72 frames. Afterwards, he will alternate between two subimages every 24 frames, making Sonic appear to tap his foot on the ground. This will loop until the player takes action.

Sonic 2

Every sprite subimage in this animation lasts for 6 frames. Sonic stays still for 180 frames (the subimage occurs 30 times in the animation code) before entering the first set of waiting subimages of the idle animation. He then blinks, which lasts for 6 frames, then has his eyes wide open for 30 frames. Afterwards, he will alternate between two subimages every 18 frames, making Sonic appear to tap his foot on the ground. This will loop until the player takes action.

Should the player NOT take action after Sonic taps his foot 4 times (144 frames), he will then look down at his wrist(watch?) for 60 frames, then resume tapping his foot. This foot-tapping/wristwatch sequence will continue 3 more times (204 frames/sequence*4=816 total frames). Afterwards, if no action is taken at this point, Sonic will enter a new animation where he lies down on the floor. It takes 6 frames for him to drop to the ground. He then enters a final alternating sequence tapping his finger against his shoe. Both subimages in this sequence last for 18 frames each.

Sonic 3K

Every sprite subimage in this animation lasts for 6 frames.

Walking and Running

When Sonic is walking or running, the animation waits 8-absolute(Ground speed) frames before advancing to the next subimage. This is the same in Sonic 1, 2 and 3. This remains even when at full speed (spinning feet), or faster. Now, if the result of 8 minus the ground speed means it will wait less than one step before advancing a frame, it is just set to 1. So, to properly emulate this in your engine, here is some pseudo-code

 {
      ; the framerate is set to 8 minus the absolute value of ground speed.
      frame_duration = max(8-abs(g_speed),1) ; frame rate minimum is capped at 1.
 }

Jumping/Rolling

The spinning animation for jumping/rolling works slightly differently. The animation waits 5-absolute(ground speed) frames before advancing to the next subimage, instead of 8. When rolling along the ground, the speed of the animation will change with Sonic's ground speed. When rolling in the air or jumping, the animation speed will remain constant, due to the fact that ground speed does NOT update in the air. In other words, the animation remains the speed it was when you left the ground until you land.

Pushing

The animation waits 32 frames before advancing to the next subimage when pushing. This remains true in all games.

Balancing

While balancing, the animation waits 16 frames before advancing to the next subimage.

Braking

In Sonic 1, the animation waits 8 frames before advancing to the next subimage while braking. It will continue to loop between the two subimages until Sonic has stopped. In Sonic 2 and Sonic 3K, the animation will stop when it finishes, instead of looping.