Ouya

Topics: Compatibility, Ouya
Jul 12, 2013 at 10:01 PM
Do you have any getting started guide for using cocos2d-xna with the Ouya?

I have tried opening the solution in Visual Studio and Xamarin and I just can't get it to work.

Something like a step by step guide would be great.

I have just received my Ouya and am anxious to try it out.

I hate Java and I am not having a whole lot of luck with cocos2d-x and Eclipse using the Meta Project either.

Please help.
Coordinator
Jul 12, 2013 at 10:28 PM
Looks like the paths in the Ouya project are not correct anymore. I will fix them.

You should be able to build the tests, hook up your Ouya to the desktop via usb, deploy, and then open it on the ouya.
Jul 12, 2013 at 10:33 PM
What IDE do I use to build the tests.

Sorry I come from a Mac / Xcode environment. Don't know much at all about any other IDE unless of course I can use Windows and Visual Studio.

Is it as simple as opening the Solution in Visual Studio and building the tests? Will it produce an APK that I can just deploy to the Ouya?
Coordinator
Jul 12, 2013 at 10:34 PM
The ouya test solution has been updated on github. I ran it myself and it builds fine.
Coordinator
Jul 12, 2013 at 10:41 PM
It is that simple.

You can use either VS or XS, your choice.

You should be able to see the ouya as a device in VS when it is connected. Literally, just select it and choose to deploy the tests project to it. That's all that I did when I wrote the Ouya solution support.

Next, you get the Xamarin/AngryNinjas project from github and build that for Ouya. I demoed that at Xamarin Evolve in April. You'll see where we hooked up the gamepad callbacks. You do the same for your game.

Surprisingly enough, it really is that simple.
Jul 12, 2013 at 10:43 PM
When I try to open the cocos2d-xna.Tests.Ouya.sln in Xamarin I get the following message

Image
Jul 12, 2013 at 10:49 PM
I'm not sure why it isn't working. I am loading up a VMWare of Windows 7 Pro and will install Visual Studio Ultimate 2010 and then try the solution. Would love to be able to just use X and stay on the Mac.
Coordinator
Jul 12, 2013 at 10:52 PM
You need to also pull down the submodules. We include monogame as a submodule.

You are running this on a Mac then? I think the github client automatically pulls the submodule, but I am not sure.

Maybe you downloaded a zip of the github instead?
Jul 12, 2013 at 10:54 PM
I downloaded a zip of the github, maybe that is what I have been doing wrong. I will try to pull using the github client
Jul 12, 2013 at 11:05 PM
Ok so I ran git clone https://github.com/totallyevil/cocos2d-xna.git

Tried to run the test from there and received the same message
Coordinator
Jul 12, 2013 at 11:10 PM
are you on the command line using git?

If so, you also need to do a submodule update with -init
Jul 12, 2013 at 11:12 PM
I'm sorry, I probably sound like a complete idiot here. Is that a command line switch that I need to specify when issuing the git command?

how do I do a submodule update?
Coordinator
Jul 12, 2013 at 11:16 PM
git submodule update --init "MonoGame"
git submodule update --init "tools/ouya"

then inside of MonoGame

git submodule update --init "ThirdParty/Libs"

That should get you going.
Jul 12, 2013 at 11:21 PM
Perfect...

The solution opened up without any error messages now.

I tried to click on build and am getting errors in CCDraw.cs

Starting with Box2D.Common

The type or namespace name 'Box2D' could not be found. Are you missing a using directive or an assembly reference?
Coordinator
Jul 12, 2013 at 11:44 PM
Do you see the Box2d project included in the solution?

Maybe it just needs an updated library reference. Sometimes XS can lose the reference.
Jul 13, 2013 at 12:04 AM
Actually, it does not include the Box2d project. Which box2d project do I include?

And do I just Right-Click on the solution, Add -> Add Existing Project ?
Coordinator
Jul 13, 2013 at 12:08 AM
You include the android version of box2d.

Yes, just Add -> Add Existing Project
Jul 13, 2013 at 12:20 AM
Ok,

I've added the Android box2d project to the solution, now when I try to build, I get errors in the Box2DTest.cs file.

Image
Jul 13, 2013 at 12:27 AM
ok, so I also had to expand tests.Ouya and then right-click on References and click edit references and then place a check mark next to box2d.Android.

Now I am left with only 1 error and its in the controller.cs class.

pScene = new SystemFontTestScene(); break;

The type or namespace name 'SystemFontTestScene' could not be forund. Are you missing a using

Note: I commented this line out and the build went through.
Jul 13, 2013 at 12:44 AM
So I finally have it deployed and running on the Ouya.

Do you think it would be a good idea to put together some kind of getting started with the Ouya document that pretty much covers everything we've just gone through? Or am I just not informed enough and should have known how to do all of this?
Coordinator
Jul 13, 2013 at 3:07 AM
that's great news!

So you're the first one to use Ouya since we started working on the system font support. That's an OS-rendered CCLabel that bypasses the font content pipeline support. I don't think it works on ouya yet, so that's why you got those weird errors.

The rest is just some weird problem with our configuration. That'll get fixed shortly.

Typically every platform is point and shoot for deployment. That even goes for Xbox 360.

The getting started guide would really be for using gamepad inputs for games. These games typically follow a touch pattern for input, which is very orthogonal to the gamepad interface.

I am glad that you got up on Ouya in just a couple of hours. Sorry that we didn't keep that side of the project up to date. I am sure Julie and Kellee are disappointed. let's hope you get a game on ouya soon! If you need any help, please don't hesitate to ask. We are here to help.

irc.gnome.org = #cocos2dxna for cocos2d xna specific issues
irc.gnome.org = #monogame for mono game specific issues

someone is always on, please join us on the IRC channel if you need immediate answers.
Coordinator
Jul 13, 2013 at 4:23 AM
the config problems with ouya should be fixed now. you should be able to pull down cocos2d-xna, submodule update, and build/deploy to ouya in just a short amount of time and with no errors.

make sure you get Xamarin/AngryNinjas to see a real game that works on Ouya.
Jul 13, 2013 at 3:16 PM
Quick question.

So now that I've got the tests working I thought I would try to start a blank project.

I've got as far as loading a blank screen with the FPS showing up in the lower right corner.

Now I am simply trying to put a sprite in the center of the screen. I can't for the life of me figure out where I should put a png and then access it. I figured I would put it in the Resources folder and then access via

CCSprite sprite = new CCSprite("Resources/imagefile.png");
AddChild(sprite, 10001);

I get cannot find texture Resources/imagefile.png

Thoughts? Solutions?

Thank you so much for your help.
Coordinator
Jul 14, 2013 at 12:11 AM
Create a folder named "Content" in your game project.

in that folder, add your png so you have "Content/imageFile.png");

Then to add a sprite, you "new CCSprite("imageFile")

add it to your main scene, "AddChild(mySprite, 1);"

Then do something fun.

Content goes into the "Content" directory of your project. Everything in there is marked as Content. Make sure you do that via XS.

This is XNA. Make sure you get a book on XNA and read up on how it works. XNA uses a pre-processing step to process content (The content pipeline). MonoGame supports loading raw assets without preprocessing, but only assets like images and audio (wav/mpg).

Did you get the https://github.com/Xamarin/AngryNinjas project? I highly encourage you to get that and see how it works.