love2d / love-android

Android build setup for LÖVE.
https://love2d.org
Other
201 stars 70 forks source link

Running in an OUYA? #75

Closed slime73 closed 5 years ago

slime73 commented 10 years ago

Original report by Pablo Mayobre (Bitbucket: PabloMayobre, GitHub: PabloMayobre).


Well there is no current way to know if we are running in an OUYA, it would be great if there was some method to know (defined on installation or whatever) so that I can do:

if OUYA then
    --Correct the "menu" and "escape" key behavior
end
slime73 commented 10 years ago

Original comment by Martin Felis (Bitbucket: MartinFelis, GitHub: MartinFelis).


Hrm... yes that would be nice. Do you know of any way in Java how to detect whether it is running on an Ouya?

slime73 commented 10 years ago

Original comment by Jairo Luiz (Bitbucket: tangzero, GitHub: tangzero).


In Java, you can do this: https://github.com/libgdx/libgdx/blob/master/extensions/gdx-controllers/gdx-controllers/src/com/badlogic/gdx/controllers/mappings/Ouya.java#L57

slime73 commented 10 years ago

Original comment by S C (Bitbucket: Foxcraft, GitHub: Foxcraft).


If you can implement the current version of the ODK, you definitely should be able to detect the OUYA. Also, if that can be sorted out, then you could also detect the other devices compatible with it, such as the Mad Catz M.O.J.O. console and others as they are added.

As an added bonus, you could also make use of the built in controller support for different kinds of controllers. It also can fetch the correct button image for a particular controller when plugged in, allowing the supported controllers to get the appropriate button shown for them.

slime73 commented 10 years ago

Original comment by Pablo Mayobre (Bitbucket: PabloMayobre, GitHub: PabloMayobre).


I don't want the ODK to be included, if it's something I can do in Lua then I don't want it inside of LÖVE. Mostly because it would mean that I would be forced to include it in any Android game I make even when I don't have any intention of deploying to the OUYA.

So in this case the minimal implementation is better, the rest can be added by whoever needs it.

What module would this fit in? system as love.system.vibration()? This would be other ideal case for the phone module (although it might be vague since Android runs in tablets too)

slime73 commented 10 years ago

Original comment by S C (Bitbucket: Foxcraft, GitHub: Foxcraft).


To each their own, of course. I'd certainly like some help with the ODK for implementing this and other features into my games. Doesn't have to be built in.

slime73 commented 10 years ago

Original comment by Pablo Mayobre (Bitbucket: PabloMayobre, GitHub: PabloMayobre).


Just a few questions:

If they work in many devices then they may be added to LÖVE. If they are simple they can be added through a lua library. If they are useful then there is possibility of them being added. If you dont need the whole thing then you might be able to strip it down to the minimum

slime73 commented 10 years ago

Original comment by S C (Bitbucket: Foxcraft, GitHub: Foxcraft).


I am interested in all of the features, in-app purchases included. I would like to have the entire ODK, and besides IAP, because it is to help get the game to work on devices that support the OUYA store through OUYA Everywhere. Currently, that's just M.O.J.O., but two more devices are on the list to be implemented (Nuvola and Wikipad), and there's supposed to be more to come.

If it works beyond that, I'm not sure.

slime73 commented 10 years ago

Original comment by Pablo Mayobre (Bitbucket: PabloMayobre, GitHub: PabloMayobre).


Yeah sounds good. It would be nice to have some kind of Java > Lua interaction (It would be something like Java > C > Lua but the idea is the same) It would allow someone to easily add Java code to LÖVE android and interact with it in the Lua side. This would allow to add in game purchase, Google Play Games highscores and trophies and better adds and adding the ODK with this would mean no problem (maybe declare the Java functions to interact with Lua).

Is this possible at all?

Maybe something like:

myjavafile.java:
    JavaFunction (Java function definition)

cwrap.c
    CreateALuaFunction("LuaFunction",JavaFunction)

main.lua (inside of LOVE)
    LuaFunction() --Calls JavaFunction
slime73 commented 10 years ago

Original comment by S C (Bitbucket: Foxcraft, GitHub: Foxcraft).


Yes, it's possible, and this port itself works in that kind of fashion. The idea was discussed a bit before here: #58/ouya

slime73 commented 10 years ago

Original comment by Martin Felis (Bitbucket: MartinFelis, GitHub: MartinFelis).


@PabloMayobre something like you suggested would be possible but is very tedious to implement. Instead something that is more feasible would be something as suggested in #70/communication-with-host-android. I.e. to have some interface to send tables from Lua to Java and back. This way people could wire up their desired SDKs manually in the Java code.

slime73 commented 10 years ago

Original comment by Pablo Mayobre (Bitbucket: PabloMayobre, GitHub: PabloMayobre).


What about type conversions? Since Java arrays are of one type and Lua tables are mixed types? How are this things handled?

I would love to have this feature added

slime73 commented 5 years ago

Original comment by Alex Szpakowski (Bitbucket: slime73, GitHub: slime73).


From what I understand, the Ouya is now completely dead (all services are shut down, etc).