Cocos2d-x and XBOX One

Cocos2d-x and XBOX One
0.0 0

#41

I do believe @stevetranby and @Rusty are doing this have have written extensively about it in other threads.


#42

Major Update: The Xbox Creators Program is now live!

Through the Creators Program, you can now develop and release a cocos2d-x game for Xbox One. Previously you had to go through ID@Xbox, but this new program allows pretty much anyone to develop and release using retail hardware. From Microsoft’s site:

“The Xbox Live Creators Program allows developers to quickly and directly publish their games to Xbox One and Windows 10, with a simplified certification process and no concept approval required.”

I’ve purchased and played a handful of games released with this program on my Xbox. They’re listed on the Xbox store under a new Creators Collection section. There seems to be about two dozen games so far.

Technical Update

All UWP games must now be 64-bit. Currently I’m running Cocos2d-x 3.13.1 without issue. So make sure your projects are set to x64 when building and deploying.

More Info

Creators Program main page

Developer program overview

UPW on Xbox One

Personal

I’m working on a release for this right now. My new project is performing great on the hardware. Currently I’m trying to get the Xbox Live leaderboards working.


#43

This is awesome @Rusty.

Is there anything special about getting started? Meaning can you talk about getting a cocos2d-x app running on the console for first timers?


#44

There are a few requirements, nothing major though.

  1. Sign up as a Windows developer. One-time fee.
    Individuals - $19 USD
    Companies - $99 USD

  2. Get a retail Xbox One. Any kind will work.
    $250 for an Xbox One S on Amazon.

  3. Windows 10 PC

  4. Install Microsoft Visual Studio 2015 w/ Update 3
    Community version should work

After that, follow this setup guide: Getting Started with Xbox One.

It’ll walk you through installing the required SDKs, setting up the Xbox in developer mode, pairing visual studio with the xbox, etc.

Once you have a project deployed on the Xbox, getting a cocos2d-x project running should be pretty simple. You’re basically repeating the steps in the setup guide, but in a Cocos2d-x project.

  1. Create a Cocos2d-x project.
  2. Open the created Windows 10 solution.
  3. Change the build to x64.
  4. In project properties go to the Debugging tab, select Remote Machine in the Debugger to open the drop-down list.
  5. Type the IP address or hostname of the console into the Machine Name field.
  6. Select Universal (Unencrypted Protocol) in the Authentication Type field.
  7. Build and run

#45

Update: I’ve now submitted my first game for UWP certification on Xbox. Expected turn around time is 3 days. :crossed_fingers:

Like with my other games, I used SDL2 for the game controller logic. Everything else is Cocos2d-x including the audio engine. I used the SimpleAudioEngine, which worked pretty well. Although I was disappointed to find SimpleAudioEngine for UWP didn’t support panning.

NOTE: Even if this game passes cert on the first try, I’m not sure I’ll release it this month. Working on a simultaneous release with other platforms.


#46

Interesting about your use of SDL. Makes sense. Their controller support is good. Do you do some kind of minimal SDL compile to just include controller support? That way you don’t have the weight of the entire engine in your builds?


#47

SDL2 is a very modular system. You can initialize just the sub-systems you want. For this project I just initialize JOYSTICK, GAMECONTROLLER, and HAPTIC. This way it’s quite light-weight.

SDL_SetMainReady();
if (SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_GAMECONTROLLER | SDL_INIT_HAPTIC) != 0) {
    log("SDL_Init error");
    log("Could not initialize SDL: %s.", SDL_GetError());
    return;
} else {
    log("SDL_Init success");
}

I’m very comfortable with using SDL2 in conjunction with cocos2d-x, so it was any easy way to go for me. If Cocos2d-x support controllers for UWP apps, I’m sure that would be easier for others.


#48

Wow. Thanks. The way they do it seems straightforward.


#49

Rusty,

Could you paste sample code how to connect SDL controller code with cocos2d-x?

Regards,
CHP


#50

My SDL2 controller code isn’t wired into cocos2d-x, just my game code.

If you’re interested in learning about SDL2, this is the tutorial I used.

However, it might be easier to just patch Cocos2d-x to add controller support. EventController already supports mobile and desktop I think? /cc @slackmoehrle


#51

I think 3.16 brings more controller support.

Edit: maybe I am wrong I don’t see mention of it in release notes. I thought that I read that controller support had added platforms besides iOS and Android.


#52

I see this commit the 3.16 branch adding code for a game controller test for win32.

EDIT: Also I see that Win32 and Linux support was merged in here.


#53

glfw use of controller was pretty straight forward as well


#54

Update: Failed my first pass at certification. There aren’t many requirements I think for UWP cert, but Microsoft requires any game on Xbox to sign in and use Xbox Live. You don’t have to use the services like leaderboards, but you have to sign in.

My particular issue was that I didn’t block gameplay until the user had sign in. Pretty easy to fix and resubmit.

Here’s the report on the failure I got. Helpful for anyone else looking to ship on Xbox:

===========================

App Policies: 10.13.5 Xbox Live Active User and Gamertag

Because your game uses Xbox Live, it must:
· Create at least one active user and sign the user into Xbox.
· Display the user’s Xbox gamertag as the primary display and profile name.
Please add this behavior and resubmit your game.

Steps to Reproduce:

  1. Launch the app.
  2. Notice that the gameplay should be blocked until signing the user into Xbox Live services. However, your app is still playable by cancelling/skipping Xbox Live login.

You can view the Xbox Live documentation for more information. Your game may not appear in the Creators Collection until this has been resolved.
Tested Devices: Windows 10 Xbox


#55

passsed cert

Update: Passed certification!

Still planning on launching this game sometime next month when the other platforms are ready.

Something surprising and quite nice: the Xbox Live SDK is now open source. I found their leaderboards example in the samples useful too.


#56

@rusty congrats!! Maybe it is time for me to buy an Xbox one!


#57

Hi,

Thank you.
Do you have any experience with Kinect?
What is preferred way to connect cocos2d-x, Xbox and Kinect?

Regards,
CHP


#58

Microsoft announced yesterday that they’re significantly increasing the resources available on Xbox for UWP games in the fall update.

  • 6 CPU cores - up from 4
  • 5GB of RAM - up from 1GB
  • Full GPU Access - up from 45%

The announcement also states the full GPU access is for DirectX 12 games. I’m not sure if there will be an increase for DirectX 11. Cocos2d-x uses ANGLE to convert it’s OpenGL ES calls into DirectX 11, so I’m not sure if the GPU improvement will affect Cocos2d-x games.

For me, the most significant change will be the increase to RAM.

@slackmoehrle Thank you! Looking forward to sharing the game soon.

@CrazyHappyGame According to this list of not supported features on Xbox, only some of the Kinect works.

Xbox Universal Windows Apps don’t support skeletal tracking. Xbox provides support for using the infrared, depth, and color feeds from Kinect.


#59

This is good news any way you slice it!


#60

Ok, first Xbox One game released! Train Bandit is now live on Xbox One. I made a new thread for it here.