Android export optimization

65 views
Skip to first unread message

Matt

unread,
Mar 19, 2015, 7:04:34 AM3/19/15
to haxef...@googlegroups.com
Hi, im making an android game using nape physics (FlxNapeSprite) and i have about 110 of NapeSprite objects on the game and it seems to lag. Is there any known optimizations for android build ?  I'm already using texture atlas for all the sprites , is there anything else i can do to make it go faster and any function/features i shouldnt be using on android build . Also is it possible to display fps on the android devices ?

 These stats are from Windows export


Thom Sip

unread,
Mar 20, 2015, 2:45:54 AM3/20/15
to haxef...@googlegroups.com
Not sure about the optimizing, however you can get the FPS like this:

In Create:
FlxG.fixedTimestep = false;

in Update:
YourTextField.text = "Fps " + (Std.int(1 / FlxG.elapsed));

Op donderdag 19 maart 2015 12:04:34 UTC+1 schreef Matt:

Gama11

unread,
Mar 20, 2015, 1:32:54 PM3/20/15
to haxef...@googlegroups.com
That's quite a roundabout way to display FPS, you could just make the debugger visible:

FlxG.debugger.visible = false;

// hide the other debugger windows manually if they take up too much space
FlxG.game.debugger.console.setVisible(false);
FlxG.game.debugger.log.setVisible(false);
FlxG.game.debugger.watch.setVisible(false);

or access the fps value directly:

var fps:Float = FlxG.game.debugger.stats.currentFps();

Matt

unread,
Mar 20, 2015, 4:48:17 PM3/20/15
to haxef...@googlegroups.com
Thanks for the replies Thom and Gama about FPS display. Only Thoms fps display works , when i try Gama's code it just says that debugger doesnt exist.

And about optimization i managed to cut update time by 50% using my own simple hitbox colision detection ,  FlxG.overlaps was very costly it seems on android.

Gama11

unread,
Mar 20, 2015, 5:24:46 PM3/20/15
to haxef...@googlegroups.com
You need to compile without FLX_NO_DEBUG / in debug mode to access the debugger.

I thought you were using Nape? You shouldn't need FlxG.overlaps() in the first place then.
Reply all
Reply to author
Forward
0 new messages