Author Topic: jPCT goes Android  (Read 29034 times)

Online EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 10248
    • View Profile
    • http://www.jpct.net
jPCT goes Android
« on: December 12, 2007, 12:20:23 am »
I've started to port jPCT over to Android (http://code.google.com/android/). It can already do some nice things, as you can see here:





This will be a port, i.e. a branch exclusively for Android (called jPCT-AE). The "normal" version of jPCT isn't affected and both versions won't be compatible (albeit very close as far as Android permits it). Sadly, the emulator doesn't do hardware acceleration ATM, which makes the port run quite slow and it has problems with more advanced features like multi texturing. However, i'm quite satisfied considering that this is the result of one evening of porting.

BTW: Debugging Android applications isn't fun... :'(
« Last Edit: December 12, 2007, 10:13:37 am by EgonOlsen »

Offline raft

  • quad
  • ******
  • Posts: 1773
    • View Profile
    • http://www.aptalkarga.com
Re: jPCT goes Android
« Reply #1 on: December 12, 2007, 12:35:37 am »
hey that's really cool  :o
here comes a new era, i believe such a port will enable so much possibilities for mobile 3d applications  ;D

i cant wait to see the progress..

r a f t

Offline JavaMan

  • long
  • ***
  • Posts: 230
    • View Profile
Re: jPCT goes Android
« Reply #2 on: May 25, 2008, 07:04:24 pm »
Have you made any more progress with jpct on Android? I'm thinking about the Android developer challenge II. I'd like to use jpct for my submission, thats if I decide to do it. Just wondering if you're still working on the port. ::)

Jman

Online EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 10248
    • View Profile
    • http://www.jpct.net
Re: jPCT goes Android
« Reply #3 on: May 25, 2008, 07:35:47 pm »
No, i paused this port. It was just too slow to be of use. Maybe it will be better on actual hardware, but if the emulator reflects hardware performance, it's just not worth it ATM... :'(

Offline JavaMan

  • long
  • ***
  • Posts: 230
    • View Profile
Re: jPCT goes Android
« Reply #4 on: May 26, 2008, 01:32:40 pm »
Oh, ok. If it isn't fast enough then why build it?
Thanks for the quick reply.

Jman

Offline cyberkilla

  • float
  • ****
  • Posts: 413
    • View Profile
    • http://futurerp.net
Re: jPCT goes Android
« Reply #5 on: August 19, 2008, 09:46:31 pm »
No, i paused this port. It was just too slow to be of use. Maybe it will be better on actual hardware, but if the emulator reflects hardware performance, it's just not worth it ATM... :'(

I would have thought that it would be installed on phones with various types of hardware. Is this not the case?
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG

Online EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 10248
    • View Profile
    • http://www.jpct.net
Re: jPCT goes Android
« Reply #6 on: August 19, 2008, 10:03:24 pm »
I think so. But the question is, how good fpu and actual graphics hardware (if there is any and not just emulation) would perform. In its current state, it's much too slow when using the emulator.

Offline raft

  • quad
  • ******
  • Posts: 1773
    • View Profile
    • http://www.aptalkarga.com
Re: jPCT goes Android
« Reply #7 on: August 19, 2008, 10:21:45 pm »
for the android emulator, i still believe hardware acceleration can be enabled by bridging it to opengl library of host os. but unfortunately i dont have the skills to set it up. i posted about this to android internals group but didnt helped much:

http://groups.google.com/group/android-internals/browse_thread/thread/5bf6dd5bf471a564/cb836be40d60ec14




Online EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 10248
    • View Profile
    • http://www.jpct.net
Re: jPCT goes Android
« Reply #8 on: August 21, 2008, 12:01:44 pm »
Maybe, but floating point performance was rotten as well. It was impossible to get decent collision detection running in this emulator. The whole idea of recompiling Java-bytecode to another, proprietary VM's bytecode that runs with sub-par performance (but uses less resources) is questionable IMHO.

Offline raft

  • quad
  • ******
  • Posts: 1773
    • View Profile
    • http://www.aptalkarga.com
Re: jPCT goes Android
« Reply #9 on: August 21, 2008, 11:25:34 pm »
well, maybe the emulator sucks on such stuff but the actual g-phone may perform much better. it least i hope so. do you remember the film quake 1 is ported to g-phone ? it was performing quite well. i'm not sure if quake 1 is using float operations but possibly it does. cant see a reason why native code performs good on float operations but vm does not. i will name the other way a bug of dalvik vm ;)

btw, i liked the api android provides. they nicely addressed the low memory requirements of such devices. i know a little about the api since we have developed an application for the contest. we wasnt even in the first %50 which i think is a shame of google but that's another story :o

Offline zammbi

  • float
  • ****
  • Posts: 359
    • View Profile
Re: jPCT goes Android
« Reply #10 on: October 25, 2008, 07:54:55 am »
I been looking a lot into android to see where its heading. I might program a few things for it latter when I have the time.
I see that theres also many people with your problem EgoOlsen, of the emulator being too slow. Some are testing parts of there 3d programs in Java. I hope you do finish this off, but seems you might need the hardware to do it. I see a number of people already asking for a high level 3d library, so a lot people would really like this.

I see there was some work done with JME: http://www.renanse.com/blog/2007/12/early-android-results.html but since he no longer works on JME, that might of stopped.

Already 3d games are starting to show: http://www.youtube.com/watch?v=tEWYHpQWU5I , http://www.omnigsoft.com/Android/ADC/readme.html
« Last Edit: October 25, 2008, 10:35:06 am by zammbi »

Online EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 10248
    • View Profile
    • http://www.jpct.net
Re: jPCT goes Android
« Reply #11 on: April 21, 2009, 11:39:58 pm »
A small update: I gave that s**t another try (and from the wording, you can guess the outcome...) using the latest Android SDK version. They have removed the OpenGLContext without giving any hint of what to use instead. Great! Combine that with a virtually non-existent documention for most GL-related classes (and why on earth are they using a doc-format that you can't link into Eclipse while they provide an Eclipse-plugin for Android?) and you have lots of fun. Anyway, i managed to port my old port from 2007 to this new version somehow...and it doesn't even start. The emulator bombs out with some "libhgl.so not found" message when trying to create the EGLDisplay and all calls to GL fail afterwards. I've given up again and i'm waiting for the next release...maybe...

Offline fireside

  • double
  • *****
  • Posts: 590
    • View Profile
Re: jPCT goes Android
« Reply #12 on: April 22, 2009, 02:01:13 am »
I looked around just for something to do.  I found this sample dated Sept 2008:
http://android-developers.blogspot.com/search/label/OpenGL%20ES

Don't know if it's obsolete already. 
click here->Fireside 7 Games<-

Offline JavaMan

  • long
  • ***
  • Posts: 230
    • View Profile
Re: jPCT goes Android
« Reply #13 on: April 22, 2009, 03:05:35 am »
A small update: I gave that s**t another try (and from the wording, you can guess the outcome...) using the latest Android SDK version. They have removed the OpenGLContext without giving any hint of what to use instead. Great! Combine that with a virtually non-existent documention for most GL-related classes (and why on earth are they using a doc-format that you can't link into Eclipse while they provide an Eclipse-plugin for Android?) and you have lots of fun. Anyway, i managed to port my old port from 2007 to this new version somehow...and it doesn't even start. The emulator bombs out with some "libhgl.so not found" message when trying to create the EGLDisplay and all calls to GL fail afterwards. I've given up again and i'm waiting for the next release...maybe...

Sounds like that wonderfully hideous system called Android to me. Android was so stupidly complex when I checked it out, and the docs confusing.
« Last Edit: April 22, 2009, 03:44:33 am by JavaMan »

Online EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 10248
    • View Profile
    • http://www.jpct.net
Re: jPCT goes Android
« Reply #14 on: April 22, 2009, 08:26:59 am »
I looked around just for something to do.  I found this sample dated Sept 2008:
http://android-developers.blogspot.com/search/label/OpenGL%20ES

Don't know if it's obsolete already. 
That contains the same code that i've based my stuff on...it just doesn't work. Creating the GL display fails...here:

Code: [Select]
mEgl = (EGL10) EGLContext.getEGL();

/*
* Get to the default display.
*/
mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY); // <- Fails while trying to load the native lib "libhgl.so"

No idea why...and i haven't found any solution but people having similar problems.