Farseer Running Oddly Slowly.

Topics: User Forum
Apr 11, 2013 at 6:51 AM
I've previously made an android game with the libgdx box2d port, and I was easily able to have thousands of dynamic physics bodies simulated on a 600 MHz phone at 30 to 60 frames per second.

Right now I'm working on a 2D engine using XNA and Farseer 3.3, and with only 30 dynamic bodies and 1 static body on the screen I'm getting about 4 FPS on a QuadCore 3.2 GHz PC. I've profiled everything, and it's definitely stepping Farseer which is taking up all the time. Specifically the Contacts and Solve phases.

I've tried disabling CCD and Diagnostics and setting all iteration values to 1, but unfortunately it has had virtually no effect. I've read in other threads that Farseer is actually faster than Box2d, so I'm somewhat puzzled as to why I'm getting such poor performance.

I am compiling Farseer instead of using a DLL as I needed to make a minor change regarding the use of a static variable in the Body Factory class, so perhaps compiler settings are having an effect?
Apr 12, 2013 at 8:03 AM
In the version of box2d I was previously using I'd never been required to set the world size. Since I hadn't done so in Farseer the shapes I was testing with probably weren't being partitioned. Rendering at anywhere from 70 to 700 FPS now!