Re: Optimization help

56 views
Skip to first unread message
Message has been deleted

Jeru Sanders

unread,
Dec 6, 2015, 3:09:11 PM12/6/15
to HaxeFlixel
Look into AdobeScout or hxScout to give you more details about what's taking so much time.

My most basic tip is to not create new enemies, instead using FlxGroup's pooling feature to recycle the enemies.

On Sunday, December 6, 2015 at 6:37:42 AM UTC-7, ThunderXBlitZ wrote:
Almost done with my game (scrolling space shooter) but I realized that the game starts to lag on android) mobile devices (it was fine previously, not sure about iOS)

using master branch (non-dev) of haxeflixel

What I have on screen at once:

Player (SpriteGroup) and various bullets
flixel addons star filled background
some UI (eg hp bars, controls, buttons etc)
constantly spawning enemy sprites (FlxNestedSprite) that can shoot bullets etc too
explosions, particle effects (already cut down on these!)

Running the built-in debugger (on desktop) shows these stats:
update: 79 (2.7ms)
Draw: 46 (1.1ms)
DrawTiles: 46
QuadTrees: 61
Lists: 144

Any tips for optimizations? (i realize its difficult without the source code but still..) this is my first game.. really hyped to have it released in the next few days

ThunderXBlitZ

unread,
Dec 7, 2015, 4:23:52 AM12/7/15
to HaxeFlixel
Already have that, thanks!

Jeru Sanders

unread,
Dec 7, 2015, 3:20:28 PM12/7/15
to HaxeFlixel
You already have used Scout? What does the profile say is the problem?

ThunderXBlitZ

unread,
Dec 7, 2015, 9:09:04 PM12/7/15
to HaxeFlixel
Its mostly draw related stuff... all taking 1ms
BitmapData.draw 
FlxTypedGroup.draw
FlxSprite.draw
copyPixels
camera.fillRect

and occasionally: (also 1ms)
emitter.recycle
player.flicker
flxpoint.set_x


On Sunday, 6 December 2015 21:37:42 UTC+8, ThunderXBlitZ wrote:
Almost done with my game (scrolling space shooter) but I realized that the game starts to lag on android) mobile devices (it was fine previously, not sure about iOS)

using master branch (non-dev) of haxeflixel

What I have on screen at once:

Player (SpriteGroup) and various bullets
flixel addons star filled background
some UI (eg hp bars, controls, buttons etc)
constantly spawning enemy sprites (FlxNestedSprite) that can shoot bullets etc too  (belongs to 1 enemy group and pooled)

Jeru Sanders

unread,
Dec 8, 2015, 3:17:59 AM12/8/15
to HaxeFlixel
Hmm, that's a contradiction to what Flixel is saying about draw/update, can you send the profile?

ThunderXBlitZ

unread,
Dec 8, 2015, 4:30:45 AM12/8/15
to HaxeFlixel
Adobe scout: https://www.dropbox.com/s/smxq0fmh50sbb9o/scout.flm?dl=0

My first game is almost done, rly excited to release it this weekend. Only this lag issue is holding me back..

Btw, is FlxAtlas dev branch only? The tutorials i can find online are all in dev. No idea how to use the flxatlas in the stable version of flixel
Reply all
Reply to author
Forward
0 new messages