Game Development Community

Ground Transform question

by Duncan Gray · in Artist Corner · 04/10/2007 (7:40 pm) · 16 replies

My run animation was working fine then stopped suddenly (in TGE). The player would stay in its root animation while sliding across the ground when you push the forward button.

Everything looked fine in STP so I traced into the player code to locate the source of the problem.

In placer.cc in method void PlayerData::getGroundInfo there is a line of code as follows

if ((dp->speed = dp->dir.len()) < 0.01f)

I was getting values of 0.06 which failed the above test and tricked the player code into thinking that my animation had a moving ground transform and so got treated differently, causing the run animation to not play.

I did a temp fix by changing the 0.01 to 0.1 in the above test and my player began performing correctly again.

What concerns me is that this implies that my 'ground transform' in the animation has somehow moved during the course of the animation. I exported with only one ground frame set, so there should be no movement and my Bounds box is not keyed or parented to anything.

I'm not sure what may have caused this tiny amount of movement in the ground transform.

#1
04/10/2007 (8:02 pm)
...
#2
04/11/2007 (6:02 pm)
...
#3
04/11/2007 (7:03 pm)
Theory 1 - no difference

Theory two - YES

I had recently moved the bounds box up a tiny amount because I noticed the players feet were not quite on the ground in in TGE( in Blender they are) This tiny difference cause that line of code to fail. Wow.

I think it should be zeroed out on export because why can't I have my Bounds box slightly off center? :)
#4
04/11/2007 (7:20 pm)
...
#5
04/11/2007 (7:49 pm)
Strange, my character model doesn't even have a bounds box, nor ski bones(those have something todo with the ground transform right?) and its feet are on the ground.
#6
04/11/2007 (7:54 pm)
...
#7
04/11/2007 (7:55 pm)
Benj, contrary to popular belief, the ski bones are not used in the engine code at all. Perhaps they were a long time ago. The death animation code does its own cast rays to determine the slope of the ground and align the player accordingly. I have not studied it in detail but there is no reference to the ski bones and they have nothing to do with the ground transform.

If you have no bounds box, I believe the exporter creates one on export.
#8
04/11/2007 (7:58 pm)
It seems I was typing at the same time Joseph was. He typed less and thus posted first.
#9
04/11/2007 (8:04 pm)
...
#10
04/12/2007 (4:59 pm)
...
#11
04/12/2007 (5:28 pm)
Thanks, I'll try it out a bit later and give feedback
#12
04/13/2007 (2:16 am)
I can confirm that the dp->speed value now registers 0.00000 even when the Bounds box is not at 0.0 in Blender.

I have not been able to test (yet) if a moving Bounds box will still register as a positive value in the dp->speed variable. It should work but ... to be tested.
#13
05/12/2007 (4:49 pm)
...
#14
06/08/2007 (5:13 pm)
Hi,

Was this issue solved for 0.944? I am also having problems where the run animation will play erratically, when I first launch my mod the run animation will not play as if its stuck in the root animation, however if I move around a bit, I can get it to play.

I am still investigating, but I am still not quite sure if its something I have done wrong.
#15
06/08/2007 (5:18 pm)
...
#16
06/08/2007 (5:23 pm)
Hi Joseph, thanks for the quick reply.

I can email you the model however I may have done something embarisingly newbish that is causing the issue, I am trying to get away with as little animations as possible because I do plan on changing or implementing a new Player class because my animations will be a little different from the norm, I just wanted to see if I could get a few basic animations working in game.

If its ok to email you the model considering it could be all my fault I would be very greatful :)

do you want the .blend file and the dts / dsq files?

regards

Ian

EDIT: I just went ahead and emailed you the files, just to add this is happening in TGEA, with Blender 2.44 and 0.944 of the DTS exporter, I have not tried in TGE as I do not own it.