You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers. No questions about C++ programming or topics which are answered in the tutorials!
since I think this is more likely "Open Discussion" than "Advanced Help" about the speed of Irrlicht.
But your loop is interesting. My first approachs was the same, but I displaced each faerie a little bit so that I can them. Perhaps otherwise, Irrlicht is clever enough to clip some of them? I don't know. But I got nearly the same results as now, if I disable collision responding. Try something like this
I think you guys are overestimating the power of your CPU :o)
First, the results above indicate that the collision detection is probably not the bottle neck.
If you double the number of objects, each object needs to do twice as many checks (against a collision of every other object) and we have twice as many objects. There: double the objects, and four times the number of checks have to be made.
The above stats are linear, meaning double the number of objects, and it takes only (:) twice as long. thats actually quite good (or the objects only collide with the level, but not with themselves, or some clever optimization is going on).
Another point is: Have anybody of you played the demo of painkiller? That game slows down to a crawl if there are more than 10-20 enemies on the screen. I I would say that their engine (both grafically as well as the physics) is optimized as hell. If you manage to move arund 400 fairies without crashing the system, I would say this is quite an achievement :)
kinda offtopic, but the pk demo was sweet, but did slow down to a crawl even on my system, of course, i just had to turn it down to 800 x 600 instead of 1024 x 768 and it ran fine
The Robomaniac
Project Head / Lead Programmer Centaur Force
I only have VC6. The compiler from 7 optimizes a bit better, but a factor of 10 ist far away from realistic.
46 fps is nearly twice as fast as my result with 30 faeries. But still it isn't a desireable result. If you have an Intel, perhaps the collisions can be calculated faster what may explain the difference.
300 gives me 2 fps if I look in the direction of the fairies and 4 if I look in the opposite direction...
You also need to keep in mind that Irrlicht doesn't have a LOD system yet, e.g. faries near you have the same amount of polygons than the ones more far away. Any many triangles can kill the performance rather quick.
In any event, I still remember me piling up 500 barrels of gunpower in the Thief Editor and then blowing them up in the game - after some initial explosions it managed a frame every 10-60 seconds or so :-)
No that's not the point. Todays graphiccards can handle 20k-30k triangles without such a low framerate. The triangle counts of my test are low enough that a LOD system won't receive anything.
"No that's not the point. Todays graphiccards can handle 20k-30k triangles without such a low framerate. The triangle counts of my test are low enough that a LOD system won't receive anything."
But doesn't Irrlicht need some more time if you have more triangles in the queue (even when you don't do collison detection) as well as does Irrlicht spent more time handling 300 (instead of 30) objects?
I think we are agreeing on the basic points (e.g. Irrlicht could be optimized), I just wanted to point out that you shouldn't expect miracles :)
I wasn't talking about 300 objects. If triangle count rises, there are other limitations for sure. But 30k triangles at a desireable framerate is no miracle.
sorry this dumb artist intrussion, but in other engines the number of surfaces (objects) hits dramatically the fps. A 30k tris in certain engine that I remember, done with a single terrain mesh, did went totally fluid, and when done so with that count but with some few meshes, the fps did fail down incredibly. I was told often this is logical in other engines.
If all that was happening is placing triangles on the screen 30k tris would be resonable, but frame rate is also affected by any other code, like collison detection. FPS in not only a function of the grahics card but also the CPU work needed fo each frame. As stated before every increase in a object requires more CPU time per frame for collision dectection. The frame will not be drawn until this is complete so the graphics card could have already finished its work and be waiting for the CPU to finish (although in this case i'm pretty sure the collisions need to be completed so the graphics card draws the objects in the one place). Traditionally if you want to test the triangle count bottle neck you would use either a single high detail model or a terrain model.
when it was all said and done, I had something around 150 .3ds files ranging from 1KB to 100KB that it loaded in realtime. Also, I had about 8 textures it placed on each of those meshes in real time. The program ate 110MB of memory, but killed the CPU/GPU as I was getting probably 2FPS.
You see, I learned something that day: Just because you can load something into memory doesn't mean you should.
"Object-oriented programming is an exceptionally bad idea which could only have originated in California."
- E.W. Dijkstra