www.jpct.net

General => News => Topic started by: EgonOlsen on December 12, 2007, 12:20:23 am

Title: jPCT goes Android
Post by: EgonOlsen on December 12, 2007, 12:20:23 am
I've started to port jPCT over to Android (http://code.google.com/android/ (http://code.google.com/android/)). It can already do some nice things, as you can see here:

(http://www.jpct.net/pix/android1.jpg)

(http://www.jpct.net/pix/android2.jpg)

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... :'(
Title: Re: jPCT goes Android
Post by: raft 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
Title: Re: jPCT goes Android
Post by: JavaMan 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
Title: Re: jPCT goes Android
Post by: EgonOlsen 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... :'(
Title: Re: jPCT goes Android
Post by: JavaMan 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
Title: Re: jPCT goes Android
Post by: cyberkilla 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?
Title: Re: jPCT goes Android
Post by: EgonOlsen 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.
Title: Re: jPCT goes Android
Post by: raft 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



Title: Re: jPCT goes Android
Post by: EgonOlsen 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.
Title: Re: jPCT goes Android
Post by: raft 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 (http://groups.google.com/group/android-challenge/browse_thread/thread/af7260fddd7f80a7/c6f8b3f0cb2e047c) for the contest. we wasnt even in the first %50 which i think is a shame of google but that's another story :o
Title: Re: jPCT goes Android
Post by: zammbi 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
Title: Re: jPCT goes Android
Post by: EgonOlsen 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...
Title: Re: jPCT goes Android
Post by: fireside 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. 
Title: Re: jPCT goes Android
Post by: JavaMan 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.
Title: Re: jPCT goes Android
Post by: EgonOlsen 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.
Title: Re: jPCT goes Android
Post by: zammbi on April 22, 2009, 10:02:27 am
Well I seen a lot of full 3d games, so it has to be possible  :-\
Title: Re: jPCT goes Android
Post by: EgonOlsen on April 22, 2009, 10:23:53 am
It used to work with the old SDK. The examples for the new one work too, but their integration in the system itself seems to be different than what you get when starting your own Activity. Anyway, i don't like the whole feel of the platform, performance seems to be worse instead of better and the documentation is really lacking.
Title: Re: jPCT goes Android
Post by: fireside on April 28, 2009, 03:33:04 am
I just saw this:
http://www.brighthub.com/mobile/google-android/articles/32012.aspx

It would be nice if you could get it working.  They may have an app store something like Apples.
Title: Re: jPCT goes Android
Post by: raft on April 28, 2009, 04:35:04 am
andoid has a store indeed. google for 'android market'
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 09, 2009, 11:12:48 pm
I've given the 1.5 of the Android SDK release a try. They have reworked the GL related stuff again and added a class to ease things...and it really does. For now, the port from 2007 works fine again (but still no hardware acceleration). However, i've to bring this sucker up to the current version of jPCT, complete it and see what happens then...i'm not expecting too much...
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 12, 2009, 11:21:12 pm
Update: I've ported the important parts from jPCT 1.18 (without any further refactoring, which is needed...) to Android. Performance is better than with the old port, the bug with multi texturing in the emulator is gone  ;D. Sadly, there's another bug in the emulator that causes vertex lighting to be wrong (http://code.google.com/p/android/issues/detail?id=1709 (http://code.google.com/p/android/issues/detail?id=1709)...why not vote for it!?), which is pretty annoying  :'(. I'll continue working on the rest of the code though...
Title: Re: jPCT goes Android
Post by: zammbi on July 13, 2009, 09:08:34 am
Says the issue has been closed.
I hope you will be able to release something. Seems Android has come to NZ so I might buy one soon and start some development.
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 13, 2009, 11:21:42 am
Yes, they have closed it today. About time after more than half a year...
Title: Re: jPCT goes Android
Post by: AGP on July 13, 2009, 08:34:41 pm
Does closing mean they solved it? If so, does it mean we may get an Android version some time soon?
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 13, 2009, 10:27:29 pm
Does closing mean they solved it? If so, does it mean we may get an Android version some time soon?
I guess so, but i'm not 100% sure. It's closed with status FutureRelease, so i assume that it'll make it into,well...a future release. Not sure, if that means that it'll make it into the next one. I think it should, because it really hurts OpenGL ES with the emulator but maybe that has low priority anyway.
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 14, 2009, 11:30:21 pm
I now have a stripped version of jPCT...not really finished but somewhere in between and i tried to load the fps-example in Android. After bothering with some memory restrictions (i can't find a way to increase the VM's memory...), it somehow worked. But that Dalvik-VM is so f*'!"%&ing slow, that you can't use any advanced feature like collision detection without reverting to seconds per frame. All it seems to be to good for, is to rotate some cubes or similar and it's questionable if you need something like jPCT for that. Anyway, i'm going to work further on the port tomorrow and see how this turns out...

It was fun to remove lots of legacy code, which isn't needed on Android, from jPCT anyway... ;)
Title: Re: jPCT goes Android
Post by: zammbi on July 15, 2009, 10:27:41 am
Slow on the emulator or the device itself? If people can port a quake 3, surely jpct would be fine...
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 15, 2009, 10:54:56 am
Yes, they port a Quake3 level VIEWER...i can do that too with mediocre performance. But as soon as you add something that a real game requires, like collision detection let alone adding a physics engine, you are stuck. The device has no FPU. That doesn't really matter that much for the graphics itself because that's basically pushing data chunks down the GL pipeline, but for any floating point calculation, it simply kills performance. A mobile device that claims that it can do 3D, that even may have a dedicated GPU, should have a FPU IMHO.

Anyway, i'll try to optimize some floating point code and see if that helps.
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 15, 2009, 08:16:36 pm
I managed to improve the performance somewhat and streamlined the api some more, but i think that i need an actual device to make real progress. As slow as Dalvik is, the emulator manages to render around 40-50fps in the fps demo on a lowly Core2 Duo @ 2.2Ghz (my dedicated Android development machine... ;D), but only IF (BIG IF!) i omit the actual rendering call. Adding this call, performance drops to 2-6 fps, which is abysmal. The software renderer that the emulator uses is extremely slow and hardly usable at all. An actual device may render faster because it has dedicated hardware for this (or hasn't it?...3d seems to be deeeeeep down on the priority list. I can hardly get any information about that. The Samsung i7500 looks promising, but even samsung doesn't mention its cpu type let alone if it has a gpu or not), but then again, it's cpu is slower...

Title: Re: jPCT goes Android
Post by: zammbi on July 16, 2009, 01:42:28 am
Well what I last read is that the emulator is still slower then the device. There's a large range of derives too. I might get the Magic.
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 16, 2009, 08:09:05 am
I tried to find out if the HTC Magic has a GPU...i failed. Any information about this is highly appreciated.

Edit: It seems to have one...unless the "a" in MSM7201a means that it has been scraped from the MSM7201...However, still no info on the Samsung... ???

Edit2: Samsung seems to use the MSM7200a, i.e. HTC Magic-1...whatever that means...
Title: Re: jPCT goes Android
Post by: zammbi on July 16, 2009, 08:55:58 am
Get something out then people can test :)
A lot of optimisations built in that you take for granted in Java isn't in android, so you might find something to speed some areas up.
Title: Re: jPCT goes Android
Post by: raft on July 16, 2009, 09:00:28 am
my two cents still goes to trying to run emulator on top of host vm's open gl..
i'm kind of stubborn i guess ;)
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 16, 2009, 10:44:58 am
Get something out then people can test :)
A lot of optimisations built in that you take for granted in Java isn't in android, so you might find something to speed some areas up.
Actually, jPCT already does most things in the way that google considers to be best practice for Android.
Title: Re: jPCT goes Android
Post by: zammbi on July 18, 2009, 07:29:13 pm
Well there was that Quake 1 game that seem to run fine and that was before android was released. So I have confidence in your abilities  :D

Also, not that I like the idea, but you could use C for the collisions: http://arstechnica.com/open-source/news/2009/06/android-goes-beyond-java-gains-native-cc-dev-kit.ars
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 18, 2009, 11:20:06 pm
Yeah, i thought about it...but no. It's heavily intermixed with the rest of the engine, so it would be hard to separate it and rewrite it in C. Plus i don't think that this is the right way. It's just a poor man's excuse for delivering a shitty VM. I'll try to get my hands on a phone sooner or later and see how the real thing performs. If it's ok, i'll continue and release the port. If it's not, i won't...it would be pointless then anyway.
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 19, 2009, 11:29:28 pm
I've ordered a Samsung Galaxy I7500 now...we'll see how it performs.
Title: Re: jPCT goes Android
Post by: JavaMan on July 20, 2009, 05:55:08 am
Cool! Hope it is faster.
Title: Re: jPCT goes Android
Post by: zammbi on July 20, 2009, 07:41:25 am
Quote
the Galaxy will come with 7.2 Mbps HSDPA connectivity, 3.2 inch HVGA AMOLED Touch Screen display, 8GB Internal memory and 5 Megapixel camera with Autofocus
Seems very nice. Hope it all goes well.
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 20, 2009, 10:59:12 am
Quote
the Galaxy will come with 7.2 Mbps HSDPA connectivity, 3.2 inch HVGA AMOLED Touch Screen display, 8GB Internal memory and 5 Megapixel camera with Autofocus
Seems very nice. Hope it all goes well.
I hope that too. If not, i have an expensive, 24 month lasting contract for a phone that i actually don't really need... ;D
Title: Re: jPCT goes Android
Post by: JavaMan on July 20, 2009, 02:34:50 pm
I thought about getting one, but wow after checking the price. Yikes! They are expensive; too expensive for a freshman college dude like me.
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 27, 2009, 10:03:10 pm
The phone has finally arrived...it's a nice piece of hardware and all...it just can't do hardware 3D... >:( At least i don't know how. Even the simplest example uses software rendering when run on the phone. Searching for information about hardware 3d on Android is like looking for information about sexual intercourse in a monastery. Most people that claim that it is supported never actually tried it. There are some games that use it, but they seem to rely on their own libs. At least they don't run on the VM but use it as a vehicle to start their own, native stuff.
Even the NDK (the native SDK) doesn't seem to support hardware 3d yet (according to the sparse information that is available on the net).
Title: Re: jPCT goes Android
Post by: zammbi on July 28, 2009, 12:04:16 pm
That's a bugger seems only G1 is supporting hardware 3D. Maybe some info here can help you : http://www.anddev.org/viewforum.php?f=2 they seem to have some 3D tutorials, though I haven't looked into it.
Title: Re: jPCT goes Android
Post by: EgonOlsen on July 28, 2009, 12:18:55 pm
I somehow doubt even that. There's no question that the hardware can do it on all Android phones, but the software seems to lack behind. I've found some information from Google, that Android 1.0 can't do it but i've never found anything about 1.1 or 1.5. Some people are asking about it, but all the answers fit into one of these categories:


Which all basically mean: "I've no idea, but i'm sure it can!"

In other words: I haven't found any good source of information yet. Priority of 3D support seems to be somewhere under the carpet for Google. Otherwise, they could make a simple statement like: Yes or no, and which preconditions have to be met for yes (if any). There is no such thing. At least i haven't found it.

Title: Re: jPCT goes Android
Post by: EgonOlsen on July 31, 2009, 09:58:59 pm
A short summary for those who aren't following the thread on JGO (http://www.javagaming.org/index.php/topic,20910.0.html (http://www.javagaming.org/index.php/topic,20910.0.html)): The Samsung can do hardware 3D (Omnigsoft's games make use of it as well as the Neocore demo and they both run just fine on the device), but somehow it doesn't work when using the Dalvik VM (which is what we are talking about here). The HTC Hero uses the exact same chipset and seems to be able to do hardware 3D within the VM. I don't get it...
Title: Re: jPCT goes Android
Post by: EgonOlsen on August 15, 2009, 11:31:47 pm
I did some tests (like mentioned in the thread on JGO), and the result is: The Samsung can do 3D, just not with the Dalvik VM. I've written to their support (couldn't even select the phone from the list...the don't seem to like it), but i don't expect much... :'(
Title: Re: jPCT goes Android
Post by: JavaMan on August 16, 2009, 05:14:16 am
So much for Google's claim when Android came out:"We're going to have OpenGL3D Graphics on compatible hardware."
Title: Re: jPCT goes Android
Post by: raft on December 23, 2009, 02:10:46 pm
so what's the final status of this port ?

if i get it correctly, jPCT can render in Andoid but Android HW support isnt there yet. But it be will someday for sure.

collision detection is too slow because the phones lack an FPU. i think jPCT can still be very valuable without collision detection. isnt it possible to implement collisions without floats ? ie: using integer values with some proper scaling
Title: Re: jPCT goes Android
Post by: raft on December 23, 2009, 02:13:34 pm
forgot to say: a friend of mine has a HTC Tattoo (http://www.htc.com/www/product/tattoo/specification.html) with Android 1.6. if you provide a test app we can run it on device
Title: Re: jPCT goes Android
Post by: raft on December 23, 2009, 02:40:44 pm
and what is the status of your Samsung after applying the fix at JGO (http://the fix at JGO) for HW acceleration ?
Title: Re: jPCT goes Android
Post by: EgonOlsen on December 23, 2009, 03:09:03 pm
I haven't seen this "fix" yet. Thanks for pointing that out. Maybe i'll have another look at the port, but to be honest: My motivation to do so hasn't increased. At first, i'll have a look at the differences between 1.5, 1.6 and 2.0. If it's not possible to support all three versions with one source code, i may ditch the whole thing anyway.

In addition, i have to merge the changes that i made to jPCT in between into the port, which is really annoying work to do...
Title: Re: jPCT goes Android
Post by: raft on December 23, 2009, 03:44:52 pm
just to make sure you saw my previous posts. they were three in a row so i guess you only saw the last one ;)
Title: Re: jPCT goes Android
Post by: EgonOlsen on December 27, 2009, 06:17:10 pm
I have noticed all your posts, don't worry... ;) I've tried the fix and it works that way. Strange thing is, that i already tried this myself but using the default method for setting the depth instead of writing my own config chooser and that didn't work. Anyway, Dalvik's performance still sucks. I'll try to merge my post-port-changes into the port and decide what to do with it afterwards. 3D in Java is a small niche...3D on Android isn't even that. I'm not conviced that all this work is worth anything with the current state of hard- and software of these smart phones.
Title: Re: jPCT goes Android
Post by: raft on December 27, 2009, 06:30:50 pm
how much sucks ? what fps at what polygon count ?
Title: Re: jPCT goes Android
Post by: EgonOlsen on December 28, 2009, 11:42:07 pm
It's not sooo much about polygon count, more about doing additional calculations like simple rotations, animations...let alone collision detection. And memory is really limited...you can't do very much before running into an out of memory. I can still slightly improve this though.
I'm half way through merging the current jPCT version's changes to the port. The overall process is really annoying. The phone is sooo slow and so is the emulator. You could be 10 times more productive if it wouldn't take ages even to initialize the simplest scene.
A rough estimate are 20fps for a simple scene. My test case is a plane, two trees and a rock and that thing runs at around that speed on my phone. It's not that bad, but not very impressive either. Plus some stuff just doesn't work. Linear attenuation of light sources for example took me whole evening just to figure out that it doesn't seem to work properly neither in then emulator nor on the phone... >:(
Title: Re: jPCT goes Android
Post by: raft on February 11, 2010, 04:09:33 pm
i friend of mine had an android developer phone: HTC Dream (http://en.wikipedia.org/wiki/Htc_dream)

for cpu, it's written:
Quote
CPU: The MSM7201A is an ARM-based, dual-core CPU/GPU from Qualcomm and contains many built-in features, including 3G and a GPU capable of up to 4 million triangles/sec. It has hardware acceleration for Java,[23] but this does not accelerate execution of Android applications, as they are targeted to the Dalvik VM, not the Java VM.

which really doesnt make any sense to me. how can not it accelerate android apps if they use native interface ???
Title: Re: jPCT goes Android
Post by: raft on February 11, 2010, 05:42:57 pm
jME team announced jME3 will support Android: http://jmonkeyengine.com/blog/blog/2010/02/10/android-support-confirmed-for-jme3/
Title: Re: jPCT goes Android
Post by: EgonOlsen on February 11, 2010, 08:59:08 pm
Sure...that's the second time they are announcing this.  Android's VM isn't really able to handle jPCT...not performance and not memory wise...i doubt that it can handle JME. IMHO, Android support will never make it into JME...but we'll see. Regarding my own stuff, i'm still undecided. I don't like the fact that they are spitting out Android versions as if there is no tomorrow. It's impossible to test on 1.5, 1.6, 2.0, 2.1...and which one should one target ???

Title: Re: jPCT goes Android
Post by: raft on February 11, 2010, 09:34:46 pm
arent the SDK's backward compatible ? you can follow the same strategy as you do for desktop jPCT. ie: target a reasonable lowest version and additional features may depend on running version

emulators support all versions i suppose. if your concern is real life testing, community would do it ;)

for performance and memory: i dont think google would let go Android, possibly it would be in market for a long time. in time new phones' performace and memory wil increase for sure.

last month i've joined a seminar in a university about game development. one of the speakers was a turkish guy working at heavy iron studios. someone asked how to decide minimum requirements of a new developing game, he answered: target the highest hardware available on the market. minimum time for a game development is 1-2 years, and after that much time the highest hardware of now will be average. i suppose same applies here ;)

anyway, it's your engine and your call. but if you port it to android, i will -at least- attempt to make a light karga on top of it..
Title: Re: jPCT goes Android
Post by: EgonOlsen on February 11, 2010, 10:33:16 pm
I'm not sure if they are backward compatible...code for 1.1 didn't work on 1.5. When i find the time, i'll look into it...
Title: Re: jPCT goes Android
Post by: .jayderyu on February 13, 2010, 12:02:44 am
It would be cool to see jPCT go Android. Though I don't know if any of the current users would make a lot of use of it. Then again maybe it would bring in a new crew of people and interest?

Though honestly jME is the LAST Java 3d engine I would put on Android(Except for Java3D). It's bloated and a heavy weight game engine. Android would need a lean and mean version of a SceneGraph or something similar to jPCT. I also wouldn't consider Ardor3d, or Ogre from the CPP entries. These are full fledge apis, not something you can shoehorn into a small portable device just because it has OpenGL ES.

I dropped jME because of it's heavy weight for webstart and applets. If I ever do a full size PC like game. Then yeah I would probably go to Ardor3d or jME. But for smaller, leaner, meaner games. jPCT all the way.

Personally I don't like the answer given for development time. Though the idea has merit. However look at the state of game development companies of Blizzard compared to any other PC developer. It's clear Blizzard doesn't consider "average" future computer a valid enough of a target. If theres complaints about that, then theres more than enough evidence to show that Blizzard does better than most other PC game developers in regards to profit per product. I think it would better to assume current average now, then that becomes the minimal standard after development time. ( my sister in law STILL plays Diablo 2. And she doesn't like any other PC games or VG violence.)
Title: Re: jPCT goes Android
Post by: raft on February 13, 2010, 03:24:07 pm
anyway, it's your engine and your call. but if you port it to android, i will -at least- attempt to make a light karga on top of it..
i want to make my statement clear here. i dont want to put any pressure on this porting. it's true that i want to do something related to karga on android, but i also want to do several other things about karga. but the reality is i did very less in the past 3 years. i was dedicated to karga when developing it as a full time job, but it's not the case now.

i mean, i dont want to feel guilty if jPCT is ported to android and i dont do much on top of it ::)

@jayderyu
i agree jPCT is a better match for android because of its small size compared to others but others may also have an advantage since they are natively targeted to HW rendering. jPCT does much more in software because of its hybrid pipeline and that can be a bottleneck on such a constrained device.
Title: Re: jPCT goes Android
Post by: EgonOlsen on February 13, 2010, 08:11:27 pm
The Android port of jPCT contains no hybrid pipeline parts anymore. It's like using the compiled pipeline in "normal" jPCT, just without the need to call compile(). Anything else doesn't make any sense on Android, because it would be much too slow.
However, what Android really really misses is a JIT IMHO. I've seen benchmarks of other VMs on the Android platform that have one and they all wiped the floor with Dalvik. We are not speaking of a few percent but of magnitudes. I've also watched the presentation from Dalvik's architect where he stated that this isn't needed for Dalvik, because it's already fast enough for it was meant for. I disagree with that. It's just wrong not to include even a simple JIT. If they are afraid of the memory it uses in addition, they can make it optional.
Anyway, i appreciate that raft pokes me from time to time. That's the only reason why i haven't dropped this port completely yet.
...and i predict that we'll never see jME 3 working on Android in a reasonable way. It's like making an elephant fitting into a VW Beetle.
Title: Re: jPCT goes Android
Post by: raft on February 23, 2010, 01:37:52 am
Anyway, i appreciate that raft pokes me from time to time.
if this is the case, i can happily continue poking forever ;D
you may wish to have a look at jME's progress (http://www.jmonkeyengine.com/forum/index.php?topic=13176.msg96711#msg96711)
Title: Re: jPCT goes Android
Post by: EgonOlsen on February 23, 2010, 07:54:35 am
3 fps in the emulator...stunning...
Title: Re: jPCT goes Android
Post by: EgonOlsen on February 23, 2010, 08:38:39 pm
Just to prove that something is there, the test scene on the emulator and on the real device:

(http://www.jpct.net/img/android_emu.jpg)
runs @ 13fps on a 3.2Ghz Core2 Quad
(with wrong lighting...the software renderer in Android 1.5 has improved but still has some bugs)


(http://www.jpct.net/img/android_real.jpg)
runs @ 20fps on the Samsung i7500
Title: Re: jPCT goes Android
Post by: raft on February 23, 2010, 08:46:08 pm
cool, poking always wins ;D
Title: Re: jPCT goes Android
Post by: raft on February 24, 2010, 05:44:35 am
i've opened an issue for hardware acceleration on emulator. voting may help:
http://code.google.com/p/android/issues/detail?id=6816
Title: Re: jPCT goes Android
Post by: EgonOlsen on February 24, 2010, 11:21:55 am
Voted! There have been no other issues posted about this? That shows how important that topic is...
Title: Re: jPCT goes Android
Post by: raft on February 24, 2010, 02:41:20 pm
i couldn't find any. if i had opened issue that time, we might have a accelerated emulator now ::)
Title: Re: jPCT goes Android
Post by: EgonOlsen on February 26, 2010, 11:02:38 pm
I doubt it. 3D still seems to have a very low priority for Android and partially for a reason.

Here's a Quake3 level on the phone in all its 2fps 3fps glory:
(http://www.jpct.net/img/quake3_android.jpg)
Title: Re: jPCT goes Android
Post by: zammbi on February 27, 2010, 06:15:19 am
I hope one day you can get going fast enough. Here's some more nice 3d games: http://androidandme.com/tag/android-3d-games/
Google Earth is also now on Android, though not too much 3d in that...
Title: Re: jPCT goes Android
Post by: EgonOlsen on February 27, 2010, 11:09:16 pm
I hope one day you can get going fast enough.
That won't happen unless hardware improves. The demo uses VBOs to render the geometry and there is no faster way on Android to render. It uses jPCT's compiled pipeline, which reorganizes the parts of an object in a way that minimize state changes and still it's not going beyond 3 fps...it's just to heavy for the GPU to handle. If you disable the actual drawing of the polygons (i.e. commenting out one single line), the fps are between 30 and 50...with a black screen of course. If you enable it again, you are back to 3. Current mobile GPUs are just not build to handle Quake3 levels. Simpler scenes usually work much better.
You may improve this particular demo if you were using the bsp information from a real Quake3 level (not a converted one like i'm using it), but that's not part of jPCT and it won't be.
Title: Re: jPCT goes Android
Post by: raft on February 28, 2010, 03:14:45 pm
is there collision detection here ?
Title: Re: jPCT goes Android
Post by: EgonOlsen on February 28, 2010, 03:41:10 pm
No. The methods are still in the port but not really usable on the Dalvik VM except for simple scenes. The performance is simply too bad for doing complex calculations. However, that may not be that much of an issue for mobile apps, because the controls have to be simplified anyway to be usuable, so that a much simpler collision detection might work well enough. By the time the devices are fast enough to render such scenes, they should be fast enough for proper collision detection too.
Title: Re: jPCT goes Android
Post by: raft on February 28, 2010, 06:29:55 pm
Quote from: EgonOlsen
However, that may not be that much of an issue for mobile apps, because the controls have to be simplified anyway to be usuable, so that a much simpler collision detection might work well enough.
i agree.

i was hoping two render 2-3 of ~2000 polygon avatars with a very simple background but seems as it wont be possible. maybe rendering avatars perform better since there is much less polygon ordering or similar things ?
Title: Re: jPCT goes Android
Post by: EgonOlsen on February 28, 2010, 08:09:18 pm
Avatars may work better (unless animated... ;) ), because they cause less overdraw, i.e. they consume less fillrate. Apart from that, it all comes down to sending batches of geometry data through the pipeline. There is no processing on the polygon level like in the software renderer hence not less sorting of something.
I guess we'll have to wait and see....i hope to release an alpha of the port in a week or so. The Javadocs won't reflect the fact that this thing runs on android now, but i'll correct that later.

Too bad that the technical specifications of the mobile GPUs are pretty much unknown in detail. My educated guess of the vertex performance of the chip in my phone is 200,000 vertices/second at max. The Quake3 demo maxes out at 82500, most likely due to state changes and fill rate limitations. Take your three avatars with 6000 polygons and you might get a frame rate around 10-13 fps, which sounds ok to me for a phone app. However, that doesn't include animations, which will hurt...
Title: Re: jPCT goes Android
Post by: raft on February 28, 2010, 08:48:02 pm
i cant image a karga without animations :-\ does this thing support shaders so hardware skinning may be an option ?
Title: Re: jPCT goes Android
Post by: EgonOlsen on February 28, 2010, 09:03:50 pm
Shaders? No way...it doesn't even support mip mapping... ;D

I'm not saying that animations aren't possible, but maybe you have to limit the number of interpolated frames to get things fast enough. The first Quake used keyframes, but no interpolation between them. Looks sucky nowadays, but was ok back then.
Title: Re: jPCT goes Android
Post by: EgonOlsen on February 28, 2010, 09:14:29 pm
I did some fill rate tests...around 10 megapixel/second seems the maximum that it possible for not much more than a simple plane. That's roughly 1/5th of the power of a Voodoo 1 but it should be sufficient to create something on the Pentium MMX software renderer level, which shouldn't look too shabby on the small display.
Title: Re: jPCT goes Android
Post by: raft on March 01, 2010, 12:56:06 am
that doesnt sound that bad. lets wait and see as you said ;)

as android is java 5 based there is no need to support older java versions. that may allow some optimizations like holding vertex data in nio buffers and taking them from IVertexControllers as nio buffers. anyway nevermind, just thinking aloud, i'm sure you already consider every optimization possibility ;D
Title: Re: jPCT goes Android
Post by: raft on March 01, 2010, 04:26:31 am
btw, how much does it take to load that quake level in your phone ?
Title: Re: jPCT goes Android
Post by: zammbi on March 01, 2010, 01:57:19 pm
I wonder if android 2.1 will help: http://pocketnow.com/rumor/google-hopes-to-reduce-fragmentation-android-21-for-all

Quote
I guess we'll have to wait and see....i hope to release an alpha of the port in a week or so.
Glad you haven't given up :)
Title: Re: jPCT goes Android
Post by: EgonOlsen on March 01, 2010, 08:38:22 pm
btw, how much does it take to load that quake level in your phone ?
When loading an optimized format, serialized with the "desktop" version of jPCT, it's ready after 40 seconds.
Title: Re: jPCT goes Android
Post by: EgonOlsen on March 01, 2010, 08:39:46 pm
I wonder if android 2.1 will help: http://pocketnow.com/rumor/google-hopes-to-reduce-fragmentation-android-21-for-all

As long the hardware doesn't change, this can't do any good on the GPU level. They may have improved Dalvik's performance, but i somehow doubt it...
Title: Re: jPCT goes Android
Post by: EgonOlsen on March 02, 2010, 10:03:37 am
Obviously, they are working on a JIT: http://groups.google.com/group/0xlab-devel/browse_thread/thread/1edef26f4e5b7427?pli=1 (http://groups.google.com/group/0xlab-devel/browse_thread/thread/1edef26f4e5b7427?pli=1)

However, it won't be available on "old" phones like mine... :'(
Title: Re: jPCT goes Android
Post by: raft on March 02, 2010, 09:02:51 pm
that is good news :)

why wont it be available for old phones ? isn't installing a newer version of android an option ?
Title: Re: jPCT goes Android
Post by: EgonOlsen on March 02, 2010, 09:22:33 pm
Maybe, but i don't want to trash the phone, so i'm limited to the official updates (which have been risky enough in the past...). Currently, i'm running 1.5...there is an update to 1.6, which i'll make one day but i don't think that anything higher will be officially released any more for this phone.
Anyway, IF a JIT makes it into the Dalvik VM, i'm willing to get myself a phone that can use it anyway.
Title: Re: jPCT goes Android
Post by: zammbi on March 02, 2010, 09:47:19 pm
Well as I posted above 2.1 may come out for all phones if your lucky.
Title: Re: jPCT goes Android
Post by: EgonOlsen on March 02, 2010, 09:51:51 pm
Yes, but i doubt it. Which motivation should a company like Samsung have to update an older phone which actually works fine with the OS it has when newer ones are already available? Let alone that for example the G1 doesn't have enough memory to upgrade to 1.5 or 1.6 IIRC. How can it upgrade to 2.1 then? Anyway, we'll see and hope for the best... ;D

Edit: And even then...2.1 doesn't have that JIT enabled, so unless you start hacking your phone, you'll be out of luck...
Title: Re: jPCT goes Android
Post by: EgonOlsen on March 03, 2010, 10:34:43 pm
Here you go: http://www.jpct.net/forum2/index.php/board,7.0.html (http://www.jpct.net/forum2/index.php/board,7.0.html)

This thread is closed now....i hope to see you soon on the new board.