Constant 30 fps without slowing down physics

Hi,



I fixed my fps to 30fps and my physics simulation really slowed down. I tried increasing the maxSubStepts but in order for my simulation to work on normal speed I had to set maxSubSteps to about 500-100 which is too much because I have about 200-500 joints and 200-500 physical objects on the scene and I can’t run that in real time.

I also tried playing with physics speed but it doesn’t help it…



Any ideas how to run this kind (size) of application in real time?

Smoke & mirrors, I doubt you really need that many physics objects to make a game.

I’m not making a game. It’s my final (diploma) project for university. I’m doing simulation of generating random organisms, simulating theirs random movement and then applying genetic algorithms to them. And because of genetic algorithms my population shoul be huge and it’s not that huge after all (only 50 subjects). But each subject is about 3-10 boxes each connected with a joint, so 2-9 joints).



I could run this “serially” with 1 subject per scene and repeat but It would take too long cause each subject has perfomance time of 30sec. And I need at least about 50-100 per generation and i think at least 1000 generations…

Paralleling already almost finished thing would complicate the things too much I guess…

I susgest to start several applications (as much there are processors and split them over the applications, that should increase performance by a bit as most cpus are quad cors anyway)

Well theres only these two choices really ^^ If you want scientific results you have to wait, thats why universities build and buy these computer closers you know?

@depy said:I fixed my fps to 30fps and my physics simulation really slowed down.
Does that mean if you don't limit the fps, the simulation runs ok? That would be strange since the physics normally runs at 60 Hz which means 2 sub steps is enough at 30 fps. Otherwise, if you don't need the accuracy, you could try to lower the physics tick rate to 30 Hz to reduce CPU usage.

I’ll try lowering the physics tick rate yes. Tnx. Will report back…

Also, do you use native or jbullet? native might be depending on what you use faster

I’m using jmonkeyengine’s bulletphysics if that’s what you mean.

Jme supports jbullet and c++bullet, c++ can be better performancewise since the algorithms are a bit more moder and intelligent, however you need to compile the dll/so yourself. (This is however a bareable amount of work for 1 max 2 days when following the instructions. For win32 i suggest the mingw way, win64 is currently not done by anyone yet as I see it, linux and mac both work without problems and mostly out fo the box)

@EmpirePhoenix: I do not know why you say that all the time, the bullet natives come with the distribution, only windows 64bit is not supported at the moment.

Probably because when I tried last it was not that way, good that it changed then