3
\$\begingroup\$

I have a simple game with 20-30 physics bodies (static, and dynamic)

If I add some additional Dynamic bodies and joints (over 80-90 item), then JBox2D will become very laggy, and a little slow.

Am I doing something wrong, or is this the limit of JBox2D? If I change to Box2D JNI via java native calls, will it be faster?

\$\endgroup\$
2
  • 4
    \$\begingroup\$ I have no idea what hardware you are running on, but I think for a mobile game, that might be too much for most phones to handle. \$\endgroup\$ Commented May 9, 2011 at 22:09
  • 2
    \$\begingroup\$ Joints are generally quite expensive to use too I believe. \$\endgroup\$ Commented Oct 7, 2011 at 9:13

1 Answer 1

1
\$\begingroup\$

Response for Android devices. Jbox2D is so bad... Since NDK is available, i use it with native Box2D. January 2010, there was a 3X factor without garbage collector lags. There is many NDK ports as in libGDX

note: With 2.3 devices, the new GC fixes lags...

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .