1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Animations Dynamics & Physics

Discussion in 'Racer Physics and Technical' started by QuadCoreMax, Mar 19, 2011.

  1. Hi everyone,

    Feel free to discuss everything concerning dynamics, physics & accurate animations, & all the stuff which belongs to it, like the skinned shader for example.

    Took that from the video thread :

    Thx Mitch for making a little demo !
    Ok, so these last days I'm making some "heavy" tests on skeletons/physics & all that stuff...still lots of questions on my mind !

    Could you show us how your geometry file + your special ini file looks like & what exactly you've done to get that animated skeleton collide with the car ? For now, I got some error trying to do the same as you did...

    Looking your movie, that guy gets 'skeletaly' animated & then collides/interacts like a ragdoll, once hit, the animation stops & Racer physics engine simulates the collision... that's so cool !!!

    Tracked 'Physics' tab issue :

    "Failed to load bones & animation for this mesh"
    Even though, I have everything ready, tracks reduced, anim file which go with it, etc...

    What's the trick ?
    Need my new 'sweet' babes to get hit when they're shaking their asses along the track , hahha !

    [​IMG]

    ~ ANSWER ?

    The trick is the skeleton need 'theoretically' a closed/solid mesh to own a pSkeleton, that's what Modeler will tell you, if you don't do as expected. Still, you could smooth bind a solid mesh but with some other mesh which have been 'combined' to the solid skeletal mesh, but which aren't closed/solid at all !!! (remember that)

    In this case, Tracked won't find or won't be able to build a 'physical mesh' which is typically used to do proper collision simulation, so that's the case actually, with my 'real palm trees' which are now simulating wind in the scene, still they could be 'automatically' or 'internally' processed by Newton engine to shake accordingly by a tweakable x/y/z wind variable in special.ini + some other wind related params, but which don't 'own' a 'physical proxy mesh', that's how it's generally called in game engines. So I just drive thru them for now.

    That kind of thing, doesn't happen with a simple sphere or box (movables), where in Tracked, you easily attribute the collision/physical mesh to your object (I generally just smooth bind it with a single bone in the middle of the sphere), actually only 2 col meshes scalable are available in Tracked :

    0. no mesh / no col
    1. box
    2. sphere

    What I haven't tried, (must do) is to animate the sphere (simple just for testing purposes before integrating something more complex) in 3D & then collide it in Racer to get the results you showed us, so when hit, the simulation takes place (ragdoll/bones) & animation is 'automatically' stopped...?!
     
  2. Don't know exactly why, done a quick test & I have a recurrent error from Tracked now :

    Code:
    OS-Version: 5.1.2600 (Service Pack 3) 0x100-0x1
    
    0x6A1C50C0 [cg]: (filename not available): (function-name not available)
    0x6A022DAF [cg]: (filename not available): cgSetEffectParameterBuffer
    
    In geometry.ini, what exactly those 2 variables do :

    Code:
        type=
        trans_movable_to_zero=
    
    If I set manually type=0 & trans=1, I got for example my movable which behaves almost correctly (we would need real 'rigid body' props in the near future ~ friction, bounciness etc..).

    For my babes + test tree (both animating/looping perfectly => 1st + last frame = same 'keyframe') I got type=4 & trans=0, but they don't collide.

    Tried to play with both variables, still I actually can't get the best of both worlds, as you showed in your movie, because of the output/error Tracked sends me....hm

    Want to know more about limitations also :

    - max. nb. groups
    - max. nb. of sequences in 1 dof

    Last thing about the 'Freeze Initially', if somehow we could use a command to set it, I originally (in CrytekEngine 2) used it a lot, could be useful to let the gravity distribute 'flying' stones in the map 'randomnly' since the physics engine never produces the same scenario, we would have at each track load a different looking map.
     
  3. Sure wish I could get animated objects exported from Blender, as I now have several people ready to go. I have exported a person, mesh, and it was placed on carlswood. When hit he fell down but I don't have an ecporter for the animation.

    Where is Brent Burton when he's needed?
     
  4. I feel you boomer, I tend to build the whole in Maya & from there export as FBX to 3DS Max etc...which isn't optimal too as Mitch suggested from my debugged bones view...

    I bet there are some peops out there (official forums of Blender ?) which could theoretically build an exporter, that's what happened when I was modding for Crytek back in the days....I was a 'kind' of pioneer in this domain which wasn't that easy at the end, still I had 2 real nice Pythons/Mel programmers who helped me out & the crymod community with their awesome Maya Crytek plugin...(MayaCGF) & yes the same existed also for Blender from what I recall.

    I really hope we get all kind of plugins from all known 3D apps soon ! Believe me, I'm tired not having all the tools to create quickly for Racer...

    Ah yeah before I forgot, the obj format in Modeler could be the solution to any of our actual problems, I guess you can export that format from it ?? as many does, same goes for Collada which is one of the most known formats too....:frown:
     
  5. Thanks for the reply QCM. If I could learn how to write a script in Python I would, tried it once but got all confused. the only programing language I have used is Basic, but that is no longer available or useful.
     
  6. Perhaps QCM could tell me what the "VERTCOUNT" refers to in the .DSkeleton file.

    135 what, vertices of what or just what are they refering to in the danceguy animation object.

    Thanks for any info you can provide.
     
  7. yeah that refers to the nb. of vertices in your skinned mesh. My 'new' babe has ~ 4K & will be introduced in Racer soon...This time, she looks even wilder...:)

    The actual problem is the bikini & hair, like I said somewhere, exporting her 'nude' works, but not the other way...I'll recheck the whole soon !

    [​IMG]
     
  8. KS95

    KS95
    RACER Moderator

    Lmao nice.
     
  9. QCM,
    The number of vertices in the dancegut animated object is more than the 135 that is listed in the .DSkeleton file. I'm quite sure that the number of vertices is higher but will check again.

    That is why I asked about the value reference, it didn't match. I sent a PM to MitchVL and an e-mail to Ruud but got no response.

    Like your model.
     
  10. Hey Boomer,

    VERTCOUNT refers to the number of vertexes in the mesh. Just as easy as that.
    135 should be about right for the danceguy.
    the number of indexes is obviously higher (faces*3).
     
  11. Hey, another country heard from! I thought you had died and gone to that great racetrack in the sky, MitchVL.

    I rechecked the dance guy mesh and found that it had double vertices so removed doubles and lo and behold there were 133. Don't know where the other two are that are listed as 135 in the .DSkeleton file.

    I have been trying to learn Python so that I can make an .DSkeleton file exporter for Blender but have all kinds of problems learning Python so it will do what I want. I cna get Python to write to the Blender console the top 3 or 4 lines but not to a file.

    If anyone knows a Python programmer that can help it would be appreciated.
     
  12. Have you looked at Brent Burton's original DOFfile.py for clues about writing files?

    Also there is a Blender 2.5 exporter for Unreal engine format .psk and .psa files. Is that similar?

    Could you post a .Dskeleton file or its contents here

    Two "emptys" parented to a couple of extruded verts?
     
  13. Thanks radome for the info on the two missing verts which is probably them.

    The .DSkeleton file for danceguy is over 3.5 mb but I can post a condensed version I'm using as a guide for the items to put in it. I'll post it tomorrow night.

    I'm making progress with the Python script and can now generate the lines down to the bone info which I have got to figure out how to get and write to the script file.

    The framerate value was a real pitb to get until I used goggle to find the way to get that value.
     
  14. Great! Thanks.

    I was looking at the modeler.exe program from racer package and the Animation radio-button brings up a panel with a "Load Skeleton/Sequence" button. Since I'm not actually testing something, clicking the button produces error messages referring to pSkeleton.
    e.g. "Model must be one solid mesh to be able to own a pSkeleton"

    Is:
    a) this pSkeleton use deprecated/invalid now with respect to the danceguy animation?
    or
    b) do the terms .Dskeleton and pSkeleton refer to the same "thing"?

    If "b" is true, how similar is this .Dskeleton/pSkeleton object to the .psk file of the unreal engine?
     
  15. Haven't looked at anything referencing a pSkeleton so will have to check it out.

    Is there any info on www.racer.nl about pSkeleton?
     
  16. Thanks Boomer,
    Yes I've been digging around a little, and after reading your last post i stumbled across the Animation Tutorial containing the entire .Dskeleton file. Therefore, don't bother posting the .Dskeleton fragment.

    The .Dskeleton IS NOT the same as a .psk file

    I was able to get the ASCII Scene Exporter For Blender 2.56 from Richard Bartlett to be an add-on in 2.57 with some minor modifications.

    I'm aiming to use the macro in the racer/max folder as a guide to allow me to add the .Dskeleton file export function to it.
     
  17. radome,
    That macro in the racer/max folder leaves a lot to be desired. I'm using the danceguy.DSkeleton file as a guide to the items required for export and am making very slow progress as I'm not a programmer type. It took me almost a week working with Python to get the framerate value to export to a file. I'm working on the bone info now.
     
  18. I have forgotten whether the 2.4 version Blender had a tool analogous to the V2.5x datablock explorer on the Outliner window, and/or the built-in python console. I've found that these features really help to make python development easier. Come to the dark side.:D
     
  19. I think the Outliner window does have a datablock explorer as I've looked at everything in a Scene which is the first item in the Outliner and everything else is a subset. It's built-in Python is not a complete version so I downloaded Python and installed and it allows scripts to run very nicely.

    I'm making more progress. All I need to know now is:
    What is the Bipo1 referencing?
    What does the *MESHVAME Box 02 refer to?
    What is the rotxyzw refering to?

    Any idea? Then I can complete the Exporter.
     
  20. format "\t*BONENAME %\n " (skinops.GetBoneName skinmod bi 1) to:nfile

    It's "skinmod"? or "bi"... Maybe the name of the armature? Because the armature MODifies the SKIN??

    *MESHVAME Box 02 refers i think to envelopes or groups of verts influenced by the particular bone.

    ROXYZW is a (flipped) quaternion describing the axis (XYZ) about which the bone rotates and amount (W) of that rotation