Page 1 of 1

Character Animation

Unread postPosted: Thu Feb 19, 2009 10:28 pm
by ricksan
A post on this subject appeared in the UK TrainSim forum last year. In it, Derek mentioned he was working on a character animation DevDoc. However, to my knowledge the DevDoc was never completed or published (my apologies if that is not the case and such a document is in fact available). Though the subject of DevDocs has resurfaced recently, we're all nevertheless well aware that the RSDL crew are constantly deluged with requests for help and information. Still, I'm hoping someone can find the time to shed some light on this subject. I'll try to keep things simple.

I would like to add some crew characters to a series of locomotives I'm working on. I must admit up front that I haven't even started to make these characters (actually I'll convert existing ones), so I have no idea whether adding them to the sim is a simple matter or not. I'm asking for guidance now because I'd rather not spend a lot of time making a crew only to find out that skinned character animation is not something that is presently supported by the developer toolset.

What I'd very much appreciate having is the set of rules we have to abide by--anything we need to know, and to avoid, to insert animated characters into a locomotive cab.

A full tutorial on the subject of character animation would be useful someday, but that would be a complex and time consuming undertaking. For the time being I think it's safe to assume that those of us in this group who care to tackle character animation in RS will either already have experience with it, or are willing to learn the fundamentals on their own. I imagine that a formal DevDoc, even with its scope restricted to information on character animation as it specifically pertains to Rail Simulator, would also take considerable effort to produce.

So for now I'm only asking for the basics. I figure we can muddle our way through the details. At least I hope so! Here are some questions that come to mind:

1. What are the naming conventions for the character bones and skin?
2. What parent-child hierarchy, if any, is required for the bones and skin?
3. Is there a limit to the number of bones? (I think I saw a number somewhere.) By limit I mean both total number of bones and total allowable levels within the hierarchy.
4. Should a character be a child object of the locomotive, or just another node in the list?
5. Or are driver characters a special, separate object like couplers? If so, how is the XYZ position of the character specified?
6. We often use animation tools such as IK solvers and helper objects as animation aids. Do we need to bake the animations and delete things like that before export or will the exporter ignore them?
7. Please confirm that animated characters can be used as standalone scenery assets. In other words, not part of a locomotive but, for example, standing at trackside.
8. Evidently there are rules governing the use of the SkinDiffuse shader. I notes this statement in the Shaders DevDoc: "There are guidelines which must be followed when creating characters to ensure the character skeleton matches the expected skeleton within the shader." Please provide those guidelines.
9. Is there any limit on the number of animation frames? I assume that character movements are keyed to the standard 30 fps.
10. Anything else we need to know?

Personally I'm not interested in platform characters (the ones that materialize, walk for a while, then stand and wait), but someone else here might be. A few words about how they are created would also be helpful.

In lieu of the above, please if possible make available the max file for a sample, textured character. We can probably figure out what to do from that.

Thanks in advance.

Re: Character Animation

Unread postPosted: Fri Feb 20, 2009 4:01 am
by decapod
Rick - Take a look at the examples in the developer downloads, in Developer\addon\Scenery\characters there is an example test_male which uses the skindiffuse shader - Max files included too.

Re: Character Animation

Unread postPosted: Fri Feb 20, 2009 6:39 am
by Derek
Hi,

I think I have all those answers as I created most of them in RS.

Let me put something together.

Yes I am doing the doc but it got put on hold, maily due to the lack of interest and work involved.
Now it is from a Max point of view, however I will be working with a few canvas chaps to get a solution in 3dCanvas too.

regards

Derek

Re: Character Animation

Unread postPosted: Fri Feb 20, 2009 3:56 pm
by KCJones
Thanks form me too. That will be a great help

Dick

Re: Character Animation

Unread postPosted: Fri Feb 20, 2009 4:54 pm
by ricksan
Thanks, Paul. New to this! Will check it out.

Re: Character Animation

Unread postPosted: Sun Feb 22, 2009 4:22 am
by dkrum
Rick, I can't answer any of yur question, except #7. Yes you can have lineside animated characters. The attached screen shot is from the Oxford to Paddington Route, 7B05 Hinskey Yard to Cholsey.

Dave

Re: Character Animation

Unread postPosted: Sun Feb 22, 2009 12:54 pm
by ricksan
Thanks, Dave.

As a matter of fact I was able to export the sample Max character that comes with the RS developer package and place it into the sim yesterday. At this point I think I know the answers to all of my questions. Once I'm sure, I'll post them here.

Re: Character Animation

Unread postPosted: Sun Feb 22, 2009 8:53 pm
by ricksan
OK, I played around with the example "Test_male" character a bit. Was able to insert it into a route as a standalone animated object. Also placed it into the tutorial engine ("SimpleEngine") as the driver (engineer). Following are my responses to my earlier questions.

1. What are the naming conventions for the character bones and skin?
Skins follow the usual RS LOD naming format; bone names can be any friendly mnemonic, possibly with the exception of the root node, which is named Bone_ctrl_node.

2. What parent-child hierarchy, if any, is required for the bones and skin?
Bones seem to have a hierarchy but only insofar as they need to be linked in the usual way that's used to make any biped work. The skin objects are both root nodes, as is Bone_ctrl_node. All other bones are children of that node. The hierarchy of the Test_male character follows.

Code: Select all
1_0040_CharacterName
2_0200_CharacterName
Bone_ctrl_node
  Bone_Pelvis
    Bone_L_Thigh
      Bone_L_Calf
        Bone_L_Foot
          Bone_L_Toe
    Bone_R_Thigh
      Bone_R_Calf
        Bone_R_Foot
          Bone_R_Toe
    Bone_Spine
      Bone_Spine01
        Bone_Spine02
          Bone_L_Clavicle
            Bone_L_UpperArm
              Bone_L_ForeArm
                Bone_L_Hand
          Bone_Neck
           Bone_Head
          Bone_R_Clavicle
            Bone_R_UpperArm
              Bone_R_ForeArm
                Bone_R_Hand


3. Is there a limit to the number of bones?
At least 23 are permitted, including Bone_ctrl_node. Maybe more are allowed, but I didn't test it.

4. Should a character be a child object of the locomotive, or just another node in the list? AND
5. Or are driver characters a special, separate object like couplers?
Driver (engineer) and fireman characters are created as separate Max scenes. They are not part of the locomotive scene. In the locomotive XML blueprint they are treated as child objects of the locomotive, similar to smoke and steam effects, audio and so forth. The characters are specified with their own blueprints located in the Driver and Fireman folders, respectively. The blueprints in turn point to the character shape and texture files which should be placed in the Scenery\Characters folder. The position of the characters relative to the locomotive defaults to 0,0,0, but can be manually repositioned in the Asset Editor preview screen.

6. We often use animation tools such as IK solvers and helper objects as animation aids. Do we need to bake the animations and delete things like that before export or will the exporter ignore them?
The character and animation export dialogs in Max make this clear. Bones should be hidden prior to export. The dialogs have checkboxes that tell the exporter to ignore hidden objects and helpers.

7. Please confirm that animated characters can be used as standalone scenery assets. In other words, not part of a locomotive but, for example, standing at trackside.
As previously noted, this is definitely possible.

8. Evidently there are rules governing the use of the SkinDiffuse shader. I noted this statement in the Shaders DevDoc: "There are guidelines which must be followed when creating characters to ensure the character skeleton matches the expected skeleton within the shader." Please provide those guidelines.
I didn't see anything special about the way the texture is mapped to the character. For example, the textures that ship with the sim have the characters' faces in a variety of UV locations. You just have to map the images in the texture to the proper place on the character and specify the shader to be SkinDiffuse.fx. The Material Editor parameters used for Test_male, which may simply be the defaults, are:

Code: Select all
Filter Mode: MipLinear
Mip LOD Bias: 0.0
Tiling Mode: TILE
UV Operation: UV_OP_COPY
UV Channel: 1
UV Arguments: (all six are 0.0)
UV Special Effects
  Texture is animated (unchecked)
  Scroll UVs (unchecked
  # frames: 0
  frames per second: 20
  Horiz. (U) Scroll Rate: 0.0
  Vertical (U) Scroll Rate: 0.0
Material Options
  Z-Buffer Mode: NORMAL
  Transparency: NONE
  Self-Illum: 0.0
  Z Bias: 0
  Opacity: 100.0
  2 Sided (unchecked)
Material Properties
  Collision Type: NO COLLIDE
  Backface cull (unchecked)
  Do not occlude material (unchecked)
  Not View Facing (checked)
  Visible Distance: 0
  Additive Alpha: 128
  Sort Priority: 0
Behavior
  Casts Lightmap Shadows (checked)
  Generates Lightmaps (checked)
  Lightmap Texels/ Metre: 4.0
  Keep Vertex Colours (unchecked)
Light Glow (not enabled)
Light Pulse (not enabled)


9. Is there any limit on the number of animation frames? I assume that character movements are keyed to the standard 30 fps.
Doesn't appear to be. The Black 5 crew characters loop through a cycle lasting around 10 seconds. That's probably a good practical limit.

RSDL, please comment as needed. Special thanks to Derek.