Choppy Sprite movement on Android

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Bob Dolan
:warning: Old Version Published before Godot 3 was released.

I am moving a Sprite node from one screen location to another over time using a tween. I have also done this using a lerped setpos() method in the fixed_process event handler. In the Godot IDE it works fine and seems to be a fairly smooth movement. However when I run the APK on my Andoid device the movement is very choppy. It looks like the sprite is moving several pixels at a time on the device.

One of the things I am thinking about is that the view size in the Project Settings is 512x1024 and the screen size on the Android device is 2560×1440. Is this significant size difference causing the movement issue? If so, what can I do about it?

Your screen size may not be the problem, since you even upscale it in this case.
What is the resolution of your sprite image? Do you only have a sprite in your scene? Is it a recent device? Which version of Godot?

Zylann | 2017-11-03 01:05

The sprite image is 48x48
The node is a sprite with Area2D, Collision2d, and tween child objects
The device is a Nexus 6
Running version 2.1.4

Bob Dolan | 2017-11-03 03:32

If you reduce the sprite speed, what happens?

eons | 2017-11-03 04:07

At lower sprite speeds the object moves slower and smoother, but they weren’t moving very fast to start with.

Bob Dolan | 2017-11-03 13:03

Do you know how much FPS you are actually getting? Is it still choppy if you only leave the sprite? Does ADB logcat gives you errors?

Zylann | 2017-11-03 20:00

I will check the FPS and get back to you.
Not sure what you mean by “only leave the sprite”.
Does the ADB log show up in the Godot log window or do I need to run something else?

Bob Dolan | 2017-11-03 20:10

I proposed to leave the sprite only to see if the lag would be caused by some other nodes.

I don’t know if Godot is able to give you logs of a remote device, but ADB logcat will. This way you can see if there is any error spam for example, which would slow down the game.

Zylann | 2017-11-03 20:17

I measured an FPS of 17.

I then removed the Particle2d node and the FPS jumped to 60 and things were running normal again. Somehow I got something screwed up in the Particle node setup.

Thanks for the idea to display the FPS. That got me looking at what I needed to look at.

Bob Dolan | 2017-11-04 01:23