Realistic Vehicle Simulation / Animation

Hi everyone! For a long, long time I’ve been wishing that I knew how to create REALISTIC vehicle animations in Blender. Something similar to the Craft Animations plugin-ins would be ideal, where we could just setup our vehicle and environment, and control the animation in real-time with a controller.

I’ve seen plenty of videos of vehicle physics in the game engine, and I know you can use controllers such as the Xbox controller as an input device. The only downside I have found is that you can’t record the animations of everything, because my ultimate goal is to have vehicle animations that I can build upon and render out for short films.

Then I saw these posts and became very excited:
http://www.blenderartists.org/forum/showthread.php?301278-Record-100-Animations-in-BGE
http://www.blenderartists.org/forum/showthread.php?302260-Photo-realistic-Car-Animation-with-Cycles

But, I never received a response from the poster. So, I’m back to the same point. Does anyone know how it would be possible to record EVERYTHING in the game engine, or perhaps an alternate way to create believable vehicle physics? I have seen many tutorials that show how to rig a vehicle, but the manual animation required is very heavy. For example, the suspensions may move, and wheels do not go through the ground, but the rest of the vehicle doesn’t react as it should. And that is just the basic stuff!

I would love to be able to control a vehicle the way I can in a video game, and simply record multiple “takes” until I have a performance I’m happy with, and have the program do the heavy lifting of simulation for me. Even something simple like Phymec’s video below would be a Godsend:

I have not been able to find out how he did it. For all I know, he was using a physics simulation. But back in Blender 2.5 that was only accessible through the game engine, so what is the secret?

If anyone has any advice or hints, please share! I’ve been trying to find a solution for so long.

I recently began making a 6dof simulation in the game engine,

Can you apply torque over in the BGUI side of things?

the front wheels need more “linkage” but it’s a place to start

Attachments

TorqueMobile(SpindelCorrected) (1).blend (582 KB)

You mean: Game menu > Record Animation, checkbox? Should work for vehicle simulation.

BluePrintRandom- Thank you for the reply, I’ll check out your .blend file as soon as I’m able to get back home and sit down at my computer tomorrow!

Loyhogg- That is what I thought, as well. However, when I have tried this on various types of vehicle rigs, the animations are not recorded. It seems that certain things cannot be recorded in the BGE by default. Quoting suatcagdas from one of the threads I posted above,

" ‘BGE Record Animation’ function is limited (its not for; child objects, no assigned physic objects, cameras and wheels with using bullet vehicle wrapper) so I wrote two small scripts (physic to txt - txt to anim) for recording all animations in BGE"

Unfortunately, I have not been able to receive a reply from suatcagdas. It is possible he simply posted the two threads and never returned to check comments.

Does it seem like a difficult task, to create a script to record all the required object animations?

no, you just need a method to store and recall the data,

so the bge needs to edit a text etc. and add in a list for every frame of your “debug” properties

or add keyframes every frame, which I think you can do with python.

also, your going to do a cycles render when your done collecting the data?

You’re correct, BluePrintRandom, I’d like to render the recorded animations with Cycles.

I’ll be honest, I have very little experience in the BGE, and no experience with coding or creating scripts. I’ll admit, I can’t understand the information in your last post. My only experience with scripts is running them.

My goal is to have an easy way to record all the information needed to render out vehicle animations (of course, there are many other uses for such a tool). Additionally, I would like for all other Blender users to have access to the script(s) as well. I would prefer for the tool to be as simple to use as possible.

Do you think this is something that can be done with a single script? Or are two required, as suatcagdas used? It would be great if a solution could be provided voluntarily by someone (basically, for free), but if required I am more than willing to create a thread in the “Paid Work” section and see if that attracts any attention. Having such a feature in Blender, available to everyone, would be great.

I am going to need a little help integrating this myself,

AceDragon or SolarLune or agoose are a good bet,

I just dug up the script, but it most likely exists somewhere already on the forum,
I’ll poke around (people have done this before with things besides cars)

http://vimeo.com/23562207

My car is rigid bodies, so you could use this I think as there is no parenting of the physics objects

Edit:It works, just hit “record animation” in game tab, drive and then you have the data from that drive,

you’ll need to add more suspension components and armatures or more RBJ’s to drive them etc :smiley:

(to be completely realistic)

/uploads/default/original/3X/8/2/82115daa356fa1d95b86b580a37b826e4a2a78a8.blendd=1381215919

feel free to use the rig, just credit me in the credits :smiley:

I should make a tutorial or two…

That’s really cool, you’re right, I tried it just now and it works. I will try out your rig some more.

And you’re right, you would want to add a suspension to make it more realistic. The car is also a bit slow, but maybe that is a very simple setting to change. Have you seen believable suspensions made using rigid bodies in the game engine before? I’m not sure how they would be setup, but if you’ve seen it done, I will gladly begin testing.

And rest assured I’ll be crediting you! I appreciate all the help you’ve given me so far!

I will be honest, though, I would still prefer to have a way to record anything in the game engine, instead of having to find workaround to accomplish recording of only certain types of object. I will set about to messaging some people to see if I can find additional help to complete this task.

Unless you do plan on making a tutorial! If I can understand how your rig works, and how to adjust the settings to create more believable vehicle animations, that would be great. Then I would feel confident enough that I could create other vehicle rigs, based on your concepts. At the moment, the car in your blend file is a little bit glitchy and jumpy at times, so that is my only concern.

I’ll write a tutorial :smiley:

I should do that with my TorqueRig walking torquebot as well…

I can also explain anything you can ask,

the most complicated thing on that rig is the spindles and the script I used for that is part of project Wrectified, and is MIT 3.0 cc just put it in the credits :smiley:

the suspension can all be driven by setting up the wheels right, and using there centers as targets for IK chains,

You can “simulate” springs, and all kinds of things by applying forces, or torque, and using RBJ’s

like a spring is just a RBJ object that is confined on all axis but 1 and limited on that axis, with constant force applied :smiley:

That’s great! I feel very optimistic about using an approach like that now! And I’d love to read a tutorial when you’re able to create one. In the meantime, I’ll begin testing out setups and report back progress as I make it. I should have more time to do so within the next week or so, currently I’m finishing up a video for my YouTube channel.

By the way, I just noticed you have your own channel! I’m watching some of your videos now, they’re great!

Thank you

I have been wanting to do some actually length tutorials, but I usually don’t have more than a 15 minute to 1 hour window on the computer, and it’s hard to get much done.