Jayenkais NewYA Target

8 replies to this topic
Posted 1+ years ago #1

Android_NewYa Target

Download The Target

Recent changes to how OUYA works, (SDK updates, Razer buying them out, the new Razer Forge Cortex stuff, and more) have rendered the old OUYA target... a bit broken.
The old controller code no longer works 100% of the time on the new Razer Forge, so I took some time rejigging the target, and making it a bit more compatible.
Along the way, I also got involved with a few other devices (mostly PlayJam's GameStick) and had time to tweak the code so that it seemed to work fairly universally.

After a lot (A LOT!!!) of testing and tweaking and rejigging, I can safely say that this is probably the best that I can personally manage. (But others may fair better)

The new controller code has been tested, and has been shown to work on the following devices.
Razer Forge
PlayJam GameStick
PlayJam FlarePlay
Archos GamePad 2 - One of those Android tablets with an inbuilt controller.

The code has been shown to work with all standard included gamepads, as well as with my trusty Wired X360 USB pad.
It should (*should*) also work nicely on anything else you'd like to throw at it, but .. This is Android.. It'll be a case by case basis, I'm afraid.
Let me know what does/doesn't work, and I'll add it to the list above.

The code has been approved (ie, has gotten through review) on OUYA, as well as "OUYA for Cortex/Razer" and also by PlayJam for GameStick, and their new FlarePlay device.

PlayJam Flare's Audio Crash

NOTE : If you use any .wav file which are less than 2048bytes (eg taps, menu blips, gunshots) the PlayJam FlarePlay has seemingly random issues with such small files, and your game may crash whilst trying to play them.
I've only seen this on Flare, so far, but .. Android!!
If you have any such files, I suggest you pad them out a bit with some silence at the end, before releasing an Android game into the wild.
(I know this is completely unrelated to the controller stuff, but it baffled both me, and the PlayJam guys for quite a while, with me thinking it was my controller code doing the breaking.. so thought it important to mention!!)


I don't USE the AppStore/IAP stuff, and I appear to have completely fudged it all up.
After upgrading the OUYA SDK, Mark's old "monkeystore.ouya.java" was throwing up a whole bunch of errors, so I did a big old /* Smeg all this!! */ Rem-Block around it, until it ran again.
As such, you will NOT be able to do any IAP or anything like that, until you, or somebody else, bothers to fix it.
Also note that, since this is reliant on the OUYA SDK, it won't even work via GooglePlay or anything else.
Purchases on Android are SO messy, it's unreal!!! So many different markets, and each one with it's own rules.
Freeware's just easier!!

This is laziness on my part, but all my games are free so .... Meh!

Button Images

Again, not something I've tackled here.
You're going to have to decide how to deal with those, yourself.
I've recently opted to use a "4 dots, one is lit" style of "suggesting" which button to press.
This means there's no having to specifically name the buttons, or anything like that.
It seems to work reasonably well, and unless some stupid company comes up with a controller who's face buttons aren't layed out correctly, it should more or less be universal.

NewYA Target

The folder goes to C:\Monkey\targets\
A LOT of stuff has been rejigged to get controller support up and running on so many different devices.
Although, over the course of about 2 months, I was removing, replacing and undo-ing a LOT of my own edits!! As such, it may or may not be as complicated a tweak as I'm remembering! It just took bloomin' ages getting it to this point..

I've kept it as a separate target so that if Mark ever gets around to doing his own OUYA target update, mine won't get in the way.
Code your game, switch to Android_NewYA, job done!*

(*The job is never done!!)

Unfortunately, standard Android devices seem to have issues with Multiple BlueTooth controls, whereby they stutter, struggle and lag like crazy.
This is entirely device dependent and requires stress testing on a per-device basis.
OUYA and Forge don't seem to have any multiplayer issues at all, so I think they're doing other stuff with the controller code, possibly using WiFi to enhance the signal or something?! *shrugs*
If you hardwire a controller (eg Mutliple Wired X360 controllers via a USB Hub) to a "slow" device, it seems to work perfectly fine, so I'm 95% convinced that the "issue" is with Bluetooth itself, and not my god-awful coding.
If you can find a cure for this, be sure to let me know.

Single player is spot-on! (Or at least, it should be!!)

Analogue Triggers
Some controllers work in a way in which the left analogue trigger moves JoyZ(0) and the right one does JoyZ(1)
Some controllers work so that left trigger makes JoyZ(0) go negative, and the right trigger makes JoyZ(0) go positive.
I can't find a safe way to tell which type of controller the player is playing with, and you're just going to have to handle that stuff on your own.
I tend to avoid using them, that's the laziest way!!

Additional Note
I'm not a tidy coder, and my updates are messy.
There are probably many ways to make this code 100* better.
If you wish to complain about my code, I will not listen. My mind automagically blocks "messy code" complaints.
Instead, don't whinge, take up the task for yourself, and see what you can do.

I also, lazily, probably won't be updating this any time soon.. My job here is done, and I'm happy with how it works.. so take it as it is!

Download The Target

Posted 1+ years ago #2

Great stuff Jayenkai! Thanks for the link to this here post too. I will give this a bash in due course.

Posted 1+ years ago #3

Cool! I still have my Ouya connected to my TV downstairs...need to boot it back up to see whats new (if any) going on with it. But they're still taking submissions even after the buyout by Razer?

Posted 1+ years ago #4

Yeah, it's the same TeamOUYA at the Dev Relations side of things.. They all got shifted over to the new Razer job.(well, most of them.)

Posted 1+ years ago #5

Purchases on Android are SO messy, it's unreal!!! So many different markets, and each one with it's own rules.
Freeware's just easier!!


Never implemented IAP in any of my games - and that's exactly the reason why. Can't bother to implement Apple / Google Play / Android Market / whatever store that pops up.
Even worst, in Google Play if I want IAP now, I have to open a new account here in Brazil (because there wasn't a specific brazilian store back then - and have to pay *again* the $25 fee) and transfer all my old games to this new account - losing all reviews in the process. No thanks, Google :P

Just slapping ads here and there seems to be the best way to spread your game around, and still make some money with it.

Posted 1+ years ago #6

Ouya is dead console as I think you convert to Shield TV console :)

Posted 1+ years ago #7

My OUYA still works fine.
On the other hand, a friend who bought a ShieldTV a few weeks ago, has already had to return it to NVidia, because it inexplicably bricked itself doing an update.
Your mileage may vary!

This target should ensure your game works happily on both devices. *hopefully*
let me know if you try it out. My .apks are available from my Archive. Look for the Android TV .apks.

PS, hello Hotshot! \o Jayenkai from SoCoder o/

Posted 1+ years ago #8

If you guys have an OUYA laying around, and don't want it anymore because its "dead", I could really use a donation ^_^

Posted 1+ years ago #9

Hello Jay

Happy New Year :-)