Calculating Animation FPS

So we've all seen great releases with the most awesome looking model/skin ever right? Well here's the thing that really ruins a nice replacement for me - improperly timed animations! Improperly timed animations result in an animation not being played all the way through or ending too quickly thus leaving time at the end of a sequence where the gun does not move. This problem is really annoying throwing off the player's reload timing and looks weird because your replacement gun just sits there doing nothing for a time which defeats the purpose of animating it. So here's how you fix this problem:

First off decompile Valve's model for whatever gun you are going to replace. This is always a good idea when you are replacing any skin as it is a great reference to start from. If you are replacing animations for the USP, decompile Valve's USP and then open up the SMD for the animation you want to replace in MS3D or 3DS and view the framecount in there. The default FPS for Valve's animation will be in the mdldecompiler.qc file next to the corresponding sequences.

For those of you who do not wish to read about the math involved here is a simple formula:

Target FPS = Your Framecount * Valve Framerate / Valve Framecount

As an example I'm going to replace the USP silencer detach animation. The number of frames in my animation I have made is 86. The number of frames in Valve's default silencer detach animation is 116. The default framerate for Valve's animation is 37. So now we need to find out how fast we need to play our animation to match the amount of time it takes to remove the silencer in Valve's animation. To do this we use simple proportions (see picture).
  1. Write your animation's framecount (86) over x which will be your target framerate.
  2. Write the fraction from step 1 equal to Valve's framecount (116) over Valve's framerate (37).
  3. Cross multiply.
  4. Divide to get x by itself so in this case we will divide both sides by 116. 116x will cancel out to just x as a result.
  5. Multiply/divide out the remaining numbers to get your target framerate which is approximately 27.43 in this case.
If the math bothers you then use this easy formula: Target Framerate = (Your Framecount x Valve's Framerate) / Valve's Framecount

Sorry for the math lesson ;).

Now apply this knowledge to the qc file the text in red is the command you should have changed:

$sequence detach_silencer "detach_silencer" ACT_VM_DETACH_SILENCER 1 fps 27.43 { { event 5004 29 "Weapon_USP.DetachSilencer" } }

Please note there is only a certain level to which you can apply this. Obviously you can't stretch something like a 5 frame animation across a time of about 10 seconds otherwise it would look like it was in slow motion.

Oh noes! You're not a Member!

Want access to cool stuff? As a member you can:

  • Post. Give the submitter your thoughts on this Tutorial.
  • Say Thanks. Show your appreciation by sending the submitter points.
  • Stamp Posts. Let other posters know what you think of their posts.
  • Rate. Give this Tutorial a rating out of 10.
  • Flag. Alert moderators and warn members of a problem with this Tutorial.
  • Vote. Vote the submitter for the Monthly Awards.
  • Subscribe. Get notified when this submitter submits again.

Interested? Register or Login

Comments

  • TheGingerBreadMan's Levels
    • P1: Beggar
      Points: 65
    • C1: Member
    • A4: Graduate
      Account Age: 4 years
    Posted 3 years ago
    Posted by CapnJack
    Posted by TheGingerBreadMan Hey, I followed this tutorial and My anims work perfectly in Local games but when I go online, they are all screwed up, cut off, and swapped around. When I hit reload it runs it for half a second the goes into idle without finishing the reload animation. Also my draw animation just doesn't play at all. Any help?
    In short, you compiled your sequences out of order from the original. Decompile the original v_model and make sure ALL $sequence lines appear in the exact order for your custom .qc file as they do in the original's .qc. No extra sequences may be added nor may any be left out.

    Thank You very Much for the help.

    Bananite
  • CapnJack's Levels
    • P1: Beggar
      Points: 670
    • E1: Helper
      EF: 7
    • C1: Member
    • A6: Elder
      Account Age: 6 years
    Posted 3 years ago
    Posted by TheGingerBreadMan Hey, I followed this tutorial and My anims work perfectly in Local games but when I go online, they are all screwed up, cut off, and swapped around. When I hit reload it runs it for half a second the goes into idle without finishing the reload animation. Also my draw animation just doesn't play at all. Any help?

    In short, you compiled your sequences out of order from the original. Decompile the original v_model and make sure ALL $sequence lines appear in the exact order for your custom .qc file as they do in the original's .qc. No extra sequences may be added nor may any be left out.

    User Title
    Crankcase Blues
  • TheGingerBreadMan's Levels
    • P1: Beggar
      Points: 65
    • C1: Member
    • A4: Graduate
      Account Age: 4 years
    Posted 3 years ago

    Hey, I followed this tutorial and My anims work perfectly in Local games but when I go online, they are all screwed up, cut off, and swapped around. When I hit reload it runs it for half a second the goes into idle without finishing the reload animation. Also my draw animation just doesn't play at all. Any help?

    Bananite
  • THEnub's Levels
    • P4: Worker
      Points: 42,538
    • E3: Tutor
      EF: 50
    • C1: Member
    • A5: Veteran
      Account Age: 6 years
    Posted 3 years ago

    Posted by dddanielll

    Someone should make a list of valves framecount and fps on the valve weapon-animations

    Well, I don't think it needs to be mentioned as you've found it, but for anyone else looking, I have made a framecount cheat sheet, just check the DevHub (Tuts> CSS > Animating).

    User Title
    When a man no longer fears dea
  • dddanielll's Levels
    • P2: Drudge
      Points: 1,357
    • E1: Helper
      EF: 1
    • C1: Member
    • A4: Graduate
      Account Age: 4 years
    Posted 3 years ago

    Someone should make a list of valves framecount and fps on the valve weapon-animations

    User Title
    Daniel A.K.A. PilotDani
  • Deazralei's Levels
    • C1: Member
    • A4: Graduate
      Account Age: 4 years
    Posted 4 years ago

    Just some simple questions:

    1. What is compiling?
    2. What does it do?

    Please reply, I'm trying to be an animator. ^^

    User Title
    Back to my Command Center.
  • Dave-Life's Levels
    • C1: Member
    • A5: Veteran
      Account Age: 5 years
    Posted 5 years ago

    How do you decompile models?

    Guy who logs in once every 6 m
  • didnt_happen's Levels
    • P2: Drudge
      Points: 1,521
    • E1: Helper
      EF: 6
    • C1: Member
    • A6: Elder
      Account Age: 6 years
    Posted 5 years ago

    One of the most useful and handy tutorials I have ever found here. I use this quite frequently when compiling and animating.

    Thanks a lot!!

    no
  • sick420's Levels
    • P2: Drudge
      Points: 7,163
    • C1: Member
    • A6: Elder
      Account Age: 7 years
    Posted 5 years ago

    Thank you^^

    sup
  • CapnJack's Levels
    • P1: Beggar
      Points: 670
    • E1: Helper
      EF: 7
    • C1: Member
    • A6: Elder
      Account Age: 6 years
    Posted 5 years ago
    Posted by sick420 Could you explain how the "reverse" this tut? i want my sequence to play on 30 fps. as an example= valves stuff: "20" frames "40" fps my stuff: "?" frames "30" fps i think i have to reverse this math stuff, but i dont know how :(

    Well if you use the formula you can use algebra to solve for any unknown value assuming you know all the other values. So for example if you wanted to find a frame count at a given frame rate you would instead solve for "Your Framecount".

    The simplified/reversed formula for this would be: YourFrames = YourFPS x ValveFrames / ValveFPS

    If you look at the proportion in the first picture instead of starting with 86 (Your Frame count) over x (target fps) you would start with (in your example's case) x over 30 since you already know your FPS.

    User Title
    Crankcase Blues

Credits

Submitter
CapnJack's Levels
  • P1: Beggar
    Points: 670
  • E1: Helper
    EF: 7
  • C1: Member
  • A6: Elder
    Account Age: 6 years
CapnJack (Creator/Co-creator)
Key Authors
CapnJack
Unknown

Rating

9.7/10
Based off 6 rating(s)

Additional Info

Genre
3D Animation, Compiling
Difficulty Level
Beginner

Stats

Post Count
24
ViewCount
10,333
Date Added
6 years ago
Date Modified
10 months ago

Share

Embed Code
Code to use:

More embeddable images

Bookmark and Share