Question about node names for joints and collision geometries
by Anders Dahnielson · in Torque 3D Professional · 07/14/2014 (9:14 am) · 19 replies
I'm preparing to rewrite the Artist Guide from scratch for Torque, as it curently isn't very helpful, a bit confusing and contradicting itself. Especially as it freely mixes old DTS-related with new Collada-related information. The first step for me is to fully understand the recommended Collada-based workflow for rigging and importing characters so I can explain it properly. So far I have a few questions related to this task regarding nodes and collision geometries.
Nodes
Why does the Player require that six nodes named Bip01_Pelvis, Bip01_Spine, Bip01_Spine1, Bip01_Spine2, Bip01_Neck and Bip01_Head exist in the shape? Why are those names hardcoded into the class? What makes them a special case? Shouldn't the Player just play the selected animation(s) and let the animations drive whatever nodes that are defined in them?
Collision
The information about collision geometry/meshes are inconsistent. Exactly what shall my collision meshes be called?
According to the example in the section "Level-of-Detail (LOD)" in Artist Guide/Primer/Torque Art Primer it can be named ColBox-N (where the suffix N is an integer). The section "Collision Geometry" on the same page lists possible name prefixes such as ColBox, ColSphere and so on that can be used to give a hint to the Torque engine about what type of geometry to use, as stated by the sections second paragraph. However, the same sections first paragraph states that "Collision detail levels must be named Collision-X or LOS-X for collision or line-of-sight (raycast) collision respectively." Directly contradicting the second paragraph. Meanwhile the section "Collision Meshes" in Artist Guide/Formats/COLLADA states "Meshes exported to COLLADA can be marked as collision or line-of-sight collision meshes by setting the node or mesh name to Collision-X or LOSCol-X respectively, where X is a number from 1 to 8 in the case of collision meshes, or 9-16 in the case of LOS collision meshes."
So, what is it? Collision-N or ColBox-N (etc) for collision meshes, LOS-N or LOSCol-N for line-of-sight meshes?
Also, what does the suffixed detail size value for collision and LOS geometries exactly mean. I'm having trouble understanding the explanation: "Collision geometry is stored in a shape within one or more detail levels with negative size values (indicating that the detail level is not to be rendered)."
Nodes
Why does the Player require that six nodes named Bip01_Pelvis, Bip01_Spine, Bip01_Spine1, Bip01_Spine2, Bip01_Neck and Bip01_Head exist in the shape? Why are those names hardcoded into the class? What makes them a special case? Shouldn't the Player just play the selected animation(s) and let the animations drive whatever nodes that are defined in them?
Collision
The information about collision geometry/meshes are inconsistent. Exactly what shall my collision meshes be called?
According to the example in the section "Level-of-Detail (LOD)" in Artist Guide/Primer/Torque Art Primer it can be named ColBox-N (where the suffix N is an integer). The section "Collision Geometry" on the same page lists possible name prefixes such as ColBox, ColSphere and so on that can be used to give a hint to the Torque engine about what type of geometry to use, as stated by the sections second paragraph. However, the same sections first paragraph states that "Collision detail levels must be named Collision-X or LOS-X for collision or line-of-sight (raycast) collision respectively." Directly contradicting the second paragraph. Meanwhile the section "Collision Meshes" in Artist Guide/Formats/COLLADA states "Meshes exported to COLLADA can be marked as collision or line-of-sight collision meshes by setting the node or mesh name to Collision-X or LOSCol-X respectively, where X is a number from 1 to 8 in the case of collision meshes, or 9-16 in the case of LOS collision meshes."
So, what is it? Collision-N or ColBox-N (etc) for collision meshes, LOS-N or LOSCol-N for line-of-sight meshes?
Also, what does the suffixed detail size value for collision and LOS geometries exactly mean. I'm having trouble understanding the explanation: "Collision geometry is stored in a shape within one or more detail levels with negative size values (indicating that the detail level is not to be rendered)."
About the author
Bought his Torque Game Engine license in April 2004 and then pursued to not make very much with it.
#2
In the member function PlayerData::preload those are specifically stored away:
To be used in Player::updateAnimationTree and nowhere else, AFAIK:
Can someone explain?
07/14/2014 (10:30 am)
Quote:If it just works without them then I don't understand why there are functionality in the Player class devoted to those spine nodes.
As far as I've been able to tell, the node names don't matter.
In the member function PlayerData::preload those are specifically stored away:
// Resolve spine
spineNode[0] = mShape->findNode("Bip01 Pelvis");
spineNode[1] = mShape->findNode("Bip01 Spine");
spineNode[2] = mShape->findNode("Bip01 Spine1");
spineNode[3] = mShape->findNode("Bip01 Spine2");
spineNode[4] = mShape->findNode("Bip01 Neck");
spineNode[5] = mShape->findNode("Bip01 Head");To be used in Player::updateAnimationTree and nowhere else, AFAIK:
void Player::updateAnimationTree(bool firstPerson)
{
S32 mode = 0;
if (firstPerson)
if (mActionAnimation.firstPerson)
mode = 0;
// TSShapeInstance::MaskNodeRotation;
// TSShapeInstance::MaskNodePosX |
// TSShapeInstance::MaskNodePosY;
else
mode = TSShapeInstance::MaskNodeAllButBlend;
for (U32 i = 0; i < PlayerData::NumSpineNodes; i++)
if (mDataBlock->spineNode[i] != -1)
mShapeInstance->setNodeAnimationState(mDataBlock->spineNode[i],mode);
}Can someone explain?
#3
AFAIK, that's the bounding volume that is used for a lot of other stuff. The documentation talks about bounds and collision meshes as two separate things in two separate sections. This is all that the documentation has to say about bounds (edited together):
07/14/2014 (10:31 am)
Quote:
If you crack open the soldier_rigged.dae file and examine the model you'll find the collision box to simply be named 'Bounds'.
AFAIK, that's the bounding volume that is used for a lot of other stuff. The documentation talks about bounds and collision meshes as two separate things in two separate sections. This is all that the documentation has to say about bounds (edited together):
Quote:
DTS bounding box is simply an axis-aligned cuboid that fits around the shape. Torque 3D uses the centre of the bounding box as the object's origin when placed in the world editor, and it may also be used for simple collision detection.
It is important therefore for the shape bounding box to have the correct size and position. When exporting DTS models, this was done by adding a mesh called bounds to the root level of the scene. The DTS exporter would detect this special name and use the bounds mesh geometry to compute the shape bounding box.
This option is still available to models exported to COLLADA, and may be preferable if the model is animated and you want exact control over the size and position of the bounding box. For example, a walking character animation may move the feet or arms of the model outside the box containing the shape in its root pose, so you can use a custom bounding box to explicitly specify the bounding box extents.
If the DAE model does not contain a root level <node> called bounds with geometry attached to it, the Torque 3D COLLADA importer will automatically calculate a bounding box that encloses all of the geometry in the scene. For animated models, only the root (non-animated) pose is considered. For static objects this is usually adequate.
Every 3D shape includes an axis-aligned bounding box. This box appears around the shape when it is selected in the World Editor, and can be used for simple collision detection or mouse-hit picking. The bounding box is also used to determine which shape detail level to render (see LOD). The size of the bounding box is not fixed to the shape geometry. The modeler is free to define a custom bounding box extent for an object. This is normally done prior to DTS/DAE export by creating a cube mesh called "bounds" with the appropriate dimensions.
A mesh called "Bounds" can be used to define the object's origin (as opposed to your 3d content applications origin) and is used to define the speed that the object is intended to be moving at. Such as during a run sequence, if you had a character running forward at 1 meter a second in your 3d application's scene and had the "Bounds" object follow your character then when you bring it into Torque 3D and assigned to the player's run animation then the playback speed of the animation can be adjusted depending on the speed that the player is moving through the game world. What this means is that animations don't have any sliding issues caused by the character's in game speed not matching with the designed animation speed.
Animation sequences that move the character should include a ground transform. This tells the engine how fast the character would move along the ground when the animation is played back at normal speed. In the case of a Player object, this allows Torque to scale the animation playback speed to match the in-game speed that the Player is moving. For example, if the model was animated such that it would normally move at 3 units per second, but in-game was moving at 6 units per second, then the animation can be played back at double speed so the feet do not look like they are skating along the ground. Another use for ground transforms is to automatically switch between walking and running animations based on the in-game velocity of the Player.
The exact details of how to export ground transforms will depend on the modeling package. In general, the animation should be created so the character moves through space, rather than running or walking in-place. Animate the bounds node to move with the character so there is no translation relative to the bounds node. On export, the ground transform is determined by subtracting the movement of the bounds node from the walking or running animation so that it will play in-place in Torque 3D.
#4
Well, the only thing the contradicting documentation about collision geometries agree upon is that collision meshes has a negative suffix ranging from -1 to -8 and LOS meshes has a negative suffix ranging from -9 to -16.
Yes, I know. But from an artists point of view the DTS can be considered as an internal binary format to the engine. That the normal and recommended current workflow should be Collada-based.
07/14/2014 (10:33 am)
Quote:I've seen suffixed detail size for LOD meshes, but not for collision.
Well, the only thing the contradicting documentation about collision geometries agree upon is that collision meshes has a negative suffix ranging from -1 to -8 and LOS meshes has a negative suffix ranging from -9 to -16.
Quote:Oh, by the way, Torque uses both .dts and .dae still to this day.
Yes, I know. But from an artists point of view the DTS can be considered as an internal binary format to the engine. That the normal and recommended current workflow should be Collada-based.
#5
Collision-1 is the node, colBox-1/colMesh-1 is the actual mesh. Collision objects are negative eg: collision-1 because LOD nodes are positive eg: detail64.
I've never actually used the LOS/COLLOS stuff.
This may ... or may not ... help.
07/14/2014 (11:20 am)
Player spinal nodes are hardcoded for blending aiming/look/recoil animations.Collision-1 is the node, colBox-1/colMesh-1 is the actual mesh. Collision objects are negative eg: collision-1 because LOD nodes are positive eg: detail64.
I've never actually used the LOS/COLLOS stuff.
This may ... or may not ... help.
#6
Feel free to change them if you like.
07/14/2014 (11:33 am)
I'm guessing the exact names hail from the days of the 3DS MAX exporter - the default node names are from the Biped default node names.Feel free to change them if you like.
#7
Hmm... I guess it's these threads in the Player class that apply the animation to those nodes:
Since they are required by the Player class to exist it's better that the class dictate the naming convention, especially as it follows an very established one from 3DS MAX. The recommendation should be to follow that naming convention fully (not just for those nodes) when rigging for Player in other 3D packages as well. With the benefit of then being automatic in 3DS MAX while exports from other packages just become compatible.
07/14/2014 (1:13 pm)
Quote: Player spinal nodes are hardcoded for blending aiming/look/recoil animations.Ok. So those animations are procedual? And where are those animations applied to the nodes? Can't figure out exactly how they are used by the engine...
Hmm... I guess it's these threads in the Player class that apply the animation to those nodes:
TSThread* mHeadVThread; TSThread* mHeadHThread; TSThread* mRecoilThread; TSThread* mImageStateThread;
Quote: I'm guessing the exact names hail from the days of the 3DS MAX exporter - the default node names are from the Biped default node names.Aha! That explains why those names are so prevalent among game engines when I tried to google them. :)
Since they are required by the Player class to exist it's better that the class dictate the naming convention, especially as it follows an very established one from 3DS MAX. The recommendation should be to follow that naming convention fully (not just for those nodes) when rigging for Player in other 3D packages as well. With the benefit of then being automatic in 3DS MAX while exports from other packages just become compatible.
#8
About the nodes, I've used completely different bones/nodes on new models and had them animate fine. But I haven't done so trying to use the model as a player, just as NPC/enemy units not under control by the client. Thus, the nodes for a 'player' specifically may require the bones mentioned for the animations to blend when the client controls the model.
Obviously you are going to be working with Collada if you are editing the mesh - since the .dts is a cached version of the model. As I've mentioned earlier, however, ultimately you can't avoid 'using' .dts because any model you import is going to be cached into one...and later loaded by the engine. If the engine finds a .dts, it's going to use that before the collada. It's also going to be faster loading it.
It seems that you have a fairly good understanding of this stuff to begin with, I'm pretty excited to see what documentation you might provide! Thanks!
07/14/2014 (2:10 pm)
Ah I see, I was referencing the LOD meshes not the LOS...which I didn't even know existed. Also, from what I've been able to tell the bounds box is used as the collision shape for the player soldier model.About the nodes, I've used completely different bones/nodes on new models and had them animate fine. But I haven't done so trying to use the model as a player, just as NPC/enemy units not under control by the client. Thus, the nodes for a 'player' specifically may require the bones mentioned for the animations to blend when the client controls the model.
Quote:Yes, I know. But from an artists point of view the DTS can be considered as an internal binary format to the engine. That the normal and recommended current workflow should be Collada-based.
Obviously you are going to be working with Collada if you are editing the mesh - since the .dts is a cached version of the model. As I've mentioned earlier, however, ultimately you can't avoid 'using' .dts because any model you import is going to be cached into one...and later loaded by the engine. If the engine finds a .dts, it's going to use that before the collada. It's also going to be faster loading it.
It seems that you have a fairly good understanding of this stuff to begin with, I'm pretty excited to see what documentation you might provide! Thanks!
#9
07/15/2014 (12:06 am)
You can safely ignore those spine nodes, I think. I've successfully implemented some far-too-complex blended and non-blended animation setups with a completely different bone structure. The snippet in updateAnimationTree sets some nodes not to receive blended animations (i.e. the traditional way vertical look animations are implemented), which is very specific to the Tribes character/animation setup. I don't think you'll have any issues nuking that core entirely if you set up your own character and animations.
#10
07/15/2014 (7:50 am)
My first draft of the guide to Rigging a Player Character is done in addition to the Overview.Quote:I believe the Bip01_* nodes should be removed from Torque 3D in the long run, as the Player class instead should require head, headside and *_recoil sequences to handle those actions.
The snippet in updateAnimationTree sets some nodes not to receive blended animations (i.e. the traditional way vertical look animations are implemented), which is very specific to the Tribes character/animation setup. I don't think you'll have any issues nuking that core entirely if you set up your own character and animations.
#11
07/15/2014 (11:24 am)
@Anders: Hey man thanks! This is a great, robust guide to character rigging. I'm going to share this with the other artist I've been working with. Instant bookmark, I am eternally grateful!
#12
What is the purpose of the Soldier_LOD2 mesh? I can't see the usefulness of having a separate mesh for a model that takes up 2 pixels on the screen.
07/17/2014 (2:14 pm)
Quick question:If you take a look at the soldier_rigged.dae model, you'll find that there are 4 LOD's: Soldier_LOD300, Soldier_LOD200, Soldier_LOD100, and Soldier_LOD2. What is the purpose of the Soldier_LOD2 mesh? I can't see the usefulness of having a separate mesh for a model that takes up 2 pixels on the screen.
#13
07/17/2014 (2:18 pm)
Otherwise the soldier wouldn't be rendered until his bounding box is 100 pixels on the screen (using the Soldier_LOD100 mesh).
#14
07/17/2014 (2:27 pm)
Whoah, very nice work on those docs. Though I think the list of files required to import a character could use more description. For example, that the .cs files are created automatically, and more detail on the character.cs file.
#15
07/17/2014 (2:27 pm)
Ah, gotcha. Thanks for the quick reply!
#16
Overhead view

Upon import, the console says:
Object mesh "alien2_LOD300" has no matching detail ("detail300" has been added automatically)
Object mesh "alien2_LOD200" has no matching detail ("detail200" has been added automatically)
Object mesh "alien2_LOD100" has no matching detail ("detail100" has been added automatically)
Any ideas?
07/17/2014 (4:07 pm)
Another question: I've imported a rigged, multiple-LOD mesh into Torque. All is well except for one small problem. In the ShapeEditor, under the 'Details' tab, if I select my character its bounding box is overly large:Overhead view

Upon import, the console says:
Object mesh "alien2_LOD300" has no matching detail ("detail300" has been added automatically)
Object mesh "alien2_LOD200" has no matching detail ("detail200" has been added automatically)
Object mesh "alien2_LOD100" has no matching detail ("detail100" has been added automatically)
Any ideas?
#17

This is the red object bounding box that is displayed in the preview window. It seems that the white one is fine. What's the difference? On the soldier model, the red box is overly large as well but it is at least centered around the player model.
07/17/2014 (5:06 pm)
Here's another pic: 
This is the red object bounding box that is displayed in the preview window. It seems that the white one is fine. What's the difference? On the soldier model, the red box is overly large as well but it is at least centered around the player model.
#18
If anyone hits this, just be sure you set up your collision geometry, lol.
07/17/2014 (5:16 pm)
Derp, it was the collision box not set up yet...If anyone hits this, just be sure you set up your collision geometry, lol.
#19
07/18/2014 (8:50 am)
Nice work Anders! Thanks for taking on a project that desperately needs to be done in order for T3D to attract new designers and developers. I hope you can wade through it all successfully. Michael Perry did a massive amount of work to get the docs to where they are currently but they still need a lot of blanks filled in and more in-depth information exactly like you're doing. Thanks again. Fantastic!
Torque Owner Jesse Allen
Anyways, I believe I can help with some of the stuff you've asked about:
Nodes
- As far as I've been able to tell, the node names don't matter. I mean, I have been able to import models with different rigs and bone structure and have them use the provided animations. In my case, I hadn't tried to use these as a player but in the player's datablock you can setup what animations the shape is linked to. So I don't see why it wouldn't work.
Collision
- The collision box can be named whatever you want. If you crack open the soldier_rigged.dae file and examine the model you'll find the collision box to simply be named 'Bounds'. If you were to go trying to name that collision box some kind of uniform name Torque would start throwing errors that the name is in use. Just name it anything and don't apply any material to it and it'll be invisible. Then you can just select it as your collision mesh in Torque in the Shape Editor.
Detail size
- I've seen suffixed detail size for LOD meshes, but not for collision. For collsion, usually a single shape will suffice (which you want to be as simple as possible). The LOD suffixes indicate how many pixels the object takes up on the screen. For example, if you have a model named 'object': If it was named object_LOD300 it would render that shape when the object takes up 300 pixels on the screen. If you moved farther away, obviously the model would take up less pixels. So you'd have another model named object_LOD200 that would appear when the model was farther away, only taking up 200 pixels.
P.S. Oh, by the way, Torque uses both .dts and .dae still to this day. The .dae is the raw model data, the .dts is the cached version of a shape that has already been 'sorted' by the engine. Depending on your assets and goal, you may need both. The .dts load faster into the engine since they've already been cached by the engine. In a multiplayer environment, however, you may need the .dae for the datablocks.
Hope this helps. Cheers!