Forum

skeletons, dp and qc?

Discuss the creation of various model formats for Quake engines, and related matters to modeling.

Moderator: InsideQC Admins

skeletons, dp and qc?

Postby something » Fri Nov 12, 2010 6:06 am

hey all,

im wondering if there are any easyily digestable examples of controlling bone rotation using qc?

(maybe this should be in quakec programming..eeek)

i currently have implemented a viewable body for the player where you can look down and see your feet etc.

and my plan is to implement it similar to how dark messiah works.

where you can turn but your feet stay in the same position while you turn until a certain point, where it catches up and rotates around.

i have this implemented atm. i have it so that the body keeps its angles_y(and only changes it when you turn past say 25 degrees)

what i would like to do is. make it so that the bones above the waist rotates to the same angles as the player.

could someone help with pointing me in the right direction. i have checked the dpextensions.qc and found all the bone sections. and have tried to just create a simple bone test to make the upper bone follow the view. but it doesnt do anything.

i used an example from
viewtopic.php?p=24861#24861

but it just didnt do anything.

i am probably doing something stupid.

it seems to need csqc. are there any examples of this in csqc available to view. if not could someone point me in the right direction for getting started properly in csqc.


-somepoo
Last edited by something on Fri Nov 12, 2010 6:40 am, edited 1 time in total.
something
 
Posts: 27
Joined: Tue Apr 20, 2010 2:02 pm
Location: Melbourne,Au

Postby leileilol » Fri Nov 12, 2010 6:11 am

I wish I knew. If I knew i'd help. I tried doing the same exact thing only just last month to failure.
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby something » Fri Nov 12, 2010 6:39 am

poop..

the annoying thing is. there is very little i can do to try and even expand on my test. because i cant even get any bones to be affected at all.

if at least i could make a bone do something.. or anything. then i could have something to work with.

the best i could do is create a turn left and turn right animation and set the frame based on the angle that the player is in relation to the body.
something
 
Posts: 27
Joined: Tue Apr 20, 2010 2:02 pm
Location: Melbourne,Au

Postby ceriux » Fri Nov 12, 2010 7:41 am

hmm sounds like it might be your best bet.
User avatar
ceriux
 
Posts: 2228
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Postby something » Fri Nov 12, 2010 7:49 am

what about action animations?
it would be pretty hard to get animations for firing and such. for each degree or rotation. grrplunk..

ill see what i can do..
something
 
Posts: 27
Joined: Tue Apr 20, 2010 2:02 pm
Location: Melbourne,Au

Postby leileilol » Fri Nov 12, 2010 7:49 am

Despite the examples in dpextensions.qc, secondary/tertiary/quaternary frames are never "sent" serverside. You can only ever EVER, EVER handle those on the clientside, and I doubt the bone functionality in csqc even works at all. I can't move a single bone or even do frame2 properly when I tried.

Yeah, that makes debugging even simple things like hitboxes on heads on turning torsos a total bitch. You can't ever see what the server sees on skeletons.
i should not be here
leileilol
 
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Postby Spike » Fri Nov 12, 2010 11:52 pm

Skeletal bone control only works in csqc, at least visibly. DP does support it serverside, but you won't see the results, its purely for interaction with hitmodels, or completeness...

csqc's frame2 is for lerping, rather than any proper bone control.
frame3/frame4 are hard to use for most purposes. Much easier to use a framegroup/sequenced animation, and to control its rate of animation with the frametime1/frametime2 fields.

Quick rundown of FTE_SKELETALOBJECTS which LH claimed to have added to DP:
1) Create a skeletal object that matches your model.
2) Assign it to your ent.
3) Call skel_build multiple times. For each call, first set up the model(index)/frame/frame2/lerpfrac/frametime1/frametime2 fields to match your animation.
3a) First call, give it a bone range for the legs.
3b) Second call, give it a bone range for the torso.
4) Apply any additional changes (like twisting at the pelvis to run a different direction) with skel_mul_bone (makevectors('pitch yaw roll') first!, these are relative to the bone's current angle!)
5) Once your entity is dead, don't forget to delete the skeletal object (a deleted skelobj is valid for the remainder of the frame).

Skeletal objects that are not implied by entity mean that you can attach a skeleton from a player model onto a weapon model, for instance. It might also help move an animation over to a corpse. But you do have to remember that skeletal objects are _separate_ state from the entitys upon which it is used.

It is possible to grab animations from one model and apply it to another, but your model's skeletons must match.

Note that with skel_build, you can blend in additional frames as you desire, over the bones you desire.

But yeah, requires csqc - you won't see jack shit with ssqc. Also requires models where you can validly specify a range of bones.

The ill-fated DMF mod was meant to be using some of this stuff to animate player models.
Spike
 
Posts: 2911
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby something » Sat Nov 13, 2010 2:40 am

thank you. i will try and get something moving in csqc
something
 
Posts: 27
Joined: Tue Apr 20, 2010 2:02 pm
Location: Melbourne,Au

Postby something » Sat Nov 13, 2010 7:32 am

arghghg!dsahl

well i got the body in csqc.
but now there is updating issues..

im going to continue in qc forum.
something
 
Posts: 27
Joined: Tue Apr 20, 2010 2:02 pm
Location: Melbourne,Au

Re: skeletons, dp and qc?

Postby jessetc » Sun Oct 09, 2011 8:33 pm

Where did you continue?
jessetc
 
Posts: 1
Joined: Sun Oct 09, 2011 8:30 pm

Re: skeletons, dp and qc?

Postby toneddu2000 » Tue Oct 18, 2011 9:48 am

I think that no one continued this thread. Sending skeletons to CSQC was started by behind_you but he left the forums. :(

Is it really so hard?
Meadow Fun!! - my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1388
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: skeletons, dp and qc?

Postby Spike » Tue Oct 18, 2011 10:00 am

its not that its hard, more that its futile. sending skeletons to the csqc is utterly pointless. it really fecks over any prediction code you might have, its bulky, etc. its much easier to send actions over to the csqc and then animate it in the csqc based upon those actions.
using skeletal objects in ssqc is pointless in all regards except for utilising hitmodel, which will never be entirely accurate anyway, and mostly just annoys people.

doom3 uses server-side skeletal objects and stuff. doom3 is limited to 4 players or something silly. doom3 also does it for consistant ragdolls.
Spike
 
Posts: 2911
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: skeletons, dp and qc?

Postby toneddu2000 » Tue Oct 18, 2011 10:58 am

Thanks Spike, every time you post something, I learn something!
I couldn't imagine doom3 used server-side skeletal objects.

its much easier to send actions over to the csqc and then animate it in the csqc based upon those actions.

Can you please roughly sketch how to do that or just post a link where someone did it? I'm creating (maybe it wont be never finished :) ) a guide about exporting and using hi-quality models and animations in IQM - Darkplaces and this could help me a lot in the programming section

Thanks
Meadow Fun!! - my first commercial game, made with FTEQW game engine
toneddu2000
 
Posts: 1388
Joined: Tue Feb 24, 2009 4:39 pm
Location: Italy

Re: skeletons, dp and qc?

Postby Spike » Tue Oct 18, 2011 12:12 pm

if the client is running its own animations, you can change the speed leg animations play at and stuff for decent mixing of legs and stuff, and you can do that based upon player prediction and other things, which is all still correct in shadows, mirrors and other reflections.
of course DP doesn't really do prediction with csqc-based players. You'll need to get LH to help you there.
anyway, if the client is animating the legs automatically based upon velocities and stuff (dotproduct the velocity against the forward/right vectors and you can get the distance moved in each direction), then you still need to know exactly when the player is shooting. if its a different player you have no choice but to get the server to tell you. if its the local player then you might try predicting it. which is awkward of course... at least if the server disagrees with the timings... anyway, if you have some field which states the current action or whatever, then you can trigger the start of firing animations, death, pain, etc based upon that field instead of using the server's .frame field directly. if you use events instead of descrete actions, you can have the player shooting while in pain and stuff.

But all of my attempts have been hindered by the lack of inverse kinematics, and have all looked somewhat goofy when blending between certain animations, as the blend goes direct, resulting in stretching, instead of mere bending of limbs. you can get away with it when the model is moving fast, but when its moving slowly, like when it comes to a stop, it looks weird if it is not slow. Presumably you could come up with some way to cover these issues if you have additional (blendable) animations to cover the slow movements, but I am not really comfortable with such apps so have made no such animations for any models.

If you want to be lazy, you could just stick with the server-controlled .frame values for the upper part of the model, and apply csqc-based leg/jump animations for the lower parts (remember, skel_build uses all of frame, frame2, lerpfrac, frame1time and frame2time to build the bones in the specified range). You would still need to recognise when the player dies and somehow remove the leg animations changes so the player can turn into a corpse that is not still trying to run.
if you're a fan of quake3, you can actually build the skeleton from two separate entities. if only one is actually visible, the frame etc information from both entities can be merged, such that one entity contributes to bones root to hip, while the other contributes from hip to lastbone.
If you animate the legs in csqc, and the torso based on the frames from ssqc (the ent will need to be known to csqc still or you can't use skel_build), you should have an easy way to create a model that actually runs properly while shooting.
In actual fact, you can have multiple entities drawn using the same skeletal object. This may make the most sense with replacable heads or headwear or some such. if the body does not contain a head, the head does not contain a body, but both models use the same skeleton then its all quite a snazzy way to have alternative details on character models, beyond mere skins. Likewise, you can source animations from a different model entirely, assuming they are compatible, which can be a cheap way of animating many alternative player models (md5mesh/md5anim format basically requires this).

I think DP does actually have some field you can set in order to send its skeletons to the client, presumably its listed in dpextensions.qc but I'm too lazy to check... I'm not too sure its really worth using it other than to debug hitmodels.

These are my thoughts. They may not be useful or even correct. But the important thing is to have fun figuring out my more broken sentances. I'm too lazy to proof read too.
Spike
 
Posts: 2911
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: skeletons, dp and qc?

Postby Nahuel » Tue Oct 18, 2011 1:54 pm

Spike wrote:If you animate the legs in csqc, and the torso based on the frames from ssqc (the ent will need to be known to csqc still or you can't use skel_build), you should have an easy way to create a model that actually runs properly while shooting.

Great suggestion Spike!!!!!!!!!!! I will try to make this today. I can send the legs like a separate entity (and mix the code with some stats) to csqc but i have a question. Can i use the old $frame metod mixed with the framegroup??? I speak to make framegroups just for the animations of the legs (stand, death, run and walk) and use $frame for shoot. Maybe using a framegroup file like
Code: Select all
1 10 1 1 // stand framegroup
11 1 1 0 // shoot frame 1
12 1 1 0 // shoot frame 2
13 1 1 0 //  shoot frame 3
14 1 1 0 //  shoot frame 4
15 1 1 0 // shoot frame 5
16 1 1 0 // shoot frame 6
17 1 1 0 //  shoot frame 7
18 10 1 0 // walk framegriup
29 10 1 0 // run framegroup
40 10 1 0 //death framegroup

If i will write the classic animation for the shoot and the same time i send the legs to csqc (in playerpostthink maybe, if the player is alive :) ) and
make this in csqc
Code: Select all

if (some stat about the forward velocity == 0)
if (!self.skeletonindex)
self.skeletonindex = skel_create(self.modelindex);
self.frame = 0;
//self.frame1time ;
skel_build(self.skeletonindex, self, self.modelindex, 0, skel_find_bone (self.skeletonindex, "waist"), skel_find_bone (self.skeletonindex, "foot"));
.......


animates the csqc the legs "standing" after that the torso "shooting"?? so i have the mixed animation ??
another question
How can i use/define frame1time???
Last edited by Nahuel on Tue Oct 18, 2011 2:21 pm, edited 2 times in total.
hi, I am nahuel, I love quake and qc.
User avatar
Nahuel
 
Posts: 495
Joined: Wed Jan 12, 2011 8:42 pm
Location: mar del plata

Next

Return to Modeling

Who is online

Users browsing this forum: No registered users and 1 guest