1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice
Like RaceDepartment on Facebook.

Driver hands animations

Discussion in 'Racer Physics and Technical' started by QuadCoreMax, Feb 22, 2011.

  1. Hey all,

    Here's a little tutorial on how it all works.
    So, what's important to check before exporting your skinned mesh :

    - your mesh should be closed/solid (all vertices merged)
    - your skeleton (the root joint) must be at 0,0,0
    - your animations are all on the same timeline, one after the other (done it at 24fps)
    - your hands animation should start from the left & animate to the extrem right
    - be careful with your keys, the more you have, the longer the conversion process into anim file, so just keyframe the joints which really moves at an interval of every 6st frame, so for 1s you have 4 keyframes to set for the desired joints to animate. All depends on how you want to interpolate the keys, the more the smoother/preciser your animation will be.

    Once done, select your mesh & export it as usual in ase format. With the Max Racer script, export the skeleton which becomes a Dskeleton ASCII file.

    Open Modeler, load ASE file, check Information for your textures, edit name if needed & go to animation. Load skeleton (Dskeleton file exported from Max) & execute "Reduce Tracks" which will get rid of the root joint.

    If the whole animation doesn't loop perfectly, cut it (Add button to add a new sequence & choose the start & the end frames in both input boxes). Remember the index number after your sequences names, that's the number to use in car.ini pilot {}.

    In car.ini, create :

    In steer_seq, put your sequence number index from Modeler Animation.
    In steer_range, I've put -900 for a driver hands sequence that animates from the left to the right in the pilot position view (+Z).

    Lastly, compile your material file (car.shd) & implement the standard_skinned_f.cg & standard_skinned_v.cg as follow :

    A big thx to Mitch ! :redface:

    Few ideas for future implementations :

    steer_left_seq=
    steer_right_seq=
    steer_idle_seq= (pilot fingers moving slighty)
    steer_speed_factor=

    For nice drifting pilots anims, we would need something like : (in case we steer quicker ? => some listener to set in code ? )

    steer_360_seq=
    steer_180_seq=
    pedals_throttle&brake_seq= (lol this one...the feet would push both pedals)

    if shiftmode=manual
    then :

    In case we have semi-automatic :

    shift_manual_up_seq=
    shift_manual_down_seq=

    and

    gear_1_seq=
    gear_2_seq=
    gear_3_seq=
    gear_4_seq=
    gear_5_seq=
    gear_6_seq=
    .
    .
    shiftspeed_factor=

    throttle_seq=
    brake_seq=
    handbrake_seq=
    clutch_seq=

    pedals_speed_factor=

    or :

    throttle_speed_factor=
    brake_speed_factor=
    handbrake_speed_factor=
    clutch_speed_factor=

    idle_pilot_seq= (when he/car stands still => fingers slightly moving)

    if we simulate our steering wheels (G25/G27) ingame, we would have 2 red buttons to be mapped :

    nos_seq= (we would need a new "nos" particle system + sound + texture) => finger animation
    nos_speed_factor=

    starter_seq= (left red button on logitech wheels) => left finger animation
    starter_speed_factor=

    Maybe putting the steering wheel in pilot {} + the e-shifters to align everything easily ?
    About Racer limitations of bones, I would increase to 75...2 hands with 3 bones per finger is already 30 bones, so not much place remaining for the rest.
    The max script could be updated to convert quicker, same for Modeler Animation when encoding the animation in binary format (anim).

    Maybe a easy new feature to implement like DIRT2 :

    copilot {}

    in animation :

    inrace_seq=
    idle_seq=
    speed_factor=

    We could even go further & apply the same to the entity passengers {} where there would be model0, model1, model2 with the 2 same props of copilot etc.. in cases like buses, with the new traffic feature coming out soon, that would be perfect. :)

    Also, we might need some kind of visual debugging ingame (wireframe & wireframephys don't work) for checking bones, normals, skinned mesh !?

    Hope it'll help !
     
  2. Thanks for the info QDM/

    What about the driver 'flips the bird' as u pass a car or increase position in a race?
     

  3. Might be difficult for him to drive waving his hands like that...
     
  4. Thanks !

    enable this in racer.ini
    gfx.show_car_bbox=1

    Now you should be able to see the bones !

    Cheers
     
  5. @DavidI

    With skeletons & scripts in Racer, almost everything is doable. I'll try to create the pits guys, the babes on start, the track peops dynamically showing the flags (yellow, etc...) & lots of other stuff, like moving clouds, moving water...etc...Lots of ideas which could then be triggered as desired.

    @Mitch

    Yeah you're right, I just found out it yesterday & I'm glad we have some kind of a visual debug of our created skeletons. Thx for enhancing the features, the limit of 75 instead of 50 bones/joints per character is really great :)

    @all

    Here's some proof pictures :

    [​IMG]
    [​IMG]

    I didn't make the fingers move yet (just in my 3D app), so that's something I'll try along with the moving eshifters...
    In the pictures you can't really see, but the skinned mesh was somehow vertex weight painted, so deformation of the pilot body interpolates quite nicely...

    Tough work guys to get good results, but once done, that should bring Racer to a new level of realism :wink:

    +++++++++
    Issues :
    +++++++++

    In garage, the helm is offset (in +Y) & the driver hands are in their original position (1st frame of the steer_seq, so in my case at the extreme left) but once ingame everything working fine. So maybe, we could have a special sequence when the driver waits in the garage.

    Tested with a G25...
     
  6. Ah I forgot to tell, for sure, if you don't want to have the head moving internally by Ruud/Mitch code (like explained in racer.nl), you could integrate & animate the head along with your hands/fingers.

    I found out the head/helm is moving/rotating around his CG/PP around of 20° max. so be careful, just to avoid interpenetration/overlapping of meshes...

    In my case, I've checked it prior of exporting my stuff, so I've just offset the head a bit further in +Y direction & made the driver neck longer to avoid gaps where you could 'theorically' see through it once the helm is rotating.
     
  7. ....
     
  8. Shifting into/out of Reverse/Neutral prompts the wrong shift animation.
     
  9. Interesting stuff !
    Apart from that, does it blend the sequences well ?

    I mean it should theoretically be able to shift & steer at the same time, for now I just exported the steering wheel animation, so will try the rest which request some work, this time I'll use some constraints & other tools to work quicker & preciser...

    ======================
    When looking at the 2 pictures, you see something strange...the joints direction/orientation on the right body part isn't symmetric...I executed a "mirror joints" function from the left part so I had only to model ~20 joints, still it doesn't look right in 'show carbbox' !

    idk doesn't seem to be a "real" issue since it's all animating as wanted.

    Will do some more testing & report back here..
     
  10. Mirroring in studio max is evil ... i don't know if that ends up going well ..

    I prefer using character studio plugin for studio max, which is installed by default in studio max..
     
  11. Thx Mitch will try it later !

    Was also re-reading the racer.nl docs, it stated there :

    Body mass The setting body.mass indicates the mass in kg. Note that the engine weight is added (engine.mass) as may others (a driver for example).


    So just adding a mass prop is possible ?

    Could be kind of cool seeing a 200 kg driver which balances the whole "chassis" to the driver side...:)
     
  12. Now if some one would make an exporter for Blender then animations would be easy. Especially with the use of makehuman for people.
     
  13. Boomer, tell me if you have special requests for characters & animations, I'm creating/preparing some cool stuff, hehe !

    =================
    Is there a way to align correctly the pilot in the garage ?
    I have a pilot, but didn't really append him in my body.dof, as it should be in theory...
     
  14. Creating objects with bones that can be animated are quite easy with Blender but there isn't an exporter that will do the same as Max. one is deperately needed. a good Python programmer could probably make one in less than an hour.

    Thanks for your offer QuadCoreMax.
     
  15. PM sent to my older Mel/Python coders, who knows.....
     
  16. Thanks QCM, I'll keep my fingers crossed.
     
  17. Hi there. I've been playing around with driver animations, and I found some interesting stuff:
    • My steering animation is from full right lock (frame 0) to full left.
    • You only have to animate half the shifting motion. Just pulling the paddle shifters, the game automatically plays the sequence in reverse to release them.
    The thing that really bugs me is that the shifting sequence is played after the actual shifting. So far, the only solution is to minimize the shifting delays (from engine.shifting) and set your sequence to be played at insane speeds. Which, in my case, trying to simulate a manual by putting the right hand onto the shift knob, looks silly.