Page 1 of 2

Milkshape (ms3d) AnimatedNode -> very slow

Posted: Thu Oct 13, 2005 6:25 pm
by Thorben Linneweber
Hi, iam working on a multiplayer fps game but i have problems with the format of my player. For each player i load a ms3d file which has 4000 frames... I tried to load 20 players but my fps-rate go down to 10fps! :(

Has anyone an idea why it is so slow? ... i always thought it doesn't matter how big the animations are... the only important factor or the numbers of bones.

Irrlicht has only to play a animation of 20frames... (e.g. from 1020 to 1040).

Please help!

Posted: Thu Oct 13, 2005 7:07 pm
by ThommyE
i experienced strange framerate drops when using ms3d files...(about 2000 frames) while playing the animation my fps went down from 120 to 80.. after the animation stared over again it was back to 120.. dropping again. try to export you models to x and see if you still have problems.
bdw, shure the animations are the reason? what framerate do you get when not playing any animation?

Posted: Thu Oct 13, 2005 7:26 pm
by Thorben Linneweber
500...

Posted: Thu Oct 13, 2005 7:27 pm
by Andi|xng
The problem is perhaps also caused or influenced by the MS3D loader, which creates 3 vertices per triangle and does not take advantage of reusing vertices in the index buffer.
I think, I solved the problem a few days ago. Read this thread:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=9119

And please post your results in this thread, too. Niko said to me, that he will perhaps include the patch in the next version. But your support is needed, please test it too :)

Posted: Thu Oct 13, 2005 7:31 pm
by Andi|xng
But my patch does not solve all ms3d problems. I have still some speed problems connected with setFrameLoop() and joint-child nodes:
http://irrlicht.sourceforge.net/phpBB2/ ... php?t=8834

Nevertheless, with the patch it works much better now.

Posted: Thu Oct 13, 2005 7:32 pm
by Thorben Linneweber
... 500 frames if i don't load anything. You are right i have just tested it wihtout playing animations! The frame rate is the same... (10 to 15 without any animation)

:?

I don't know much about ms3d files. Here are some model statistics

---------------------------
Model Statistics
---------------------------
Vertices: 1745
Triangles: 2124
Groups: 9
Materials: 0
Joints: 31
Smoothing Groups: 1
Mins: -36.11 31.78 -6.12
Maxs: 36.11 69.70 8.12
Center: 0.00 50.74 1.00

---------------------------
---------------------------

Is this okay?

Posted: Thu Oct 13, 2005 7:36 pm
by Thorben Linneweber
Thx for your answer Andi|xng!

I already tried your code but the frame-rate just raised about 5 frames...

Do you have any other idea what takes irrlicht so much time?

Posted: Thu Oct 13, 2005 7:36 pm
by Andi|xng
I tried to find the bottleneck by compiling Irrlicht without any ms3d animation possibility. The frame rate was nearly exactly the same as with animation. The bottleneck seems to be the rendering. Try my patch and see if it helps.

Posted: Thu Oct 13, 2005 7:42 pm
by Andi|xng
Thorben Linneweber wrote:Thx for your answer Andi|xng!

I already tried your code but the frame-rate just raised about 5 frames...

Do you have any other idea what takes irrlicht so much time?
Sorry, no idea at the moment. But I will look at it when I have time. Unfortunately I am no C++ expert, I work with Java and Jirr...
If you can use .x, use .x! .x is much more faster, but in our project we have problems to convert the .ms3d to a Irrlicht-compatible .x file, so we have to user .ms3d...

Posted: Thu Oct 13, 2005 7:45 pm
by Andi|xng
But you can really help me a lot if you send me your .ms3d file: andi@xenoage.com . Thanks!

Posted: Thu Oct 13, 2005 10:23 pm
by Thorben Linneweber
I would use *.x but i was wondering if there is also a way to add a node to a joint (here the weapon to the playerhand) with a *.x file ?

Posted: Fri Oct 14, 2005 10:57 am
by Thorben Linneweber
I converted the models to *.x but the fps-rate is now about 20fps :shock:

-> There muste be a problem with the model :shock:

Do you have any ideas why ???

Posted: Fri Oct 14, 2005 12:40 pm
by ThommyE
20 models with 2k triangles per model.. result is 40k poly...(at least 20k visible ) thats A LOT. at least for my geforce ti4200... level not includet in this calculation.
but i wouldnt get more than 20-30 fps with that.
if you'r hardware isnt drastically better than mine you really should concider using LOD or simmilar stuf.. or simply reducing the trinagle cout if possible.

@Thorben: you can attach a dummy node quite easy by linking its position to the matrix of the bone. the only problem is that the matrix is updated AFTER rendering the image.. so your attached node will allways be 1-frame behind the parent. I'm still looking 4 a solution.

Posted: Fri Oct 14, 2005 12:55 pm
by Guest
For each player i load a ms3d file which has 4000 frames... I tried to load 20 players but my fps-rate go down to 10fps!
4000 "frames"? :shock:
Simplify your models for fewer polys and perhaps fewer "frames". You might also want to post your OS, video card type and driver version...

Posted: Fri Oct 14, 2005 1:24 pm
by Andi|xng
I also think, the problem is your model, not Irrlicht.
I have really problems to display it in Milkshape, and I have the newest version! Milkshape has problems to display the current frame number when playing the animation, and it is not smooth. The bones are jumping around suddenly... Try to simplify your model (its high resolution is not good for games) and reduce your keyframes, I am sure about 500 would be enough for your animations.