Page 11 of 14

Re: State of the attempt to natively port love to android

Posted: Fri Mar 09, 2012 8:59 pm
by Moe
T-Bone wrote:Just wondering, is it possible to run the .love-file from within the actual app or does it have to be on the sd-card?
We did not work on accessing files within the apk. You can give it a try. If it does not work we will add support for it in one of the next updates. The difficulty is to think of all possibilities and to test them. :D
Oh, before you start to complain: It is a known bug that the app crashes at 2 of 3 starts. For now, it's a feature. :joker:

Re: State of the attempt to natively port love to android

Posted: Sun Mar 11, 2012 2:42 pm
by T-Bone
Got it to run now (see the other thread).

I'm not sure what bugs to report. It pretty much doesn't work at all for my game. When it "works" (1/5 times approximately) the screen is just white instead of showing anything. However, sounds start to play when they should. Sometimes they die within a second, sometimes they keep going. When this happens, LogCat keeps printing "03-11 15:37:25.645: E/libEGL(666): called unimplemented OpenGL ES API". Sometimes, it is instead "03-11 15:39:46.875: E/liblove(732): Mutex lock/unlock failure. 22"

Is there anything special I should think about when it comes to graphics in this build of love-native-android? Like resolution and stuff? My .love works quite well on the luaj-version of love-android.

Re: State of the attempt to natively port love to android

Posted: Sun Mar 11, 2012 2:45 pm
by Moe
the first thing that comes to my mind: which resolutions do your graphics use? Are they power of 2, or something else?

Re: State of the attempt to natively port love to android

Posted: Sun Mar 11, 2012 3:02 pm
by T-Bone
Moe wrote:the first thing that comes to my mind: which resolutions do your graphics use? Are they power of 2, or something else?
I only use PO2 images. As I said, the .love works just fine in the luaj version.

I managed to build an apk and tried it on my phone. And believe it or not, it kind of works! The game runs, graphics show, but without music, and love.mousepressed seems to be ignored. Also, it doesn't scale the resolution the way the luaj version did, so I may simply have missed the buttons I'm trying to click on within my game. Will experiment.

EDIT: I can confirm that love.mousepressed kind of works. The problem is in the way love.mouse.getPosition works. It is not consistent with the positions on the display.

Also, the grey bar must die.
EDIT: Grey bar successfully killed! Also fixed fullscreen.

EDIT: Another pretty serious bug. It appears that (at least) one of two things are true:
1. love.mouse.isDown doesn't work
2. when the user keeps touching the screen, this is registered as tons of clicks every second, rather than a single love.mousepressed.

My game relies on holding down and dragging on the touch screen, so this is important.

Re: State of the attempt to natively port love to android

Posted: Sun Mar 11, 2012 3:44 pm
by Moe
T-Bone wrote:
Moe wrote:the first thing that comes to my mind: which resolutions do your graphics use? Are they power of 2, or something else?
I only use PO2 images. As I said, the .love works just fine in the luaj version.
Besides some advices, I have not been involved with the Java version... Okay, I also asked "Why don't you do a native port" and ended being one of the porters :joker:
I managed to build an apk and tried it on my phone. And believe it or not, it kind of works! The game runs, graphics show, but without music, and love.mousepressed seems to be ignored. Also, it doesn't scale the resolution the way the luaj version did, so I may simply have missed the buttons I'm trying to click on within my game. Will experiment.
We do not support the emulator. It uses a software implementation of OpenGL ES, which does not support all features. Besides that, the emulator is way to slow to do real development. The Java version is a reimplementation of love, while the native port is as close as possible to the regular version. So I think that your tests would be better with the regular love than with the android-java version.
EDIT: I can confirm that love.mousepressed kind of works. The problem is in the way love.mouse.getPosition works. It is not consistent with the positions on the display.
I have to check this - but it sounds like the window title or the status bar must be subtracted.
Also, the grey bar must die.
EDIT: Grey bar successfully killed!
Nah, we like that bar. :p
We will remove the bar and also the task bar, but it is not a number one priority. :)

Re: State of the attempt to natively port love to android

Posted: Sun Mar 11, 2012 3:46 pm
by T-Bone
I'm impressed to see that spritebatches work! And performance is impressive too!

In case you missed, I edited my previous post again:
Another pretty serious bug. It appears that (at least) one of two things are true:
1. love.mouse.isDown doesn't work
2. when the user keeps touching the screen, this is registered as tons of clicks every second, rather than a single love.mousepressed.

My game relies on holding down and dragging on the touch screen, so this is important.
Also, about the grey bar and the task bar, I mention how to fix that in the guide-thread.


EDIT: I can now confirm that is number two. When you hold down your finger on the touch screen, love.mousepressed is constantly activated.

Re: State of the attempt to natively port love to android

Posted: Sun Mar 11, 2012 4:23 pm
by Moe
T-Bone wrote:I'm impressed to see that spritebatches work! And performance is impressive too!
I was forced to implement a more efficent way than Love 0.72 does - OpenGL ES does not support the old, inefficient way (glBegin - glEnd rendering). :)
In case you missed, I edited my previous post again:
Don't do that! Yes, I missed it.
Another pretty serious bug. It appears that (at least) one of two things are true:
1. love.mouse.isDown doesn't work
2. when the user keeps touching the screen, this is registered as tons of clicks every second, rather than a single love.mousepressed.

My game relies on holding down and dragging on the touch screen, so this is important.
Input events is still more a kind of case study than final. We think also of offering a "touch-to-mouse" and "love-touch-api" as two different modes, so that we have a compatibility way for normals love apps, but optimised apps could optimise the input events to a touch screen.
Also, about the grey bar and the task bar, I mention how to fix that in the guide-thread.
This is actually more a laziness but knowledge thing.
EDIT: I can now confirm that is number two. When you hold down your finger on the touch screen, love.mousepressed is constantly activated.
I could have told you without testing :)
As I said above, we are still thinking if we simply emulate a mouse or offer a lövelike API for the touchscreen. Or both with a switch in the config.

Re: State of the attempt to natively port love to android

Posted: Sun Mar 11, 2012 4:36 pm
by T-Bone
If I am not mistaken, the luaj-version does a compromise that I think works. It calls the love.mouse-calls as well as a touch call, so no switch in the config was necessary. I have developed my game thinking that love-native-android would follow the same structure. But of course I can change the way my game works.

It doesn't really matter how this is solved, as long as you can get everything to work, one way or another. It is, however, important that if the love.mouse-API is used in some way, then it shouldn't register multiple mouseclicks when you are in fact just holding the "mouse" down. So I consider that a bug.

Re: State of the attempt to natively port love to android

Posted: Sun Mar 11, 2012 4:51 pm
by T-Bone
I double post now because you told me not to edit my posts, in case you wouldn't see :neko:

I take some things back; when you hold down the touch screen, it does not register multiple mouseclicks. I will dive deeper into this to try and figure out what's wrong. I know that there is some kind of difference between computer LÖVE and love-native-android that has to do with how the mouse works, but I am confused.

Re: State of the attempt to natively port love to android

Posted: Sun Mar 11, 2012 7:28 pm
by Moe
I don't mind about double posts :P
Anyway, I checked the code and we actually do only create events for "finger touches screen" (ACTION_DOWN) and "finger leaves screen" (ACTION_UP). Everything between those two events is totally random at the moment.