6
\$\begingroup\$

I'm making a 2D game for the Android phone, one that involves falling balls. I want to use a physics engine to properly simulate the balls falling and hitting other objects. I'm currently using Phys2D, but when the game runs in the emulator it doesn't look natural; slow and rough. Course, I don't know if this is because of the emulator or Phys2D seeing as how I don't own an Android phone (A real drawback not being able to test on the actual phone, I know, but I can't afford a smartphone).

Anyways, do you think the game would run faster and smoother on an actual android phone, or is it the engine I'm using, or how I'm using it. If it's the engine, any recommendations on Java physics engines?

UPDATE: If you want to test the game yourself, you can find the rough prototype here: http://bpcp.angelfire.com/BallDrop.apk

\$\endgroup\$

3 Answers 3

3
\$\begingroup\$

Emulators can be fairly slow. You'd want to test on real hardware first. Maybe release a free demo and see what kind of feedback you get, or ask a friend to try it?

Even with just an emulator, you can profile your code to see what eats up the most time. Rendering can be a major bottleneck, so that'd be a place to look.

Physics aren't likely to take a lot of time unless you're doing something strange with them or simulating them way too precisely. e.g. if you're simulating 3-inch balls bouncing around, you don't need to be precise to 1/1000th of an inch. Games often sacrifice accuracy in both rendering and physics for speed - nobody's really going to notice or care about slight inaccuracies most of the time.

\$\endgroup\$
2
  • \$\begingroup\$ "Emulators can be fairly slow", so far what I knew was the opposite. \$\endgroup\$ Jul 8, 2011 at 20:24
  • 1
    \$\begingroup\$ Emulators can be faster, but in the case of the Android Emulator, it is much slower in my experience. \$\endgroup\$
    – Nate
    Jul 8, 2011 at 21:06
1
\$\begingroup\$

Of course it depends on how you use the engine. But if you have an demo of your app, I can run it on my smartphone and tell you how it runs.

When you run your game on the emulator, the whole game runs laggy and slow or just part with the falling balls?

\$\endgroup\$
2
  • \$\begingroup\$ Your "answer" should be a comment. \$\endgroup\$
    – bummzack
    Jul 8, 2011 at 13:09
  • \$\begingroup\$ The game is very much in the prototype stage, so the part with the falling balls IS the whole game. \$\endgroup\$
    – Jesse J
    Jul 8, 2011 at 19:54
0
\$\begingroup\$

How about JBullet? I haven't used it myself, but I've heard good things about it. It's a port of the C++ Bullet Physics Library, so the documentation is pretty good.

\$\endgroup\$
1
  • \$\begingroup\$ I saw JBullet, but it looks like it's for 3D, which makes me think it's larger and more complex than I need. \$\endgroup\$
    – Jesse J
    Jul 8, 2011 at 19:56

You must log in to answer this question.

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