Page 1 of 2

IQM and animating on the QC side

Posted: Mon Oct 25, 2010 6:19 pm
by goldenboy
Stupid question: When using IQM instead of .mdl (say, using darkplaces), does the animation stuff in the QC look any different?

Has anyone actually tried this?

Posted: Mon Oct 25, 2010 10:23 pm
by Handshakes
I wondered about this as well. I was going to experiment with it when I had a little time off to see how it works.

I'm getting really tired of putting up with Quake mdls and all the bother that goes with them, so iqm sounds great to me (in theory).

Posted: Mon Oct 25, 2010 10:29 pm
by scar3crow
I gotta admit, I love the thought of per frame bbox settings...

Posted: Mon Oct 25, 2010 11:42 pm
by goldenboy
Do I do this:

$frame shotatt1 shotatt2 shotatt3 shotatt4 shotatt5 shotatt6

void() player_shot1 = [$shotatt1, player_shot2 ] {blah};

or something else?

Maybe we could also compile a list of pros and cons of .mdl vs .iqm for use in a Quake 1 mod.

Posted: Tue Oct 26, 2010 12:02 am
by leileilol
Skeletal formats benefit from having lots of frames. Use framegroup files to take advantage of it for better animation. It works best with CSQC.

Read dpextensions.qc down to the FTE_SKELETON_OBJECTS stuff to get an idea what awesome skeleton objects can bring you

Posted: Tue Oct 26, 2010 1:44 am
by Spike
You can use IQM/ZYM/DPM/PSK/etc the same way you can use MDL/MD2/MD3, yes.

Framegroups arn't supported by all formats, but anyway...

The major advantage of skeletal formats is how they can be blended. And the only sane way to blend sequences is from the client (read: csqc) - this is the only way to twist stuff at the hip.

So you can use them the same as mdl, but if you do the only advantage of skeletal formats is editor support or file/mem size.

Posted: Tue Oct 26, 2010 1:45 am
by leileilol
Spike wrote:The major advantage of skeletal formats is how they can be blended. And the only sane way to blend sequences is from the client (read: csqc) - this is the only way to twist stuff at the hip.
So far from my efforts, this is a myth at best... :(

Posted: Tue Oct 26, 2010 2:13 am
by goldenboy
Spike: That clears up a lot of it.

If Irritant reads this, I'd like to hear his opinion on IQM vs. (was it .md2?) based on AlienArena's IQM use.

Posted: Tue Oct 26, 2010 2:49 am
by goldenboy
leileilol wrote:Skeletal formats benefit from having lots of frames. Use framegroup files to take advantage of it for better animation. It works best with CSQC.

Read dpextensions.qc down to the FTE_SKELETON_OBJECTS stuff to get an idea what awesome skeleton objects can bring you
OK, I read that.

Right now I can't see how this would be useful to what I'm doing, which is making pretty typical monsters. Maybe I'll be enlightened at some later point.

It's cool that you can do something like that, animating models clientside while the game is running, but I don't see the big advantage over creating the animations you want in Blender beforehand and then simply running those.

Practical examples of awesome?

Posted: Tue Oct 26, 2010 11:29 am
by Spike
twisting at the hip, so the legs always move forwards while strafing.
tilting the torso so your toon can aim up and down.
doing both at the same time.
running while shooting. shooting while standing.
using the same skeleton for details like hats/armour(or like in doom3 - heads).

for monsters, maybe only the last one is relevent. depends how awesome your AI is. :)

theoretically as you have direct control over the bones, you can use twig or something to create ragdoll too, though I'm not sure if this is practical or not due to the extra overhead.

Posted: Tue Oct 26, 2010 1:36 pm
by Irritant
goldenboy wrote:Spike: That clears up a lot of it.

If Irritant reads this, I'd like to hear his opinion on IQM vs. (was it .md2?) based on AlienArena's IQM use.
Well .md2 was just horrible for animated meshes(it's fine for static).

You can see the difference between the two formats here, with the .md2 having horrendous vertex deformation:

http://offload1.icculus.org:9090/aliena ... cs/iqm.jpg

The other advantage is, as mentioned, with a skeletal model you can do nice animation tricks, like bending and twisting at the waist:

http://offload1.icculus.org:9090/aliena ... mbend2.jpg

Lastly, with skeletal models you can do much cooler things such as ragdoll physics:

http://www.moddb.com/games/alien-arena- ... 2#imagebox

Posted: Tue Oct 26, 2010 5:50 pm
by goldenboy
So

A) it's a superior format - what Irritant (and others) said (vertex drift, loss of precision) seems to point in this direction? Requires IQM support in engines, though.

B) several parts of the skeleton can be animated by different parts of the gamecode at the same time, using different animations - strafing and looking and shooting for example, and this is done in CSQC?

Without needing to actually animate all these possible combinations in Max/Blender, just the basic movements (strafing, looking, shooting)?

This might be nice for player models (multiplayer) or things like strafing grunts, or certain monsters walking and attacking at the same time. It requires CSQC support first, though :-/

Even if this stuff isn't done *now*, someone may want to add it at a later point so having the support might be a good thing.

C) direct control over the bones allows ragdoll physics using TWIG or maybe ODE?


The net gain from this seems to be a more modern model format with the potential for more complex animations and physics.

In Quake, works like .mdl, but CSQC required for the anim tricks, some sort of physics (twig, ODE?) required for ragdoll, and IQM support required in engines.

So it has a lot of potential, but also some steep requirements, which atm only Darkplaces provides. The steepest one is CSQC.

That about right?

Posted: Tue Oct 26, 2010 6:03 pm
by Irritant
You don't need CSQC to animate, remember Alien Arena does not use Darkplaces and is not based on Q1 sources. Everything is done in the renderer, with only minor information passed from the client.

I'm guessing darkplaces does this in CSQC to give modders more freedom.

Posted: Tue Oct 26, 2010 7:27 pm
by goldenboy
I see. I assume Spike was talking specifically about Quake when he said
The major advantage of skeletal formats is how they can be blended. And the only sane way to blend sequences is from the client (read: csqc) - this is the only way to twist stuff at the hip.
What do engine coders think - is IQM loading easy enough to implement in Quake engines to allow for a broader support, if a mod actually goes and uses IQM?

Posted: Tue Oct 26, 2010 11:33 pm
by Spike
regarding animation, at the end of the day, you need multiple frame sources on a single model. you need legs animation, torso animation, torso twist, torso pitch, some way to say where the legs end and tosro begins, head tilt, head twist, mouth maybe,
And once you have all that, you're maybe on a par with halflife. The original one.
You can either code those in specifically in your protocol, or you can get client-game code to do it, or you can write the values directly into the engine, if your engine is to only ever run a single game/mod.
Or you could send the entire skeleton over the net every frame, and thereby limit yourself to 4 players max.

ragdoll is a much more complicated beast.