Frames Of Animation

Blitz3D Forums/Blitz3D Programming/Frames Of Animation

EmerGki(Posted 2006) [#1]
The quantity of frames of animation in a character can make my game run slowly?
If Yes, How to do my animations in various files?, like this:
Main_Character.b3d
run.b3d
idle.b3d


John Blackledge(Posted 2006) [#2]
Help > Command Reference > 3D - Category > Entity Animation.


EmerGki(Posted 2006) [#3]
Yes Man, I know this commands, but, What I want to know is how to export the characters with animations in each file, like the example above. And, When I load my characters in the game without animation, the FPS is fine, but, when I do my characters animate, the game run slowly. This is the motive of my question :(


Naughty Alien(Posted 2006) [#4]
AddAnimSeq, and each time you call AddAnimSeq will add new animation taken from animated character(bones) you specify, and keep old one..be sure that number of bones be same as well as bones names..otherwise it wouldnt work...


Matty(Posted 2006) [#5]
Hi EmerGki - you will find that in blitz3d, on low end systems especially, if you simply load an entity with 'loadanimmesh' it slows down the program, more so than loadmesh would, even if it is currently not animating.


jhocking(Posted 2006) [#6]
Keeping each animation as a separate file is for convenience in authoring the content, it does not affect how fast the game runs. A lot of frames because your animation is long shouldn't matter, but a lot of frames because you're using a high framerate would matter.


EmerGki(Posted 2006) [#7]
Hi!

Matty, I've load my characters with LoadAnimMesh and the game run fine, but, when I call the the command "Animate" the game run slow (Note: This happen with 30 or more characters in the game, I need to use many characters).

Joe, I'm using 30 FPS, I think what this be a good frame rate. I think what the game run slowly because the UpdateWorld for update all animations :(.

Anyone know some game (made in blitz) with many characters in the screen?


Matty(Posted 2006) [#8]
Hi EmerGki - this game of mine has many characters on screen at once, but they use the md2 format, which on my own machine renders twice as many characters than a similar b3d model for the same frame rate

http://home.swiftdsl.com.au/~gezeder/lloyd/Blood&Plunder.html


John Blackledge(Posted 2006) [#9]
I've had 8 animated B3D characters in one scene with no problems.
How many is 'many'?


EmerGki(Posted 2006) [#10]
Many is 60 characters


Paolo(Posted 2006) [#11]
Some thoughts,

- You are calling the UpdateWorld() command once per main-loop, right?

- 60 characters!!!, how many polys each?, with 60 boned-animated
characters on screen, if each one is made of more than 400-600 polys then
I think you will get a slowdown on any PC, that would be
too much stuff for Blitz to handle ...

If the models are not ALL at the same time on screen, I suggest
to hide the entites that are not in view,
hiden entities are not detected by the UpdateWorld().

Paolo.


EmerGki(Posted 2006) [#12]
Eurythmia, UpdateWorld() is only for main-loop yes.
Each character have 425 Triangles.

I'm working to Optimize this, I not animate the entity out of the camera view. I'll do the "HideEntity" too. =D. Thank's!


IKG(Posted 2006) [#13]
I have a question simular to EmerGki's.

If I have a who needs to run, walk, and sit, how do I load up all the different animations? Do I make them all on the same animated , and then just specify which frames to play, when? Or do I save seperate animated s for the 1 character? That would seem too messy though...


jhocking(Posted 2006) [#14]
Joe, I'm using 30 FPS, I think what this be a good frame rate. I think what the game run slowly because the UpdateWorld for update all animations

If that's the framerate you're animating at, with a keyframe every frame, that may be too high (it depends how many bones there are, really.) Note that I am talking about the framerate in your animation tool when you create the animation, not the framerate of the game.

@ikg: Basically it's about setting up animation sequences. If you read the command reference for the Animate command, you'll notice you can choose which animation sequence to play. You can either setup all the animation sequences as one long animation and then chop up the frames using ExtractAnimSeq, or keep each animation as a separate file and use LoadAnimSeq to add the animations to your loaded model.


EmerGki(Posted 2006) [#15]
IKG,

If you use all animations on a single .b3d file, you'll use the commands: "LoadAnimMesh", and for extract the animations from him, you'll use "ExtractAnimSeq".
To use various file for animations, you'll use "LoadAnimSeq".

To Save animations in separeted files, I have no Idea :(.

To play your animations, you'll use "Animate", in this command you must inform the sequence of animation, this sequence you have using "ExtractAnimSeq" and/or "LoadAnimSeq"


IKG(Posted 2006) [#16]
Great! Makes a lot more sense now :D


EmerGki(Posted 2006) [#17]
Joe, Now I'm have many character working fine =D, I do some optimizations and now are working good.

Thank's to all!


jhocking(Posted 2006) [#18]
Good stuff. So what exactly did you optimize?


EmerGki(Posted 2006) [#19]
I optimize various things like : Artifical Intelligence (I stop use commands like AnimSeq and AnimTime), Hide entities out of view, EntityAutoFade.