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.
Train Bandit is live on the Xbox One Store. I’ve received a couple nice emails from Xbox One players. (Which is nice!)
Also, I’m seeing a few mysterious crashes. I’m not sure why they are happening and I’ve not seen any of them myself. But I wanted to post this here for anyone else running into similar issues. This crash info is all from Microsoft dev dashboard. (Which is also quite nice!)
UPDATE: Looks like the crashes were my fault. Fixed in an update.
Following up on the mysterious crashes, they might have been all related to another bug that I fixed. Still trying to independently verify, but everything seems to be going solid now.
I’ve been profiling Xbox One because I’m running into performance issue in more complex projects. I was stumped for a while, but found a very helpful post from flowerfx on performance fixes for Windows Mobile.
The relevant fix for me was in void Renderer::drawBatchedTriangles() by changing a GL_STATIC_DRAW usage to GL_DYNAMIC_DRAW:
The other suggestions from flowerfx didn’t seem to make a difference on Xbox One. I’m still trying to improve performance more, but this bit was a strong start.
Oddly, this use of GL_DYNAMIC_DRAW is contrary to Microsoft’s ANGLE performance tips. ¯_(ツ)_/¯
I know Win10 support isn’t supported anymore… but I was hoping someone who released a game on Xbox could chime in.
I can’t get the scene to fill the full screen on my Xbox One S.
I’m able to compile and run a project on Xbox (I’ve tried several different versions of cocos2d), however no matter what I set the resolutions to, I can’t get it to fill the entire screen. Setting the resolutions seem to only effect what is rendered within the frame - if that’s what its called. I tried setting the frame size manually too but that seemed to have no effect. I have black borders all around, and the director frame size is never at 1920x1080 no matter what I do.
The weird thing, is I can move the cursor into the black border.
UWP app in Windows opens fine in a window or if I launch it Full Screen.
See this image to see what I am talking about. I gave the rendered scene a blue background so you could see the black border.
I’ve tried all sorts of things… but no differences… it’s mostly unchanged from the the default template. This is one I’m playing with from 15.1.
#include "AppDelegate.h"
#include "HelloWorldScene.h"
// #define USE_AUDIO_ENGINE 1
// #define USE_SIMPLE_AUDIO_ENGINE 1
#if USE_AUDIO_ENGINE && USE_SIMPLE_AUDIO_ENGINE
#error "Don't use AudioEngine and SimpleAudioEngine at the same time. Please just select one in your game!"
#endif
#if USE_AUDIO_ENGINE
#include "audio/include/AudioEngine.h"
using namespace cocos2d::experimental;
#elif USE_SIMPLE_AUDIO_ENGINE
#include "audio/include/SimpleAudioEngine.h"
using namespace CocosDenshion;
#endif
USING_NS_CC;
static cocos2d::Size designResolutionSize = cocos2d::Size(1920, 1080);
static cocos2d::Size smallResolutionSize = cocos2d::Size(1920, 1080);
static cocos2d::Size mediumResolutionSize = cocos2d::Size(1920, 1080);
static cocos2d::Size largeResolutionSize = cocos2d::Size(1920, 1080);
AppDelegate::AppDelegate()
{
}
AppDelegate::~AppDelegate()
{
#if USE_AUDIO_ENGINE
AudioEngine::end();
#elif USE_SIMPLE_AUDIO_ENGINE
SimpleAudioEngine::end();
#endif
}
// if you want a different context, modify the value of glContextAttrs
// it will affect all platforms
void AppDelegate::initGLContextAttrs()
{
// set OpenGL context attributes: red,green,blue,alpha,depth,stencil
GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8};
GLView::setGLContextAttrs(glContextAttrs);
}
// if you want to use the package manager to install more packages,
// don't modify or remove this function
static int register_all_packages()
{
return 0; //flag for packages manager
}
bool AppDelegate::applicationDidFinishLaunching() {
// initialize
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
glview = GLViewImpl::createWithRect("Lumps of Clay", cocos2d::Rect(0, 0, designResolutionSize.width, designResolutionSize.height));
#else
glview = GLViewImpl::create("Lumps of Clay");
#endif
director->setOpenGLView(glview);
}
// turn on display FPS
director->setDisplayStats(true);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0f / 60);
// Set the design resolution
glview->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, ResolutionPolicy::NO_BORDER);
auto frameSize = glview->getFrameSize();
// if the frame's height is larger than the height of medium size.
if (frameSize.height > mediumResolutionSize.height)
{
director->setContentScaleFactor(MIN(largeResolutionSize.height/designResolutionSize.height, largeResolutionSize.width/designResolutionSize.width));
}
// if the frame's height is larger than the height of small size.
else if (frameSize.height > smallResolutionSize.height)
{
director->setContentScaleFactor(MIN(mediumResolutionSize.height/designResolutionSize.height, mediumResolutionSize.width/designResolutionSize.width));
}
// if the frame's height is smaller than the height of medium size.
else
{
director->setContentScaleFactor(MIN(smallResolutionSize.height/designResolutionSize.height, smallResolutionSize.width/designResolutionSize.width));
}
register_all_packages();
// create a scene. it's an autorelease object
auto scene = HelloWorld::createScene();
// run
director->runWithScene(scene);
return true;
}
// This function will be called when the app is inactive. Note, when receiving a phone call it is invoked.
void AppDelegate::applicationDidEnterBackground() {
Director::getInstance()->stopAnimation();
#if USE_AUDIO_ENGINE
AudioEngine::pauseAll();
#elif USE_SIMPLE_AUDIO_ENGINE
SimpleAudioEngine::getInstance()->pauseBackgroundMusic();
SimpleAudioEngine::getInstance()->pauseAllEffects();
#endif
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground() {
Director::getInstance()->startAnimation();
#if USE_AUDIO_ENGINE
AudioEngine::resumeAll();
#elif USE_SIMPLE_AUDIO_ENGINE
SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
SimpleAudioEngine::getInstance()->resumeAllEffects();
#endif
}
Nope I was playing with that as well. The breakpoints don’t get triggered there. I tried to dig into the code for CCGLViewImpl-winrt.cpp and tried to hard code some values in where I thought it was initializing it and there was no change.
Also when I run the app, the debugger says the following, not sure if this helps, but the first line here I thought might be of interest
Hmm… Yeah I tried that too… It basically changes the resolution of what’s going on within the blue rectangle and effects sizes of sprites, but it doesn’t bring it to the borders of the screen.
I’m running on SDK 10.0.14393.0 as that seems to be the only one that builds without a ton of compile errors.
Yeah I’ve scoured this thread quite a bit just to get it compiling and running- looking to see if I missed anything, and I see some helpful stuff for later too. I just would love to get this full screen! Then I’d be free to move on.
@Rusty what version of Cocos2d-x did you end up releasing on?
Shoot I just looked it up… If I’m reading it right, minimum is now 10.0.16299. link
Looks like unless I can get it to build on a newer SDK I may be out of luck then. Though I tested on 3.13.1 and it was the same thing. Must be something internal to Xbox and the latest OS version then if it used to work for you…
if anyone else can recreate the issue or have a fix, or able to compile at a higher SDK than 10.0.14393 - I’d love to hear any fixes!