Forum

$frames and self.frame

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Postby Swift » Sat Apr 17, 2010 4:20 am

If you're working with Darkplaces, it may be better to use framegroups instead.

http://dpwiki.slipgateconstruct.com/ind ... ing_for_DP
Swift
 
Posts: 60
Joined: Tue Jan 26, 2010 11:02 am

Postby Sajt » Sat Apr 17, 2010 5:50 am

Hmm. Framegroups are useful for idle animations, but not much else. An illustration: if you use framegroups, and some entity goes into a death animation outside of your PVS, and then you move into the room, you'll see the death animation just starting when it should be ending.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Swift » Sat Apr 17, 2010 5:55 am

Oh really? I'm sure I saw Nexuiz use framegroups for character anims.

For some reason I thought they could drastically simplify a hub system for anims.

Well, is there any way to jigg it so that framegroup data would be sent to players outside the PVS?

Edit: Actually, one could create seperate DYING and DEAD framegroups entries and do some statemachine checking. Ya? Either way, I'm not entirely sure I understand the downside.
Swift
 
Posts: 60
Joined: Tue Jan 26, 2010 11:02 am

Postby Spike » Sat Apr 17, 2010 10:20 am

Depends what the framegroup is synced to. In regular quake, the framegroup animation is synced to map start time. So start a framegroup animation and your animation begins mid-death.

DP's skeletal models are an exception to this, and those start the animation when the model first dies.

If you're using csqc, then framegroups may be easier to use, where you can specify the exact time into it. Otherwise I wouldn't really recommend using framegroups (the death animation is just one issue).

The first time you see the ent, it'll start playing its current animation. If you remove it and readd it (teleport out and back) the animation restarts. If you switch it to its dead non-animation after a fixed length of time, people just entering the room will see it starting to die then suddenly flat on the ground.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby mankrip » Tue Apr 20, 2010 3:41 pm

Spike wrote:In regular quake, the framegroup animation is synced to map start time.

Plus a random amount, if the "random" flag is defined.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Postby Swift » Thu Apr 22, 2010 6:14 am

I guess the question remains: can all of these problems with framegroups can be averted if player animation is coded in CSQC?

Spike wrote:If you're using csqc, then framegroups may be easier to use, where you can specify the exact time into it.


What are the effects of using .frame1time frame2time etc?
Assuming MD1/MD3 model - Does frame1time/frame2time specify the next frame, or next framegroup?
Swift
 
Posts: 60
Joined: Tue Jan 26, 2010 11:02 am

Postby Spike » Thu Apr 22, 2010 10:35 am

.frame specifies the framegroup
.frametime specifies the time into the framegroup.

this results in a 4-way blend between the two frames of the new framegroup and the two frames of the old framegroup.

if you then send the time at which the animation was meant to start from the server, and calc the frametime as time - startime, then someone seeing a death half way through or after the event will see it starting half way through or already dead.

how you encode the time can vary. one way is as 'X seconds ago' rather than the absolute time, as this can be sent in a single byte. You'll want to scale it.
Spike
 
Posts: 2892
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby ceriux » Mon Apr 26, 2010 2:56 pm

frag.machine wrote:I still don't think it's a good programming practice, but... It's up to you. It's your code. :)


personally its easier for me to code animations with out macro's they confuse me.
User avatar
ceriux
 
Posts: 2223
Joined: Sat Sep 06, 2008 3:30 pm
Location: Indiana, USA

Previous

Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest