Author Topic: flixel-android 0.5  (Read 11201 times)

Wing Eraser

  • Contributor
  • ****
  • Posts: 460
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
flixel-android 0.5
« on: Tue, Oct 30, 2012 »

http://wingeraser.com/flixelandroid/flixel-examples-android.apk
Project page: http://code.google.com/p/flixel-android/



Changelog v0.5

- Loading assets has tob e done by a String: url + pack name.
- FlxAssetCache, manages textures, fonts, sounds and music.
- Stage, replica from Flash. Currently used for mouse events.
- Scaling options, your game wonít be stretched anymore at fullscreen.
- BlendMode, only 5 blend modes works.
- FlxQuadTree, uses object pooling. This improves the performance significance. For more info: http://forums.flixel.org/index.php/topic,6663.msg37508.html
- FlxAnalog, circle drag and multi.

A lot of bug fixes and new implementations. Check the revisions if you want to know them all.

Plugins
B2FlxBox2D, shapes, joints and debug implemented. Works with FlxCamera.

Demos
Blend
Bloom (doesnít work)
Bomberplanet
Box2D


There is a Project GUI for flixel-android created by Thomas. It makes your life easier to setup your flixel-android projects. It will download the required zip files and extract them into the project folders.

If you choose to download the source (0.5-r108), extract the folder on your disk instead importing the zip directly in your Eclipse. Sometimes it doesn't generate the necessary files in the Android project. Please do import...->Select root directory. Also uncheck "Copy project into workspace". This will keep the subfolders (flixel-android-examples) at the same place, and not at the root.

You can also do a checkout to avoid this hassle.

If you need help with the manual setup, please post your message below.

-
flixel-android dev team

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #1 on: Sat, Nov 10, 2012 »
Hey, F-A team!

I'm not on the new release yet (I don't want to change anything as I'm at a bit of a critical point in my work) but I've run into a huge error.

I develop on Mac, where everything works fine. However, once I export to Windows, any code that changes the size of a FlxText causes a fatal error that shuts the game down instantly. Before the text even renders, necessarily. Here's more details on the exact error: http://stackoverflow.com/questions/13322921/execution-protection-violation-when-running-jar-in-windows-7

Do you have any idea what might be causing this? This is a bit of a worry for me now...

Wing Eraser

  • Contributor
  • ****
  • Posts: 460
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #2 on: Sat, Nov 10, 2012 »
Someone has already replied on your message at stackoverflow. And he's right. You've to use Java 6. Change it in the settings in your eclipse.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #3 on: Sat, Nov 10, 2012 »
Sorry, the reply hadn't appeared when I posted!

The developer machine is using Java 6, it's the target machine that uses Java 7. I assume this means there's no way around it?

Wing Eraser

  • Contributor
  • ****
  • Posts: 460
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #4 on: Sat, Nov 10, 2012 »
Delete Java 7 from the machine and reinstall 6 is the only way I think.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #5 on: Sat, Nov 10, 2012 »
Okay, thanks for the quick update. I'll report back if I find any way around it, but it's not looking likely.

EDIT - Is this specific to Flixel-Android? And would upgrading to the latest version fix this?
« Last Edit: Sat, Nov 10, 2012 by finalsin »

Wing Eraser

  • Contributor
  • ****
  • Posts: 460
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #6 on: Sat, Nov 10, 2012 »
I don't know if this is a flixel-android issue, because I haven't got this error before.
What does your code do to get the error? If you can place a code snippet then I'll try to run it.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #7 on: Sat, Nov 10, 2012 »
Creates a FlxText and adjusts the size of the text. It doesn't even add it to the stage. I'm pretty sure it's just any rendering code at all, and is actually a problem with Java 7 interacting with LibGDX. I just wanted to be sure.

Don't worry about running a test - if you haven't encountered the error I imagine it's on my end.

Wing Eraser

  • Contributor
  • ****
  • Posts: 460
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #8 on: Sat, Nov 10, 2012 »
There's a BitmapfontDemo which uses FlxText with different sizes. It doesn't produce your error. I'm afraid you need to do something about Java 7.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #9 on: Sat, Nov 10, 2012 »
Thanks for checking. LibGDX forums seem adamant it has nothing to do with Java 7 but I'm really not so sure. I'll keep poking at it.

Game still running beautifully on Android though, so thanks!

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #10 on: Sat, Nov 10, 2012 »
Upgrading everything to the latest version has fixed it. I've also taken a peek at the new API and it's looking really nice! Lots of changes that I really like a lot.

Congrats, and thanks for helping me out.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #11 on: Mon, Nov 26, 2012 »
Hey,

Thanks again - the new version is really nice, and I like the String-based resource names.

I'm having a weird bug I wanted to ask you about, in case it had come up before. Jumping works in the desktop version, which uses a isTouching(FlxObject.FLOOR) check before letting the player jump. In the Android version, though, the same check returns false. Have you ever encountered any bugs with isTouching?

Wing Eraser

  • Contributor
  • ****
  • Posts: 460
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #12 on: Tue, Nov 27, 2012 »
I haven't encountered the bug you mentioned before. Mode and FlxCollision demo 1 give the correct value back when touching the floor. I'm not sure if it's your code or if it has something to do with flixel-android.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #13 on: Tue, Nov 27, 2012 »
If in doubt it's more likely it's me. I'll check both demos, and crosscheck the jump code on my Android. I'll let you know.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #14 on: Sat, Dec 8, 2012 »
I just wanted to let you know that next Friday I'll be releasing A Puzzling Present for free on desktop platforms and Android, thanks to flixel-android.

http://www.gamesbyangelina.org/press/sheet.php?p=a_puzzling_present

I'll also post here about the paper I wrote on it when I get the conference reviews back. Can't express my gratitude enough! Will let you know how the release goes.

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #15 on: Fri, Dec 14, 2012 »
I'm getting some memory leaks in the game I've developed - I use a bunch of FlxEmitter/FlxParticle systems, do you know if there are any known issues with them, disposing and so on? Does flixel-android handle disposing of the LibGDX memory management stuff (http://code.google.com/p/libgdx/wiki/MemoryManagment) or is this something I should be handling in my own code?

Thanks! The game is now live, incidentally: https://play.google.com/store/apps/details?id=org.gba.pp&feature=search_result#?t=W251bGwsMSwyLDEsIm9yZy5nYmEucHAiXQ.. flixel-android made it happen!

Wing Eraser

  • Contributor
  • ****
  • Posts: 460
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #16 on: Sat, Dec 15, 2012 »
I went to though the list from the link you provided.

AssetManager: not used.
Bitmap: not used.
BitmapFont: used in FlxGame for showing the FPS. Itís not disposed, but this shouldnít give you the problem. It will be disposed when you exit the game.
BitmapFontCache: should be disposed by FlxAssetCache::disposeTextures() when switching state.
CameraGroupStrategy: not used.
DecalBatch: not used.
ETC1Data: not used.
FrameBuffer: not used.
Mesh: not used.
ParticleEffect: not used.
Pixmap: used by FlxSprite for coloring and FlxAssetCache for keeping the context when the game goes to the background (example by call).
PixmapPacker: not used.
ShaderProgram: not used.
Shape: used by FlxBox2D plugin, they are disposed correctly unless you used createFixture and didnít dispose it by yourself. I assumed you didnít use this plugin for your game.
Skin: not used.
SpriteBatch: used by FlxGame. Itís not disposed. Itíll be disposed when you exit the game.
Stage: not used.
SpriteCache: not used.
Texture: used by FlxAssetCache. Itíll be disposed when switching state.
TileAtlas: not used.
TileMapRenderer: not used.
World: used by FlxBox2D, disposed at B2FlxState::destroy().

I do assume you did disposing/nullifying your own objects, used object pooling and not creating new objects during runtime.

Could you update to the latest revision before I install your game on phone. Iíve only adjusted one small thing. And could you tell me when it crashes?

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #17 on: Sat, Dec 15, 2012 »
Let me look into some of the things you mention first and I'll get back to you. Thanks for the info!

finalsin

  • Member
  • **
  • Posts: 51
  • Karma: +0/-0
    • View Profile
Re: flixel-android 0.5
« Reply #18 on: Mon, Dec 17, 2012 »
I still haven't had time to look properly into this - I'm getting a LOT of GC_CONCURRENT calls at runtime, but I also wasn't careful with instantiation so there are some new() calls going on. Even so I think I'm probably not disposing of things properly. I need to look at this more carefully...

Here's another thing: I've had this crash through fifteen different users, but haven't had time to look at it yet. This might be my misuse of stuff or it might be a genuine hardware issue, I'm posting it here in case it's relevant to you but please ignore. If I find a fix I'll let you know:

Code: [Select]
java.lang.NoSuchMethodError: java.lang.String.isEmpty
at org.flixel.system.input.Input.reset(Input.java:59)
at org.flixel.FlxG.resetInput(FlxG.java:668)
at org.flixel.FlxG.reset(FlxG.java:1891)
at org.flixel.FlxGame.step(FlxGame.java:697)
at org.flixel.FlxGame.render(FlxGame.java:626)
at com.badlogic.gdx.backends.android.AndroidGraphics.onDrawFrame(AndroidGraphics.java:449)
at com.badlogic.gdx.backends.android.surfaceview.GLSurfaceViewCupcake$GLThread.guardedRun(GLSurfaceViewCupcake.java:713)
at com.badlogic.gdx.backends.android.surfaceview.GLSurfaceViewCupcake$GLThread.run(GLSurfaceViewCupcake.java:646)

This is being reported on startup, before even playing the game.

Wing Eraser

  • Contributor
  • ****
  • Posts: 460
  • Karma: +0/-0
  • ★★★★★
    • View Profile
    • Wing Eraser
Re: flixel-android 0.5
« Reply #19 on: Tue, Dec 18, 2012 »
Quote
I'm getting a LOT of GC_CONCURRENT calls at runtime, but I also wasn't careful with instantiation so there are some new() calls going on. Even so I think I'm probably not disposing of things properly.

I've never got GC_CONCURRENT. GC stands for Garbage Collection I think. You musn't create new objects during runtime. Create all objects in the create of your state and use object pool pattern. When you switch states, you've to diposed all objects that where created for the state.

The other error is solved at r123. Read this: http://code.google.com/p/flixel-android/issues/detail?id=33&can=1
And star the issue at libGDX tracker. I can't help you with this one. You'll have to wait for libGDX to solve this and he's taking a break for 2 weeks.

Edit: I'm looking at the ARMv6 maybe this cause the problem. I can't compile anything right now, because I modified flixel-core a lot to get things running again.
« Last Edit: Tue, Dec 18, 2012 by Wing Eraser »