Framerate Discrepancy with Players
by Jeff Gran · in Torque Game Engine · 05/02/2005 (6:14 pm) · 10 replies
jboy.menlofarms.net/stuff/3DL/fps_tests/images.htm
The framerate only drops when the player in question is visible on screen.....
Can anyone explain this?
Is the animation being inefficient? The skeleton is a CS Biped, 3 spine links, 5 fingers each hand. It was rigged with only 1-2 bones per vertex for most of the model. The animation is 900 frames long. It's an animation of the dude standing there, shifting his weight every few seconds. Would lowering the original polycount make the animation run faster, just because there are less vertices to think about on every frame? Are there tricks when exporting from the MAX (or any package) that will reduce the load caused by the animation?
Or could it be something non-artist related involving the Player class? The dude just needs to stand there (and later on will need to walk on a pre-determined path), so are there any processes running every frame that are wasteful to us that could be bypassed?
The framerate only drops when the player in question is visible on screen.....
Can anyone explain this?
Is the animation being inefficient? The skeleton is a CS Biped, 3 spine links, 5 fingers each hand. It was rigged with only 1-2 bones per vertex for most of the model. The animation is 900 frames long. It's an animation of the dude standing there, shifting his weight every few seconds. Would lowering the original polycount make the animation run faster, just because there are less vertices to think about on every frame? Are there tricks when exporting from the MAX (or any package) that will reduce the load caused by the animation?
Or could it be something non-artist related involving the Player class? The dude just needs to stand there (and later on will need to walk on a pre-determined path), so are there any processes running every frame that are wasteful to us that could be bypassed?
#3
#1 Make your root animation with ALOT less frames
#2 Export it (animations), don't keep them in the model.
#3 Use keyframes in your animations rather than saving the entire animation as 900 individual frames, do it with several lets say 10-20 key frames, and let the engine extrapolate from there.
Using these techniques on a Linux setup with an ATI 9200 SE Video card I was able to increase my framerate by 35% in single model scenarios and by over 50% in multiple model setups.
05/03/2005 (10:23 am)
I get a serious frame rate drop on models with the animations baked in vs seperate sequences. Maybe you could try a few things#1 Make your root animation with ALOT less frames
#2 Export it (animations), don't keep them in the model.
#3 Use keyframes in your animations rather than saving the entire animation as 900 individual frames, do it with several lets say 10-20 key frames, and let the engine extrapolate from there.
Using these techniques on a Linux setup with an ATI 9200 SE Video card I was able to increase my framerate by 35% in single model scenarios and by over 50% in multiple model setups.
#4
I have the animations as separate dsqs.
Looking at the dump files, it DOES look like the rotations for every bone are being exported on every frame... but I only have relatively few keyframes in the .MAX file. How can I control this?
05/03/2005 (11:04 am)
Interesting...I have the animations as separate dsqs.
Looking at the dump files, it DOES look like the rotations for every bone are being exported on every frame... but I only have relatively few keyframes in the .MAX file. How can I control this?
#5
05/03/2005 (11:15 am)
I've no idea on that, I have both Blender and Max, and I use Blender pretty much exculsively, I can never get the max exporter to do anything useful.
#6
05/03/2005 (11:25 am)
Just did a couple more tests. The framerate stays the same with a shorter animation, and one with "Use N Frames: N=2" instead of "Use Framerate: 15". This did however drastically reduce the filesize of the dsq and the quality of the animation...
#7
How many bones total are we talking about here? It appears you have the face rigged also, along with the hands. I suspect this is your bottleneck. You may want to see how it acts with a simple six bone rig and go up from there. Also, mapping to more than one or two bones is going to increase the time as it needs to loop thru every vertex and bone combo and add the final results, potentially very expensive as this happens every frame.
Not sure why Dreamer got the increases in framerate, separate sequences (.dsq's) should act exactly the same as sequences embedded in the .dts file (if I understood his post correctly). Deeper testing would have to be done to see what is happening there.
Other possibilities:
differences in texture sizes? multiple textures on the model?
is the animated model tri-stripped?
05/03/2005 (11:46 am)
For animations into torque, if the bone/node is animated at all, it will keyframe every frame for translation, rotation and scale depending on what you have animated. This cannot be avoided, nor would you really need to as this should only consume memory and not affect framerate. TGE is always interpolating between keyframes based on the time at the specific frame. Also, you may want to ensure you are not scaling or translating the bones, only rotating as this will reduce the processing per frame.How many bones total are we talking about here? It appears you have the face rigged also, along with the hands. I suspect this is your bottleneck. You may want to see how it acts with a simple six bone rig and go up from there. Also, mapping to more than one or two bones is going to increase the time as it needs to loop thru every vertex and bone combo and add the final results, potentially very expensive as this happens every frame.
Not sure why Dreamer got the increases in framerate, separate sequences (.dsq's) should act exactly the same as sequences embedded in the .dts file (if I understood his post correctly). Deeper testing would have to be done to see what is happening there.
Other possibilities:
differences in texture sizes? multiple textures on the model?
is the animated model tri-stripped?
#8
05/03/2005 (4:43 pm)
Is that in TSE by chance?
#9
I'm also thinking that lowering the base polycount will help alleviate the animation's heavy-ness, because there will be less vertices to cycle through for each frame of the animation.
The model is probably not tri-stripped very well (but in the screens shown, it is the exact same model)... I don't really know how to make the tri-stripping more efficient. Any tips?
Brian: Nope, TGE with light pack.
05/03/2005 (5:07 pm)
Jameson: Thanks for the info. I looked in the dump file and counted all the bones it registered...57. Now that it's been brought to my attention, that does seem a bit extreme. I think the wastefulness is probably in the hands. I have 5 fingers on each hand, each with 3 joints. I should probably at least do "mitts" for the last three fingers. Maybe this will help. I do require the facial rig (7 bones, linked to the head).I'm also thinking that lowering the base polycount will help alleviate the animation's heavy-ness, because there will be less vertices to cycle through for each frame of the animation.
The model is probably not tri-stripped very well (but in the screens shown, it is the exact same model)... I don't really know how to make the tri-stripping more efficient. Any tips?
Brian: Nope, TGE with light pack.
#10
05/03/2005 (6:56 pm)
...
Torque Owner Stefan Lundmark
You runing ATI? You could twink some variable that could make framerate problems go away, but the snippit escapes my memory at the moment. :(