Yep, it’s the same issue. I haven’t seen that post correctly on the phone’s browser…
Looks like something a bit different in the classloading in 1.5 vs 1.6. Thanks for testing!
Kev
Hi!
It does not work on my HTC G1 with Android 1.5 (official version) neither.
So do I try and fix it, or just stick a 1.6+ sticker on it
Kev
I told you via IRC 2 days ago to switch to BufferUtils.copy() instead of this
vertices.put(verts,0,vertIndex*3);
colors.put(cols,0,vertIndex*4);
textures.put(texs,0,vertIndex*2);
in flushBuffer(). It should already increase your framerate.
Your 1.5 crashing issue is due to you referencing an lwjgl class:
Could not find method org.lwjgl.opengl.GL11.glMatrixMode, referenced from method org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer.enterOrtho
Get rid of that in all Android code.
libgdx is not a 3D engine. It has a shitton of classes for 2D and 3D game development. No limits there, no scenegraph imposed on you. As said above, check the test samples or the 2D rendering part of the sample game. Or use Slick on top of libgdx
Great stuff, yeah I missed the comments on IRC even the second time
As to the class error above, I understand the issue but I can’t quite see why it would be different on 1.5 to 1.6
Kev
Updated the APK:
http://dl.dropbox.com/u/1668516/android/Slick-Android-Test.apk
Might work on those 1.5 devices now, also added the optimization above. Thanks!
Kev
Awesome! Did you measure the difference? I guess on your mighty Evo you won’t see any. Will test on my 1.5 Hero and reprot back.
@Class loading issue: they change the Dalvik internals a lot in each version. Class loading on <= 1.5 is a bit of a pos. They fixed it in 1.6 (e.g. imports do not factor into the calculation anymore, only when you actually reference the class in executing code it will get loaded). Silly, but true story
Still explodes on my 1.5 Hero. Verifier Error. Here’s the problem.
In GdxGameContainer you have an import of LwjglApplication. Additionally you have a method called GdxGameContainer.start() which seems to be used on the desktop only, so that code path gets never executed on Android. Now, in your SlickActivity you instantiate a GdxGameContainer. On 1.5 all the classes in all of the code of GdxGameContainer are being loaded (well at least verified), be they executed or not. This makes kitty assplode in my face. Suggestions: make a base GdxGameContainer implementing the all the functionality except for start() and setAndroidApp(). Derrive one class for Android and one for Lwjgl and use those were appropriate.
You will make a lot of people happy. The market statistics are actually inflated. There’s more 1.5 devices around than are shown on the dashboard. The reason is that people that just bought their phone are more likely to show up in the monthly statistics than people that bought a 1.5 device half a year ago.
Also, just because devices are >= 1.5 doesn’t mean they don’t suck still I could update my Hero to 2.1 and it would still run like shit. Low to mid-end hardware will not go away as that’s actually one of the “strengths” of Android, allowing device manufacturers to create shitty phones for low prices, perfectly suited for the masses that are non-geeks. The bulk of the 2.1 devices that show up on the Android market dashboard are actually updated Moto Blurs, Heros etc. Sad but true story
Still fails with a Verify Error on 1.5…something about Image/AngelFont… IIRC.
Updated again.
http://dl.dropbox.com/u/1668516/android/Slick-Android-Test.apk
The renderer update had a great effect. I’m using my Warpstone game as a test case - it went from 20fps to 40fps on my Desire HD. Have to try and get it up to 60ish on here.
Kev
disable blending when possible. all devices are fillrate limited and blending kills the GPU’s tiling engine.
Not sure that’ll be very possible in 2D games, unless Alpha Testing is less costly?
Kev
[quote=“kevglass,post:32,topic:35957”]
I’ve androidised (read: no garbage produced) this profiling utility. Code over here. Dead easy to use, and less impact than TraceView.
Still no luck. org.lwjgl.BufferUtils/PointerBuffer is used in PNGImage…something.
alpha testing is even worse for various reasons. Iirc it’s not even supported in GLES 2.0 (might be totally wrong on this). Your dungeon slasher looks like it does not need any blending for the tile map, lighting is done on a per vertex level, right? Could give you a nice speed boost.
The tiles have transparent areas on them.
Kev
Updatd the APK again if anyone has the time to try again on 1.5
http://dl.dropbox.com/u/1668516/android/Slick-Android-Test.apk
Kev
At least the first layer of tiles should be opaque?