zepplondon

Hello
The project uses LibGdx runtime and the problem is with animations that use paths.
In the attached videos you can see how it is supposed to perform (Normal.mp4) and how the buggy version looks (Buggy.mp4).
Apparently the problem occurs on old/slow phones. We've managed to replicate this bug on following devices:
- Galaxy Grand Neo
- Htc One S
On newer / more powerful devices the issue doesn't seem to appear. Also it works fine on desktop.

So summing up, the bug occurs with animations that use paths, exclusively on "old" devices.

https://drive.google.com/drive/folders/0B1kVtOxb4kDUNXlNN3o0U3RSNW8?usp=sharing

Under the Google Drive link are
- Videos
- Code project
- Spine project ( located in SpineTest\android\assets\coal-mini-boss )

Looking forward for feedback.
Thanks in advance.
zepplondon
Posts: 4

badlogic

That is amazingly weird. The code in the test looks fine. I also went through the shaders of the spine-libgdx runtime for mobile and tested it on a few of my old test devices (HTC Nexus One) and it looked fine. Could you test the vine sample of ours on your devices? That'd rule out an issue with the Spine project of yours.

What Android version are those devices running? My guess is that it might be a JIT bug in Dalvik (those devices probably don't run ART), in which case there's not a lot we can do :/

edit: issue opened by op here [libgdx] Paths not working on old devices · #861
User avatar
badlogic

Mario
Posts: 650

zepplondon

Ok, so here's the os info of the devices
samsung - android 4.2.2
htc - android 4.1.1
Testing your sample is a great idea. Where can I find it?
zepplondon
Posts: 4

Nate

The vine project comes with Spine, in the installation folder. Also here:
spine-runtimes/examples at master
User avatar
Nate

Nate
Posts: 6921

zepplondon

Ok, so I've tested the vine example and it also is broken. :(
Here's the video
https://goo.gl/photos/3PkGnCAfEGVSEv1z6

Does this mean that animations with paths won't work on devices running dalvik? And is there any workaround we can come up with besides not using paths?
zepplondon
Posts: 4

Nate

I'm guessing it's a Dalvik bug of some sort, which is unfortunate. The best thing to do would be to narrow down what exactly the problem is. Maybe badlogic has some ideas?
User avatar
Nate

Nate
Posts: 6921

badlogic

The Android versions of the devices you mentioned are running ART, not Dalvik. Some vendors modify ART (for whatever terrible reason) and the end result is what you see. I'll try to reproduce it with an emulator running those versions, but it's likely the emulator won't reproduce the issue. I don't see any code in PathConstraint that could be responsible for this issue, except for a NaN check (which should work).

Could you try one thing for me: add strictfp to the PathConstraint class, e.g.

public strictfp class PathConstraint {

That may trigger a different JIT route and potentially fix the issue.

I've opened an issue here [libgdx] PathConstraint fails on older ART versions on Android · #865
User avatar
badlogic

Mario
Posts: 650

zepplondon

Ok, so I've tried
strictfp
, and still no result.
zepplondon
Posts: 4

badlogic

Then it's bad. strictfp is supposed to work on ART (which 4.1 should use), and ensure that all calculations are performed stricly adhering to the IEEE float standard.

Could you please try the following: replace your copy of PathConstraint.java with this version https://gist.github.com/badlogic/4f517f3a65d25839d27aff01f3dc7965 It's compatible with the latest spine-libgdx runtime from the master branch on GitHub.

If this doesn't work, then I'm out of ideas for now. I tried to reproduce the issue using various emulator setups (Haxm x86, ARM Qemu), but that didn't reproduce the problem.

edit: I've updated both the master branch and the 3.6-beta branch with higher precision code in PathConstraint and other classes. Please give that a try.
User avatar
badlogic

Mario
Posts: 650

Nate

Maybe Android borked up int math? :party:
User avatar
Nate

Nate
Posts: 6921


Return to Runtimes