Movement smoothness

  ... discussions about development with the GLES2 branch of AndEngine.

Movement smoothness

Postby pep_dj » Sat Dec 24, 2011 11:21 pm

I updated my project, and everything works well... Except one thing: movement is not smooth. I did this test: I created a sprite (a 128x128 pixels ball), added a circle body to it, and I created a physics world, I used 200 for pixel to meter ratio because I need more speed. The ball is fast, but is less smooth than gles1 version :( what can I do?
Image
pep_dj
 
Posts: 170
Joined: Fri Nov 12, 2010 9:05 pm

Re: Movement smoothness

Postby Nicolas Gramlich » Sun Dec 25, 2011 10:16 am

Hi,

there shouldn't be any difference in performance/smoothness, especially for this kind of trivial test-game.

Are you using a FixedStepPhysicsWorld :?:

Also active background apps might produce temporary FPS drops. Using a LimitedFPSEngine at sth like 30 FPS can reduce this.

Best Regards,
Nicolas
Nicolas Gramlich
Site Admin
 
Posts: 1734
Joined: Mon Jun 07, 2010 6:20 pm
Location: Schriesheim, Germany

Re: Movement smoothness

Postby pep_dj » Sun Dec 25, 2011 1:14 pm

Thanks for your reply, Nicolas.

I'm using FixedStepPhysicsWorld:

PhysicsWorld physicsWorld = new FixedStepPhysicsWorld(60, new Vector2(0, SensorManager.GRAVITY_EARTH * 1.5f), false, 3, 2);

And I incremented "pixel to meter ratio" to 200, because I need more "real" physics (I need the ball run faster).

If I limit FPS to 30, the movement is not smooth as I would like. If game runs at 60 fps, is smooth, but "sometimes" it isn't: the ball sometimes stop for a millisecond, and continues (I don't know what the word is to define that... sorry).

I think I need to "play" a bit more with these values to get a "perfect" smooth game...
Image
pep_dj
 
Posts: 170
Joined: Fri Nov 12, 2010 9:05 pm

Re: Movement smoothness

Postby Mathew » Sun Dec 25, 2011 1:59 pm

Do you mean 'camera jittery effect' ? I had such effect after changing normal physic world to the fixed step.

mCamera.onUpdate(0.1f);

in my chase entity update helped.
User avatar
Mathew
 
Posts: 1073
Joined: Sun Jul 31, 2011 2:49 pm
Location: Tarnów, Poland

Re: Movement smoothness

Postby pep_dj » Sun Dec 25, 2011 2:11 pm

I think this is no camera jittery effect, the camera is not moving. Only the ball is moving. The ball movement is not always smooth. In logcat I see "60 fps", and runs smooth, but only "sometimes" movement is not smooth... I will attach the apk when I can (today I'm not at home).
Image
pep_dj
 
Posts: 170
Joined: Fri Nov 12, 2010 9:05 pm

Re: Movement smoothness

Postby pep_dj » Mon Dec 26, 2011 1:34 pm

I used a LimitedFPSEngine, I limited it to 60 fps. And I used FixedStepPhysicsWorld with 60 steps per second, and now runs pretty well ;)
Image
pep_dj
 
Posts: 170
Joined: Fri Nov 12, 2010 9:05 pm


Return to GLES2

Who is online

Users browsing this forum: Google [Bot] and 135 guests