2

I've made a simple, 3 frame, animation of a character walking to wherever you click on screen using Haxe+ Haxepunk... Well I copy/pasted code from online tutorials just to test Haxe out.

This runs great in flash, iOS simulator and on a Samsung Galaxy 3... But on my HTC desire it runs at less than 1 frame per second. While I know the desire is no spring chicken this is a massive performance gap, more so than I've seen on any app re: Galaxy vs. Desire...

Is this a Haxe problem or something I have done wrong (wrong NDK, wrong compile flags, OS too old, etc)?

Gama11
  • 31,714
  • 9
  • 78
  • 100
jdoig
  • 1,472
  • 13
  • 27
  • - Samsung Galaxy 3: http://www.antutu.com/view.shtml?id=75 - HTC Desire: http://www.antutu.com/view.shtml?id=357 - http://pdadb.net/index.php?m=cpu&id=a8250&c=qualcomm_snapdragon_qsd8250 Are you using floating point numbers? It appears the HTC Desire has poor floating point performance. It may not be enough, but would it be possible to to implement it using more integer math? The HTC Desire has a gpu that supports OpenGL ES. Is the sample app utilizing the GPU or CPU? Without seeing the tutorial, it's hard to do anything but speculate. – Joe Jan 13 '13 at 17:20

1 Answers1

5

Go into Engine.hx, the render() function, and comment out HXP.screen.refresh(). This line is absolutely killing performance on OUYA (an android gaming console) so it might be killing you too. Since you're not clearing the screen every frame anymore you'll want to draw a background every update by adding a Backdrop instance to your world. My game goes from 7 fps to 52 fps with these changes alone at 1080p resolution and ~80 entities.

Also try grabbing the latest HaxePunk from github and running ant to install it, the devs have been working on android performance lately and there's some good unreleased fixes which will be cream on top of the above fix.