View Full Version : Non-skeletal animations
GM_Kombucha
06-12-2007, 10:55 AM
We're trying to put a waving flag in one of our maps, and are sort of stuck. I couldn't figure out how to do this using Source's physics engine, so I simulated it with Havok in 3DS Max. Unfortunately, this is not a bone animation, so I don't know how to get it in-engine. Is it possible to use regular keyframe animation in Source? Or to somehow convert this animation to a skeletal animation? Or are there other options to create an animated flag?
Thanks!
Marine
06-12-2007, 11:51 AM
I dont quite know what you mean by bone animation, but i've animated things just using objects (naming them), and moving them around (Using Keyframes). It should work :)
GM_Kombucha
06-12-2007, 02:40 PM
How do you export it? I tried it as both a reference and a sequence SMD the former had no animation when previewed while the latter had ten frames of nothing.
Also, I'm deforming a single mesh, whereas it sounds like you were moving them around without changing them.
Superpiccolo
06-14-2007, 07:24 PM
There are only 2 ways to animate anything within the Source engine as far as I understand it.
1. Skeletal based animation - Using a rigged & skinned model with bones i.e. Characters, animals, weapons (Basically everything is animated with skeletal animations)
2. Flex animation - Using vertex positions based off blendshapes defined in you anmation tool (Max, Maya, XSI). The only things that I am aware of that uses this is facial animation for characters. I am sure though, with the proper coding and QC files you could animate other things using this method.
Note: The game "Vampire: The Masquereade - Bloodlines" is a Source based game and it actually has an in built physics animation system (Boobs/skirts/coats bounce/swish).
GM_Kombucha
06-14-2007, 09:15 PM
Interesting... I searched and searched and couldn't at all figure out how to enable cloth simulation in-engine... it seems like it'd take a good amount of coding to get it to work, but interesting to know that it's out there. I'll take a look at the flex thing... any idea how one would export that from Max?
Marine
06-15-2007, 12:12 AM
yep, just export the reference SMD, and then export a skeletal animation (to animation SMD). Set that one to the idle sequence, and it should work.
Superpiccolo
06-15-2007, 12:29 AM
To export a flex other than a facial expression set would be tricky. To do it for facial though, you do it like this (for Maya):
Create 34 facial blend shapes matching (relatively) to these:
http://developer.valvesoftware.com/wiki/Character_Facial_Animation_Shapekey_Set
Then put all 34 shapes on your base mesh.
Now create an animation timeline that is 35 (0 - 34) frames long, and on each frame have 1 blend shape. (on frame 0 have your base mesh, then on fram 01 have the BS that is 01 according to the above link). Once you have all your blend shapes on each frame, export a VTA from Maya using Pralls tool (which takes an ???? load of time, ~2-3Hrs) and you should get a working VTA file.
Now creating that file is only half of what makes the facial expression work. You also need a bunch of other files that actually interpolate your VTA info into a working set Flex sliders. (These files are contained within the SDK).
Varsity
06-15-2007, 03:08 AM
Take a look at the flags in DOD Source.
GM_Kombucha
06-15-2007, 09:10 AM
Oh wow, thanks for the help guys. That all seems quite complicated, especially since I'm not a Maya man.
To Marineio - wouldn't the skeletal animation actually need bones to function? Or are you suggesting there is an easier way to do this, not with Maya but with Max?
To Varsity - I don't own DOD:S, but do you know if I did, if I'd be able to replicate the effect with the SDK and use it in HL2? Or do you have any idea how they are done?
EDIT: I found a trailer for DOD:S, the flags aren't wonderful but I think that's the route I'd like to take if it's available. Any more info on how we could implement that?
:D
prall
06-15-2007, 09:23 AM
@ superpiccolo: it shouldnt take that long to export vta
@gm_kombucha: forget the vertex animations....just give your flag some bones and animate them....with smooth skinning it should give a nice wave effect....for smaller ripples you could add a animated normal map....i use maya so i cant tell you how to do that in max but it shouldnt be too complicated
GM_Kombucha
06-15-2007, 02:49 PM
That is a valid idea, except that I've spent days now playing with cloth simulation and I really enjoy it. But you raise a really good point, in that if I'm going to do a simple animation anyways, it'd be better to do it in Max than in Source. I like your thinkin'...
GM_Kombucha
06-15-2007, 06:01 PM
Well, out of all of my options, some clearly more efficient than others, I decided to try my hand at making the flag a ragdoll to be simulated in-engine. I've had pretty good luck so far, it's in-game and responding somewhat, although it seems to be moving at like 1-2 FPS, even though there are only 5 bones in the whole thing. Any ideas why it's seemingly so resource-demanding?
Superpiccolo
06-18-2007, 06:24 PM
@PRALL
Well I don't know what to say. They do take that long. They work fine so its not that big of a deal. I've done it 3 times so far and all 3 times it has exported and functioned perfectly.
@GM
Ragdolls shouldn't be that slow. Post all your QC files.
How are you planning on having the ragdoll wave in the wind? (If you're not going to animate it by hand that is).
GM_Kombucha
06-19-2007, 10:58 PM
Here's the current .qc, although I'm not sure it's an issue, I'll have to keep an eye on it...
$modelname "flag.mdl"
$cdmaterials "models/flag/"
$surfaceprop "carpet"
$keyvalues { "prop_data" { "base" "Cloth.Large" } }
$scale 1
$body studio "flag_reference.SMD"
$sequence idle "idle.SMD" loop fps 1
$sequence ragdoll "ragdoll" fps 1 ACT_IDLE 1
$collisionjoints "flag_phys.SMD" {
// Mass in kilograms
$rootbone "1"
$concave
$mass 5
$inertia .50
$damping 0.01
$rotdamping .3
$jointconstrain 1 x limit 0.000000 0.000000 1.000000
$jointconstrain 1 y limit 0.000000 0.000000 1.000000
$jointconstrain 1 z limit 0.000000 0.000000 1.000000
$jointconstrain 2 x limit 20.000000 20.000000 1.000000
$jointconstrain 2 y limit 20.000000 20.000000 1.000000
$jointconstrain 2 z limit 90.000000 90.000000 1.000000
$jointconstrain 3 x limit 20.000000 20.000000 1.000000
$jointconstrain 3 y limit 20.000000 20.000000 1.000000
$jointconstrain 3 z limit 90.000000 90.000000 1.000000
$jointconstrain 4 x limit 20.000000 20.000000 1.000000
$jointconstrain 4 y limit 20.000000 20.000000 1.000000
$jointconstrain 4 z limit 90.000000 90.000000 1.000000
$jointconstrain 5 x limit 20.000000 20.000000 1.000000
$jointconstrain 5 y limit 20.000000 20.000000 1.000000
$jointconstrain 5 z limit 90.000000 90.000000 1.000000
}
Also, I guess I assumed there was a wind function of some sort that would work perfectly... not so much? If it has to just hang there, so be it, but that sort of defeats the purpose... I'll see what Hammer has to offer. If you have any ideas, that'd be wonderful.
GM_Kombucha
06-24-2007, 07:19 PM
Well I got stuck, I don't really know what to use for wind. I don't understand if env_wind should be working or not, nor how to use it. The only thing that seemed to somewhat work was a point_push entity, but I don't know how to fluctuate the magnitude to simulate a breeze. Any ideas? Thanks!
Superpiccolo
06-25-2007, 09:23 PM
You could a randomly changing set of logic entities. Each holding a certain value for the amount of force to output.
I'm not exactly sure how to do it, but I'm pretty sure it can be done.
GM_Kombucha
06-26-2007, 06:44 PM
Yeah I'm not sure how that's done, either... how to set the value for Push as the value of a logic entity... it was something I had thought about, I guess I should look into it more. Thanks!
Superpiccolo
06-27-2007, 10:56 PM
It's all pretty complex, but some logic entities can hold values within them, and then you can trigger those values at random times (not sure how to do random, but I remember reading about it somewhere).
I am by no means an expert when it comes to complex trigger scenes within hammer. Try looking around for good example maps to base you idea off.
kromano
10-31-2007, 03:26 PM
If your mod is an MP mod, ragdoll will respond too slow to be useful. This is because MP physics are coded MUCH differently than SP physics to conserve overhead/bandwidth.
Why not try creating a series of dummy bones along the flag and then move them around to as closely match the Havok simulated flag animation. You don't have to use bone objects, I've had a few work fine using dummies and the skin modifier.
If you set up the dummies in a little grid you can move portions of the flag around and create creases and whatever, etc and so forth.
Hmm, I also notice (now) that this is 4 months old so I wonder if you're even still working on the project. Oh well, I've gone to the trouble of typing this out already....
doublemint
11-03-2007, 05:16 AM
I was curios, with your Havoc simulation in Max, did you convert the simulation into keyframes?
ChewinFoil
01-25-2008, 03:04 PM
Looks like this thread has been quiet for a while but if there's been no answer... please allow a n00b to take a crack and suggest that $jigglebone might be the way to go. Trying to make a flag in CSS but had no luck yet.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.