Game Development Community

Ground collision issue

by Andy Hawkins · in Artist Corner · 03/14/2006 (7:37 am) · 7 replies

I've put my character's feet on ground zero in Lightwave but when it plays in Torque some times it just doesn't stand on the ground properly. For example on completely flat bits its fine in most cases, but when I run up hills and it is clearly away from the ground - the base of the character (origin) is off the ground in the game.

Please see these pics. The Lightwave pic is the first one, which show ground zero (y position = 0) - the blue line running through the word "root" is 0 on the y coord. The shaded square above where the feet are is my attempt to fix the problem using a cube exported as a NULL call bounds. You can see I have adjusted the cube to be just above the ground with the assumption the engine would bury the feet in the ground. However all it does is stops the character from animating.

So anyone out there know how I can overcome this. I thought of trying the simple ground tranformation in LW2DTS but that caused the animations to stick - and the character still floated. For example I would run forward and then release the keys, and the character would stick mid run, rather than resolve back to the root pose.

I hope someone can help.

Setup in Lightwave - without or with out bounds cube it is still off the ground in game
www.drewfx.com/Torque/collision_with_ground_setup.jpg
Outcome in Torque. A particular points the feet don't touch the ground
www.drewfx.com/Torque/collision_with_ground_in_game.jpg

#2
03/14/2006 (8:56 am)
Look at ground transform in your lightwave exporter. The above link seems overkill. Also, look up "ski" nodes.
#3
03/14/2006 (1:39 pm)
Greetings!

The LightWave DTS exporter does not support a custom bounds reference so I'm afraid that won't help you out here.

As you mention that it looks fine when on flat ground, I'm wondering if this is a collision box issue. You may want to play with the size of the player's collision bounds in the datablock and see if that helps. If I remember correctly the collision code makes sure that none of the collision bounds penetrate the terrain. So if the bounds extend too far forward, then you can see the floating.

- LightWave Dave
#4
03/14/2006 (3:05 pm)
Well I have no collision mesh at the moment so I'll put that in. The character is kinda large so maybe the automatic collision mesh is at fault. I'll let you know.
#5
03/14/2006 (3:09 pm)
Collision meshes were the first culprit I thought of. I've noticed that behavior with both the default Orc and Jill on steep terrain.
#6
03/14/2006 (9:14 pm)
Greetings!

Andy
You don't actually need a collision mesh exported for your player.

Well I guess I'm making a huge assumption that you are making use of the default Player class for this. If you are then the size of the object's bounds come from the Player's datablock, and all collision information in the DTS file is ignored. At least that's how I recall it...I haven't looked at that code for a while.

David
Ahh, yes. You jogged my memory on that one. I remember seeing this same issue with the default Orc and had to play with his bounds to get it just so. I don't believe you can ever get rid of this behavior at all angles with the current simplistic bounding box solution in Torque.

- LightWave Dave
#7
03/15/2006 (7:11 am)
Okay fixed it. I changed the boundingbox param in the PlayerBody definition to be small on the width and length, made the height 2m to match my model. Works well now - thanks for help.