T3D Beta 2 Bug: Swiming Animation
by Kevin Mitchell · in Torque 3D Professional · 05/09/2009 (4:56 pm) · 24 replies
When swimming the animation is stuck on root animation.
About the author
Riding Solo since 2005. Current Project: Fated World 2005-Present RPG Engine Tool Kit - Now available.
#2
Can i request ability to stay swimming on top of the water as well? For times where you don't really want to submerge/demerge whatever the correct terminology is?
05/22/2009 (7:12 am)
Yea meant to post that this morning but ran out of time. It's probably on the low prio. Can i request ability to stay swimming on top of the water as well? For times where you don't really want to submerge/demerge whatever the correct terminology is?
#3
05/22/2009 (7:15 am)
What I don't get is the code for the animation change mimics the regular player movement. Yet everything returns 0s to the vector calculations. Is anything set to 0 if isSwimming?
#4
If you want the player to stay on top of the water you can either adjust the water-density or the players-density.
I have considered whether a simpler model of swimming/buoyancy would be worth implementing for the player. Like...
Either the player has complete free-movement underwater (no sinking or floating over time), or, the player is always constrained to swim on the surface. IMO what it has now is more flexible since it is all based on the relative density of the player and the water.
But... if the player density is very low in order to keep him at the surface he will tend to float way too high in the water to make sense. I'm thinking of adding a floatCoverage or some parameter to allow control of this.
05/22/2009 (12:59 pm)
The swimming "code" is in beta2 and working. But there is still no swim animation for the gideon player.If you want the player to stay on top of the water you can either adjust the water-density or the players-density.
I have considered whether a simpler model of swimming/buoyancy would be worth implementing for the player. Like...
Either the player has complete free-movement underwater (no sinking or floating over time), or, the player is always constrained to swim on the surface. IMO what it has now is more flexible since it is all based on the relative density of the player and the water.
But... if the player density is very low in order to keep him at the surface he will tend to float way too high in the water to make sense. I'm thinking of adding a floatCoverage or some parameter to allow control of this.
#5
even with the right setup the forward animation never changes from root. The parameters that is used to calculate forward vector or what ever isn't bringing anything back to switch from the swimming root animation.
05/22/2009 (1:19 pm)
I have my own character with swiming set up properly. sequence14 = "art/shapes/players/animations/Male/crouch/TM_Adam_crouchForward.dsq crouchforward" ; sequence15 = "art/shapes/players/animations/Male/crouch/TM_Adam_crouchRoot.dsq crouchroot"; sequence16 = "art/shapes/players/animations/Male/crawl/TM_Adam_crawlForward.dsq crawlforward"; sequence17 = "art/shapes/players/animations/Male/crawl/TM_Adam_crawlRoot.dsq crawlroot"; sequence18 = "art/shapes/players/animations/Male/swim/TM_Adam_swimRoot.dsq swim_root"; sequence19 = "art/shapes/players/animations/Male/swim/TM_Adam_swimForward.dsq swim_forward"; sequence20 = "art/shapes/players/animations/Male/swim/TM_Adam_swimRoot.dsq swim_backward"; sequence21 = "art/shapes/players/animations/Male/swim/TM_Adam_swimRoot.dsq swim_left"; sequence22 = "art/shapes/players/animations/Male/swim/TM_Adam_swimRoot.dsq swim_right";
even with the right setup the forward animation never changes from root. The parameters that is used to calculate forward vector or what ever isn't bringing anything back to switch from the swimming root animation.
#6
these are the right animations right?
05/22/2009 (1:22 pm)
{ "crouch_root" },
{ "crouch_forward" },
{ "prone_root" },
{ "prone_forward" },
{ "swim_root" },
{ "swim_forward" },
{ "swim_backward" },
{ "swim_left" },
{ "swim_right" },these are the right animations right?
#7
05/22/2009 (1:24 pm)
Yes, they are the right animations, do you have the swimming related fields in your PlayerData set to appropriate values? Like swimForce, maxSwimSpeed, density, etc... These are set to appropriate values in the fps genre kit project.
#8
05/22/2009 (1:30 pm)
When I hacked in some swimming code I made it so when the player was looking downward (camera that is) the player would swim downward. Otherwise the player would slowly float toward the top. Didn't have anything like water density as that would be nice, but it is an idea and works fairly well.
#9
I don't see swimForce at all in war camp guy
05/22/2009 (1:33 pm)
density =1.1; airControl = 0.3; swimForce = 55.0 * 9.0; maxUnderwaterForwardSpeed = 6.0; maxUnderwaterBackwardSpeed = 6.0; maxUnderwaterSideSpeed = 6.0;
I don't see swimForce at all in war camp guy
#10
Actually, are you saying you are unable to move when you get in the water, or just that hes not playing your swim animation?
I was really waiting to debug / ensure that swim animations are playing correctly until I have some final swim animations. But I can probably pull out the old torque orc and tm swim anims to try testing this.
I suspect the problem is within pickActionAnimation, or its an art issue.
05/22/2009 (1:55 pm)
My bad, we appear to be relying on the defaults from C++, except for density and mass. What is your player's mass?Actually, are you saying you are unable to move when you get in the water, or just that hes not playing your swim animation?
I was really waiting to debug / ensure that swim animations are playing correctly until I have some final swim animations. But I can probably pull out the old torque orc and tm swim anims to try testing this.
I suspect the problem is within pickActionAnimation, or its an art issue.
#11
swimForce = 55.0 * 9.0;
swimBoundingBox = "2.0 2.0 1.3";
to my player.cs, double checked my animations in showtool (all ok),
ran the game, went swimming, and he stayed in root swimming anim. moved forward, back, sideways, but always in the root anim.
next??
have any of the devs actually checked if swimming infact works? "no swim anim for gideon", so how did they check if he swims?
EDIT: James posted as I was writing this, so disregard the checking bit
05/22/2009 (2:07 pm)
well, I addedswimForce = 55.0 * 9.0;
swimBoundingBox = "2.0 2.0 1.3";
to my player.cs, double checked my animations in showtool (all ok),
ran the game, went swimming, and he stayed in root swimming anim. moved forward, back, sideways, but always in the root anim.
next??
have any of the devs actually checked if swimming infact works? "no swim anim for gideon", so how did they check if he swims?
EDIT: James posted as I was writing this, so disregard the checking bit
#12
First, there is no ground transform in swim forward, which is why it is never selecting it in pickActionAnimation (anim.speed is zero).
Second, the player moves suddenly down about 2 meters when going into swim root, this is not the way a swim animation should work... The player is outside of his own bounding box and will clip through terrain etc.
05/22/2009 (3:02 pm)
The problem is the TM swim animations are just not very good...First, there is no ground transform in swim forward, which is why it is never selecting it in pickActionAnimation (anim.speed is zero).
Second, the player moves suddenly down about 2 meters when going into swim root, this is not the way a swim animation should work... The player is outside of his own bounding box and will clip through terrain etc.
#13
05/22/2009 (4:40 pm)
You know what would solve this problem.. actually having swimming, climbing and similar items.. solved and working by defualt. I see a bunch of posts that are being left to the community to solve, which is fine in one regard, but really swimming and climbing.. if your going to provide water that works.. and some decent examples.. these seem like something that would do well to be standard in torque.
#14
I just added a swimming animation to test that part out. swim_root and swim_forward. Neither one played.
05/22/2009 (6:50 pm)
First, I know the swimming physics do work in Beta 2. Someone fixed the bit where mSwimming was always set to false.I just added a swimming animation to test that part out. swim_root and swim_forward. Neither one played.
#15
Are you tying to use the TM swim animations? If so be aware that it won't work on the Gideon player, his rig is different from the "standard" which the TM animations are made for.
05/22/2009 (7:37 pm)
@HenryAre you tying to use the TM swim animations? If so be aware that it won't work on the Gideon player, his rig is different from the "standard" which the TM animations are made for.
#16
its been mentioned that Giddy has a "special" rig,
is it a physx rig with "ragdolled" extra bones attached to the spine, to allow the dynamic movement of the coat?
like the rig they used for " be the dino"?
are we going to find out how to implement such a rig?
I know that a rig like that can be exported via XML.
05/23/2009 (1:19 am)
yes,its been mentioned that Giddy has a "special" rig,
is it a physx rig with "ragdolled" extra bones attached to the spine, to allow the dynamic movement of the coat?
like the rig they used for " be the dino"?
are we going to find out how to implement such a rig?
I know that a rig like that can be exported via XML.
#17
There is nothing like that implemented or planned to be implemented in stock t3d.
05/23/2009 (1:51 am)
Giddy is a perfectly normal skinned mesh. All I meant is that he does not have the same number/naming of nodes as the torqueorc for which the TM animations were made.There is nothing like that implemented or planned to be implemented in stock t3d.
#18
05/23/2009 (2:54 am)
So there's no way to fix the non changing root swim animation change? And it's not on the "things to fix" list?
#19
Making swim animations for Gideon afaik is on the todo list but that's not going to help you with your own character.
If you want to hack pickActionAnimation to always play swim forward at the same speed and therefore not need ground transforms you can, but like any of the other movement animations it really "should" require/expect them.
05/23/2009 (3:10 am)
Sorry if I was not clear before, everything is working correctly, there is no bug. What you need is a swim animation for your character that has ground transforms.Making swim animations for Gideon afaik is on the todo list but that's not going to help you with your own character.
If you want to hack pickActionAnimation to always play swim forward at the same speed and therefore not need ground transforms you can, but like any of the other movement animations it really "should" require/expect them.
#20
05/23/2009 (4:07 am)
I'm not even using the Gideon model.. I re-exported the run animation from my own model as swim_forward. As I mentioned, I can't even get it to play swim_root. :P
Torque Owner deepscratch
DeepScratchStudios
any workabout in the mean time??