Jump to content

Speed up the animations ingame


the1skorpion

Recommended Posts

Hello Torque community!


I´m very new to Torque so I was just wondering how one can speed up the animations. For example let´s say that I have a running animation that´s 30 frames long. Torque is going to play it in 24fps if I´m not mistaking, but that looks incredibly slow ingame. So yeah how can I go about to speed the animation up. Thank you so much in advance


Cheers,

-Patrick

Link to comment
Share on other sites

Well it is not that simple, for example move animations have a ground scale, for example here https://github.com/GarageGames/Torque3D/blob/development/Templates/Full/game/art/shapes/actors/Soldier/soldier_rigged.cs#L65

The numbers there determine how fast the animation playes relative to movement of the player.

Other animations like look animations depend on how fast you move your mouse and weapon animation depend on how fast you scale the state in the state machine or if you scale it at all or not.

This is how long the reload animation for example plays:

https://github.com/GarageGames/Torque3D/blob/development/Templates/Full/game/art/datablocks/weapons/Lurker.cs#L778

And here if it should be scaled to fit the time the reload state goes:

https://github.com/GarageGames/Torque3D/blob/development/Templates/Full/game/art/datablocks/weapons/Lurker.cs#L782


So you have movement animations which are based on ground speed and you have state machine animations for weapons and player interaction that are based on the speed of the states in it and if you activate the flag if the animation should scale.

Anything else you want to scale?

Link to comment
Share on other sites

If you're willing to dive into the engine code a bit, then you can easily add a custom timescale for player animations in player.cpp. In the parts that update animations sequences, find the areas that multiply by "dt" and also multiply by your custom timescale. This can affect a few other behaviors such as player scheduled actions as well, but may be what you're after. I'm sorry I can't be more specific on the changes as I don't have the code in front of me at the moment.

Link to comment
Share on other sites

open up the datablocks of weapons for example the one of the lurker and search for ´ stateTimeoutValue = 10;// change the number to affect the animation speed in the first person.


for thirdperson you can always edit the player datablock

in player.cs see for example

crouchForce = 405;

maxCrouchForwardSpeed = 4.0;

maxCrouchBackwardSpeed = 2.0;

maxCrouchSideSpeed = 2.0;

just play around with the settings till ur satisfied

Link to comment
Share on other sites

For the state machine yes, but you would have to set stateWaitForTimeout, stateScaleAnimation and maybe also stateScaleAnimationFP all to true before it works and the state needs to have an animation, ah and maybe that stateScaleShapeSequence as well to true and this only works for weapon images.

But I was mainly referring to your run speed settings, which just change the run speed, not the animation relative to it, you have to change the ground transform scale factor in the script files directly for the animation to change speed as I said.

Link to comment
Share on other sites

  • 3 weeks later...
Hello Torque community!


I´m very new to Torque so I was just wondering how one can speed up the animations. For example let´s say that I have a running animation that´s 30 frames long. Torque is going to play it in 24fps if I´m not mistaking, but that looks incredibly slow ingame. So yeah how can I go about to speed the animation up. Thank you so much in advance


Cheers,

-Patrick

 


I'm not quite sure that's correct. I always export at 30fps (want to do 60 for final if possible for smooth animation). My time synchs in game with same frame count...

at least I think it is?!

Duion, has anyone figured a conversion method to change the player class speed entries into real world measurements? Its input matches nothing, so its trial and error to match (at default scale).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...