Page 1 of 2

Laggy Animations

PostPosted: Mon Aug 04, 2008 10:32 am
by andylegate
Built a gate yesterday. Nothing fancy:

3 cubes (6 faces)
2 cylinders (16 faces)
2 toruss (350 faces each)

Now the total comes up to 744 faces. Not much really considering how many faces the windmill in Er'cana has (over 300 per blade).

However, when I click the button to open the gate, OMG, the lag is so bad, the game just freezes until the animation is over.

Yes, each object in the gate is an actor. Each object is parented to one object that has the animation. No shadowbuf is on.

I'm at a loss as to what would be causing this lag. I only have one sound file playing during the animation, and I've changed it to different ones, then took it out all together. Still the same result.

Has anyone else noticed lagging when you start parenting objects together for animations?

Re: Laggy Animations

PostPosted: Mon Aug 04, 2008 11:51 am
by andylegate
I can confirm this now: When ever I parent one object to an animated object (so it animates too) the animation becomes very, VERY laggy. Which is very strange. I instead animated the 3 objects seperately, and there was no lag at all.

What up wid dis????

Re: Laggy Animations

PostPosted: Mon Aug 04, 2008 11:54 am
by Paradox
When you parent objects, you cause the children to be reliant on the CoordinateInterface of the parent. When animating, you change the matrix, which must then transform all of the children based on the parent matrix. Essentially, it's a lot of math to transform each child using the parent matrix, rather than just transforming each matrix separately.

Re: Laggy Animations

PostPosted: Mon Aug 04, 2008 12:04 pm
by andylegate
So basically I have to animate each object? That's insane.....especially when I go to do the scripting for it......

Re: Laggy Animations

PostPosted: Mon Aug 04, 2008 12:24 pm
by Nadnerb
This doesn't sound right. My door (from animatedoor.age) had parented objects, (actually, 4 animated objects parented to 2 other animated objects) and I didn't notice game-stopping lag...

Re: Laggy Animations

PostPosted: Mon Aug 04, 2008 12:32 pm
by andylegate
I'll go look at you file Nadnerb and see if I'm doing something wrong. I had it down to where there were only 3 objects, 3 boards for goodness sakes, nothing complex parented, 2 of them to the one, and it still gave an incredible lag. All my other animations work fine, but this is the first time I've tried to animate more than one object. The tutorial says that the animation info is copied over when you parent the object to the animated object.

I find it hard to believe that Cyan animated each and every single object, like the windmill in Er'cana and then all that scripting. That's just too inefficient, and too much room for mistakes that would take forever to fix.

right now I've gone back to a large board to act as a gate...... :roll:

Re: Laggy Animations

PostPosted: Mon Aug 04, 2008 12:52 pm
by andylegate
Okay, unfortunately your Age doesn't help, in that what you have parented, each object has it's own animation that it's doing. In my case, all the objects are simply moving N amount of Blender units to the right. Now, I can sit here, animate the one board, then do the same with each object giving each object it's own IPO, then parent the other objects to the first board, so that in the alcscript it's only the one board that starts it all, like you did in that Age.

I'll give that a try and see what happens.

Re: Laggy Animations

PostPosted: Mon Aug 04, 2008 1:48 pm
by Jojon
Nadnerb wrote:(from animatedoor.age)


Oooo, what a feeling, to be dancing on the ceiling.

Groovy man! :D


@Andy: You're doing something like a segmented elevator door?

Re: Laggy Animations

PostPosted: Mon Aug 04, 2008 1:50 pm
by andylegate
No, it was just a simple gate that slide open is all. But it was made up of 7 objects:

3 boards, 2 posts, and two "tires". The whole thing just slid to the right is all.

Re: Laggy Animations

PostPosted: Mon Aug 04, 2008 2:20 pm
by Nadnerb
wait.. what? is there only one moving element in your gate? (the whole thing) Why don't you just join all the objects together?