INTRODUCTION
This tutorial is aimed at fixing frame length / fps problems, where the custom animation made in 3ds max - or any other animation software for that matter - plays at a faster, or slower speed in game, than it appears in 3ds max itself.
The idea is to get the duration of both the animation slot in CS:S and 3ds max to be the same.The calculations require some rather simplistic math - or at least, to my Asian brains. (Don't worry. I got an 70% in grade 12 math, compared to my black friend who got 82%)
If you just want the formula, skip to "Get to the Point?" section. If you want the idea behind it, please read through everything.
Explanation
Basic Concepts
The duration of the animation, or the time it takes for the animation to play, depends on the animation's frame length, and frames per second (fps).
- Frame length: The number of frames within the animation (Unit: frames)
- Frames per Second (fps) = The number of frames played per second (Unit: frames/second)
If you were to divide the frame length by the fps:
frames / (frames / second)
= frames * (second / frames)
= (frames * second) / frames
= second
Notice how we just proved that frame length/fps = seconds, which is the duration of the animation
The Formula
In order for the duration of the animation to be the same within 3ds max and source engine, the time (second) that the animation takes must be identical in both 3ds max, and source engine.
Let max represent anything related to 3ds max
Let css represent anything related to counter-strike source.
max_second = css_second
=> max_frames / (max_frames / max_second) = css_frames / (css_frames / css_second)
=> max_frames / max_fps = css_frames / css_fps
The formula to make the duration of both animations the same has now been determined.
Get to the Point?
By looking at the model viewer, the frame length and fps of the animation can be found for the weapon in CS:S. Also, the fps for animations in 3ds max is 30; unless you changed the default settings.
Taking the formula we have created:
max_frames / max_fps = css_frames / css_fps
Our known values:
css_frames and css_fps
max_fps
The value of max_frames can now be found.
After finding the value of max_frames, your animation in 3ds max will now be limited to that number of frames. Any more, it will be too long for the animation slot in CS:S. Any less, it will be too short.
During export, be sure to scale the animation up to the number of frames required in css. Please refer to the example below.
Ofcoures, you can always just change the fps in 3ds max to the fps in CS:S, and the frame length in CS:S will be the frame length in 3ds max. However, 3ds max's fps setting is limited to only a few values (it will change to the nearest valid value if you enter something invalid). In addition, most animators are used to the timing of 30 fps. (timing as the number of frames to use for a certain action).
Example
Case: I want to make an animation for a CS:S weapon's reload slot. The reload has 108 frames and is at 39 fps. What is the frame length to use in 3ds max?
Given:
css_frames = 108
css_fps = 39
max_fps = 30
Unknown:
max_frames = ?
Formula:
max_frames / max_fps = css_frames / css_fps
=> max_frames / 30 = 108/39
=> max_frames = 108/39 * 30 (multiply both sides by 30)
=> max_frames = 83.076923076923076923076923076923 (simply plug the above values to a calculator)
The decimal places have to be rounded out, since you cant get half a frame. Therefore, your animation must have 83 frames within 3ds max.
Upon export, I must scale the 83 frames back to 108 frames. If i exported with 83 frames, then CS:S will play the 83 frames at 39 fps, which would make the animation too fast.
You can scale the animation by going into the "Time Configuration" floater: (Look at screenshot) It is the button in the lower right corner of the zoomed section within the circle.
Conclusion
This concludes the tutorial. Nuff said. Have fun animating! :) - ImBrokeRU




