OUYA graphics strangeness?

Monkey Forums/Monkey Programming/OUYA graphics strangeness?

caffeinekid(Posted 2013) [#1]
Hi there I've just got an OUYA from the very kind creators to hopefully port some or all of my games across, and have started with the one I did back in January - Jumping Jack.

The controller stuff works brilliantly but there seem to be some rather odd things happening with the graphics for some reason.

The first run it works fine but after game over (or sometimes on restarting the game from the PLAY menu) the graphics seem to swap around and just go crazy. The player sprite was being displayed as the title screen logo, and the fonts were changed for just white blank blocks.

Has anyone else had this happen to them? I'm very confused.

Should look like this...


Ends up looking like this...

(or even with the font image replacing the logo)


computercoder(Posted 2013) [#2]
How are other games playing - not yours, but from the Discover? I am trying to determine if the console you have is bad, or if there is an issue in the code.

I haven't ran into that issue before. I have one of the KickStarter consoles (From June/July when I recieved mine).

Do you have a sample that I could test on my console with?


AdamRedwoods(Posted 2013) [#3]
(or sometimes on restarting the game from the PLAY menu)


yikes! looks like the Ouya dumps the graphics context and creates a new one. You'll need to reload your graphics using Monkey's OnResume() function.

not sure why it would do this after a game over, though...


caffeinekid(Posted 2013) [#4]
The other games I've tried so far (not many as I've only had it about 2 days) seem fine.

I just wondered if there was something specific to the OUYA that was different regarding graphics that I wasn't getting right, or if it was a known issue or if I'm just being dumb even.

Jumping Jack for Android has about 50 sales on Google Play and no error reports so I'm assuming it's something on the OUYA side that is slightly different.

Thanks Adam. I will try putting a reload of my media in the OnResume method and see if that makes any difference.


caffeinekid(Posted 2013) [#5]
@computercoder - how do I know if this is from the orignal batch or a newer one? I emailed them saying I was a dev and they sent me a "slightly used but still super awesome" console to port my games and dev on.


computercoder(Posted 2013) [#6]

not sure why it would do this after a game over, though...


I think that depends on how his code is written. Without trying to step on any toes or make any assumptions, if the code attempts to utilize the same context instead of grabbing a fresh one when the new game starts, wouldn't it perform in this manner too?


caffeinekid(Posted 2013) [#7]
It's a simple state machine so that shouldn't be an issue?

Goes from:-

STATE_MENU > STATE_PREGAMEFADE > STATE_GAME > STATE_GAMEOVER > STATE_MENU


computercoder(Posted 2013) [#8]

how do I know if this is from the orignal batch or a newer one?


Pfft! I'm not at my OUYA at the moment, but It's under the System menu and there is a menu option that tells you the software version and hardware... I want to say the from the Main Menu, select "Manage" or "Maintenance" and then "System". There will be the hardware version and the software version on the details on screen.

Sorry if this leaves you confused on how to get to it, but I really need my OUYA in front of me so I could tell you exactly!


caffeinekid(Posted 2013) [#9]
Could this be that the game is rendering before the graphics have fully loaded? I've added an empty OnLoading method and hopefully it's not doing it now.

I've just started using a more recent version of Monkey (for the OUYA target) and the one I was previously using doesn't have OnLoading.

Can Monkey start doing OnRender before it has everything it needs in memory?


computercoder(Posted 2013) [#10]
OnLoading() I believe (someone correct me if I am wrong) is used to be able to load all the content and be able to do so. It should safely load your content then allow proper rendering.

According to the Help in Monkey:

OnLoading : Int ()

This method is called instead of OnRender when the application should render itself, but there are still resources such as images or sounds in the process of being loaded.



I would assume by that definition that you should utilize OnLoading instead to render your game.


AdamRedwoods(Posted 2013) [#11]
use OnLoading to draw a splash screen.

for android/Ouya, your assets are loaded synchronously, so they should be ok when it's time to OnRender().

What Monkey version are you using? v70 or above?


marksibly(Posted 2013) [#12]
It does sound like a 'discarded graphics' issue (ie: Android sometimes dumps all your graphics forcing you to reload them) but this is supposed to be handled internally automatically by Monkey.

Furthermore, you should generally get an exception when attempting to render a discarded texture, not just dodgy graphics(?) so I suspect it's the Ouya doing something 'differently'.

Can you put together a reproducable demo so I can take a look at it? Or is there a way I can reproduce with an existing banana?


ElectricBoogaloo(Posted 2013) [#13]
This banana appears to have corrupt graphics.

(*sorry*)


computercoder(Posted 2013) [#14]
Just a quick update: I noticed this SAME strangeness while purusing the menus in the OUYA system. I was looking at the Apps installed on my OUYA to see if there was a way I could transfer them from it to the USB storage device I bought exclusively for it. The words turned to blocks for ALL the descriptions when I highlighted them, but after the highlight/focus was removed, the words re-appeared.

Based upon this evidence, I think the real issue lies in the OUYA itself. Perhaps its having video driver issues?