Possibly Advanced Animation Issues :)

Blitz3D Forums/Blitz3D Programming/Possibly Advanced Animation Issues :)

Jeremy Alessi(Posted 2003) [#1]
I'm begining a new project which will need to have a large number of keyframed entities animating simultaneously. Currently, I've got about 15,000 polys, 100 animated entities which have quite a few frames of animation (100), but they aren't vertex animated or boned. They are transform animations. Anyway, while using CaptureWorld() the FPS is about 10 - 15 less. This isn't the bothersome part. As the animation runs to the end the FPS drop further and further from about 33 with CaptureWorld() or 43 without, all the way to 1 - 2 FPS. Then when the animation begins again the FPS jump back up and it begins to slow down again. It's funny but it really drastically slows down right before the animation loops back.

I'm guessing it's just that the code has to search 100 entities and search through 100 frames for each one which is just killing it. What's strange though is that I've used copy entity. Is there some way to play the animation for the original and just have the others follow. I guess I'll have to experiment. Any clues to how animation works and also any optimizations would be nice. Up till now I've mainly used dynamic animations for my games (True-Vol and Aerial Antics, AA used a little standard animation).

Anyway, I'm going to need a little over 100, maybe 110 animated entities in this game and I'll need many speed tricks.


Stickman(Posted 2003) [#2]
Im guessing your doing your own animating function() in Blitz and not a actual LoadedAnimated Mesh ???

Well Im not Quite sure what you mean by Transform animations but here is a cut down version of a code I use for vertex animations that works pretty well.

To use this for Copyed entites,you will only need to Dim the TformVertsArray(m,f,v) (m) for the master mesh ( the one you loaded and are coping from ) and the animation function will animate all the other entites the same.

Playing with this structure you can do a lot a real lot,Even your own bones if needed.
For m=0 To Animentites ; No off entites to animate

mesh=entitey_to_Animate( m ); mesh index

 For f=0 To 99 ; Keyframes

  For v=0 To CountVertices(mesh)

   TformVertsArray( m,f,v ); Vertex Keyframes per mesh

  Next 

 Next

Next


Hope this help you some.
If not,Well.... I tryed......


Bot Builder(Posted 2003) [#3]
If I interpret transform as being simply positioning/rotating, then couldn't you just have one animate, and replicate it's motion in others?


Jeremy Alessi(Posted 2003) [#4]
Nah, if I only animate the original that's the only one that animates :( I'm not using dynamic animation. It's keyframed, but with no bones.


Jeremy Alessi(Posted 2003) [#5]
Seems to work now, with 100 animated characters with only 30 frames of animation all running, and with my new motion blur on it :)