kevglass
|
 |
«
Posted
2010-11-28 00:33:32 » |
|
I started worked on Slick on Android again (mostly inpsired by JPCT  ) a couple of days ago. Outlook seems to be good:  Performance is good and response is fine. Thanks to the wonderful LibGDX! Kev
|
|
|
|
oNyx
|
 |
«
Reply #1 - Posted
2010-11-28 03:05:45 » |
|
\  /
|
|
|
|
|
Games published by our own members! Check 'em out!
|
|
Nate
|
 |
«
Reply #3 - Posted
2010-11-29 01:58:54 » |
|
Cool! Runs fine on the Droid. Maybe log Gdx.graphics.getFramesPerSecond() every 5 seconds or so? Doesn't run on the G1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| 11-28 17:54:32.163: ERROR/dalvikvm(1129): Could not find method org.lwjgl.opengl.GL11.glMatrixMode, referenced from method org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer.enterOrtho 11-28 17:54:32.163: WARN/dalvikvm(1129): VFY: unable to resolve static method 4917: Lorg/lwjgl/opengl/GL11;.glMatrixMode (I)V 11-28 17:54:32.163: WARN/dalvikvm(1129): VFY: rejecting opcode 0x71 at 0x0004 11-28 17:54:32.163: WARN/dalvikvm(1129): VFY: rejected Lorg/newdawn/slick/opengl/renderer/ImmediateModeOGLRenderer;.enterOrtho (II)V 11-28 17:54:32.163: WARN/dalvikvm(1129): Verifier rejected class Lorg/newdawn/slick/opengl/renderer/ImmediateModeOGLRenderer; 11-28 17:54:32.163: WARN/dalvikvm(1129): Exception Ljava/lang/VerifyError; thrown during Lorg/newdawn/slick/opengl/renderer/Renderer;.<clinit> 11-28 17:54:32.163: DEBUG/AndroidRuntime(1129): Shutting down VM 11-28 17:54:32.163: WARN/dalvikvm(1129): threadid=3: thread exiting with uncaught exception (group=0x4001da28) 11-28 17:54:32.173: ERROR/AndroidRuntime(1129): Uncaught handler: thread main exiting due to uncaught exception 11-28 17:54:32.203: INFO/ActivityManager(84): Process com.android.vending (pid 1122) has died. 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): java.lang.ExceptionInInitializerError 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at org.newdawn.slick.SlickActivity.start(SlickActivity.java:47) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at org.newdawn.slick.android.SlickTestActivity.onCreate(SlickTestActivity.java:24) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at android.app.ActivityThread.access$2100(ActivityThread.java:116) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at android.os.Handler.dispatchMessage(Handler.java:99) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at android.os.Looper.loop(Looper.java:123) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at android.app.ActivityThread.main(ActivityThread.java:4203) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at java.lang.reflect.Method.invokeNative(Native Method) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at java.lang.reflect.Method.invoke(Method.java:521) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at dalvik.system.NativeStart.main(Native Method) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): Caused by: java.lang.VerifyError: org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): at org.newdawn.slick.opengl.renderer.Renderer.<clinit>(Renderer.java:23) 11-28 17:54:32.383: ERROR/AndroidRuntime(1129): ... 15 more |
|
|
|
|
CommanderKeith
|
 |
«
Reply #4 - Posted
2010-11-29 02:13:51 » |
|
Worked fine on the Samsung galaxy, android 2.1. Nice work!
|
|
|
|
badlogicgames
|
 |
«
Reply #5 - Posted
2010-11-29 02:30:24 » |
|
Good job! Drop me a line if you decide to move the nob to 11. Lot of stuff that could make it faster.
|
|
|
|
kevglass
|
 |
«
Reply #6 - Posted
2010-11-29 09:19:00 » |
|
Didn't really expect it to work on the G1 but then I didn't expect it to fail that way  Thanks for testing folks! @badlogicgames I'll happily move it to GL11 if thats what you mean, what sort of stuff can be done to speed it up? Kev
|
|
|
|
kevglass
|
 |
«
Reply #7 - Posted
2010-11-29 09:41:59 » |
|
Just got it tested on the local G1 here:  Though this one is running a MOD, not sure what the difference would be in classloading. G1 1.6 2.6.29.6-cyanogenmod CyanogenMod-4.2.15.1 DRC83 Runs like a dog as expected but came up and resumed fine. Kev
|
|
|
|
|
Matzon
|
 |
«
Reply #9 - Posted
2010-11-29 09:48:02 » |
|
works fine on my x10 - do make buttons large, hate small buttons... you'd think we were using a stylus 
|
|
|
|
Games published by our own members! Check 'em out!
|
|
kevglass
|
 |
«
Reply #10 - Posted
2010-11-29 09:48:57 » |
|
Heh, fair point. It was really just to prove an old Slick game would work on Android with the new stuff - so the game wasn't really designed for the small screen.
Kev
|
|
|
|
kevglass
|
 |
«
Reply #11 - Posted
2010-11-29 10:37:04 » |
|
Sorry for spammy updates but Endolf confirms it works (albeit slowly) on the Hero too.
Kev
|
|
|
|
badlogicgames
|
 |
«
Reply #12 - Posted
2010-11-29 10:38:06 » |
|
@badlogicgames I'll happily move it to GL11 if thats what you mean, what sort of stuff can be done to speed it up?
GL11 wouldn't help a lot (and isn't supported by all devices either). But that game could run perfectly fine on the G1. Just need to rework some of the renderer stuff.
|
|
|
|
strategy
|
 |
«
Reply #13 - Posted
2010-11-29 10:41:59 » |
|
Ooh... now we're talking. I'm already working with Slick for my desktop projects, and Slick for Android would be very interesting (assuming I could get it to work for 1.5). Will test this on my Magic later.
|
|
|
|
kevglass
|
 |
«
Reply #14 - Posted
2010-11-29 10:50:30 » |
|
@badlogic - any details?, I'll start making the changes at lunch  @strategy - have to keep pointing it out, Slick works on Android - but it's really down to the LibGDX which is totally awesome. it's an enabler for me but it's a fantastic library on it's own! Kev
|
|
|
|
strategy
|
 |
«
Reply #15 - Posted
2010-11-29 11:07:21 » |
|
@strategy - have to keep pointing it out, Slick works on Android - but it's really down to the LibGDX which is totally awesome. it's an enabler for me but it's a fantastic library on it's own!
Absolutely. But having a good 2D abstraction layer around libgdx's 3D world should make for cleaner code - code that is hopefully easier to build and maintain - for those of us who do 2D apps, but would like to leverage the GL for the performance benefits. At least in theory. 
|
|
|
|
kevglass
|
 |
«
Reply #16 - Posted
2010-11-29 11:14:29 » |
|
On the bright side it's forcing me to tighten up code I would have otherwise ignored  Kev
|
|
|
|
kevglass
|
 |
«
Reply #17 - Posted
2010-11-29 13:11:40 » |
|
Thought I'd try it with something a bit more meaty, see what breaks. This is my latest hack job "Warpstone". It does procedural dungeon generation, navmesh based path finding and dynamic lighting using tile based vertex colours with smoothing...  Yep, it runs like a dog, still playable though. Seems good for a non-optimized first hack at this stuff. Android really is starting to look great!  No difference to code to the desktop one that looks like this:  Kev
|
|
|
|
EgonOlsen
|
 |
«
Reply #18 - Posted
2010-11-29 13:33:30 » |
|
Crashes instantly on my Samsung Galaxy with Android 1.5. Exception is something about java.lang.VerifyError in Renderer.java line 23 (can't post the complete log right now, but it's not much more illustrative anyway).
|
|
|
|
kevglass
|
 |
«
Reply #19 - Posted
2010-11-29 13:37:58 » |
|
Probably similar to the G1 failure above.
Kev
|
|
|
|
EgonOlsen
|
 |
«
Reply #20 - Posted
2010-11-29 13:46:01 » |
|
Yep, it's the same issue. I haven't seen that post correctly on the phone's browser... 
|
|
|
|
kevglass
|
 |
«
Reply #21 - Posted
2010-11-29 13:49:42 » |
|
Looks like something a bit different in the classloading in 1.5 vs 1.6. Thanks for testing!
Kev
|
|
|
|
gouessej
|
 |
«
Reply #22 - Posted
2010-11-29 14:26:00 » |
|
Hi!
It does not work on my HTC G1 with Android 1.5 (official version) neither.
|
|
|
|
kevglass
|
 |
«
Reply #23 - Posted
2010-11-29 14:30:18 » |
|
So do I try and fix it, or just stick a 1.6+ sticker on it  Kev
|
|
|
|
badlogicgames
|
 |
«
Reply #24 - Posted
2010-11-29 17:10:47 » |
|
@badlogic - any details?, I'll start making the changes at lunch  https://bob.newdawnsoftware.com/repos/slick/trunk/Slick-AE/src/org/newdawn/slick/renderer/GDXRenderer.javaI told you via IRC 2 days ago to switch to BufferUtils.copy() instead of this 1 2 3
| 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: 1
| 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. Absolutely. But having a good 2D abstraction layer around libgdx's 3D world should make for cleaner code - code that is hopefully easier to build and maintain - for those of us who do 2D apps, but would like to leverage the GL for the performance benefits. At least in theory.  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 
|
|
|
|
kevglass
|
 |
«
Reply #25 - Posted
2010-11-29 21:39:25 » |
|
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
|
|
|
|
|
badlogicgames
|
 |
«
Reply #27 - Posted
2010-11-30 01:12:02 » |
|
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 
|
|
|
|
badlogicgames
|
 |
«
Reply #28 - Posted
2010-11-30 01:48:08 » |
|
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 :p 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 
|
|
|
|
kevglass
|
 |
«
Reply #29 - Posted
2010-11-30 07:58:28 » |
|
|
|
|
|
|