• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

XBox One... kinda ;)

SLotman

Active member
3rd Party Module Dev
Tutorial Author
Joined
Jul 3, 2017
Messages
261
So, I've been thinking on a XBox One target for quite a while, specially since the WP8 target is *so* similar to the examples that exists on the devkit.

Never got to do it. But last night a light bulb turned on over my head ^_^

What about UWP, specially HTML5 UWP?

All I can say is YES, it works. I build a minimal UWP html5 app on VS2015 (an empty one), copied the index.html of my game, the main.js and all the data... and presto, I had my game running on XOne!

I had more trouble making VS2015 to upload the game to XOne than to building the game itself. So, ladies and gentlemen - if your game can run on HTML5, it can easily be ported to XBox one.

I don't know how to setup everything so monkey can auto-generate all the stuff, even compiling and uploading it to the Xbox (I don't think its even possible to upload it without opening the code on VS), but it is dead easy to make an UWP target this way :)

Right now my Xone is updating (grrr...) maybe tonight I'll upload a video of my game running.

And sorry if I'm rambling - its 8 AM and I've been up all night with this :D

Here's a small picture I took with my phone:
upload.jpg
 
ARG! I'm in update hell.

Apparently after updating my XOne, now if I ever want to upload anything to it, I must also update Visual Studio *and* the Windows SDK.

So far I can't upload my game again, keep getting errors when trying to connect to it :(
 
So far I'm stuck. I've upgraded to VS2017 and installed the latest Win10 SDK, but I can't upload anything anymore to the console :(

I'm trying to download and install the latest XDK to see if that fixes anything. If not... I'm stuck. I keep getting "DEP0100: Please ensure that target device has developer mode enabled." on deployment :(
 
Contacted Microsoft and I'm waiting for a reply from them - at first they think my devkit could have been disabled, since I never actually published anything :(

In another not so great news, I tried even VS2019 - took ages to install just for me to find out it doesn't support UWP + JS applications - so even if this works (it should), you'll need to have VS2015 or 2017 installed.
 
Is that a dev kit? Any normal Xbox can be now used to develop on.
 
Yup, mine is a devkit.

The good thing about it is that whatever I run on it, I have more "processing power" available than a "regular Xbox" with dev mode enabled (those can only run UWP AFAIK while devkits can run c++/DX12 programs)
 
Well... I have some good and bad news.

The good news is that you CAN make UWP apps running JS, and the HTML5 target works fine with it.

The bad news is apparently I won't be able to test it, since my devkit only runs stuff made with XDK (so, C++ only). To run UWP I'd need a regular console converted to dev-mode. o_O

I'm still talking with Microsoft trying to understand this, since I *did* actually ran it. Just the last update that broke everything and I couldn't do anything about it :(
 
Hah!

I left "development mode", then went back to it again... and now I'm running UWP apps! Take that Microsoft! ^_^
 
A small step by step tutorial:

0. Export your game to HTML5. Make sure it runs fine on Edge.
1. Open VS2017 (I'm using the Professional version - I think all my troubles were because I was using the community edition...!)
2. Create a new Project. Select Javascript->Blank App (Universal Windows)
3. In the next window, select the target version as high as possible (I'm using 18362.0 on my test). Min version could be anything.
4. Open package.appxmanifest. On "Application", set 'start page' to ms-appx-web:///index.html
4.1 Go to "Content URLs" add ms-appx-web:///index.html as an URl, rule 'include', access 'all'.
5. In the solution explorer, create a folder called 'data'. Copy everything in your 'data' folder from Monkey/Cerberus in there.
6. Copy the html file over the solution's index.html. Alter the script src to point to js/main.js instead of plain "main.js"
7. overwrite "main.js" in the js folder with the one on your monkey/build folder.
8. Open the index.html file. Where you see the window.onload = function(e) { ... } add this:

JavaScript:
            var view = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
            view.addEventListener("resize", updateSize);
            view.tryEnterFullScreenMode();

This will make the app to run in fullscreen mode.

AND DONE!

Ok, not quite. But you can see your game running after that. If you're running on Windows, it will respond to keyboard, mouse, etc. If you're on XBox, Monkey's joystick functions will work out of the box.

The only caveat I couldn't figure out so far is the (B) button. Pressing it exits the UWP app, and I don't know how to change or block this behaviour yet.
 
Thanks for the instructions. That is awesome.

How smooth does it run?
 
And apparently that "B" button is a problem: https://github.com/Scirra/Construct-3-bugs/issues/942
They talk about some sort of fix, but I can't figure it out what it is :(

How smooth does it run?
For now I'm testing with old Monkey's HTML5 / Canvas and it runs pretty well - But it did give some slowdowns here and there. I want to tackle this 'back button' issue, and then I'll try that webgl target, which should make thinks faster :)
 
Bingo! Just added this (also on window.onload):


JavaScript:
            var systemNavigationManager = Windows.UI.Core.SystemNavigationManager.getForCurrentView();
            var systemNavigation = Windows.UI.Core.SystemNavigationManager.getForCurrentView();
            systemNavigationManager.addEventListener("backrequested", handleSystemNavigationEvent.bind(this));

            function handleSystemNavigationEvent(args) {
                args.handled = true;
                history.back()

            }

No more problems with the back button :)
 
Awesome. If the build and deploy process can be done via command line and a prebuild template, then you laid out the ground for a new target.
Have to test if the community version of MSVC can be used with a regular XBox One.
 
I don't know about the command line, or anything - but I just tested html5 with webgl (that 'mungo' target, I 'adapted it' to have joystick support, taking code from Monkey regular HTML5 target) and it worked BEAUTIFULLY.

Worst case scenario it could just export the project to be run from VS. On a retail XBox the community edition should work fine :)

Also, the same UWP project can be used on Windows 10 devices (PCs, tablets...), so even if you don't have a XOne, this could still be interesting :)
 
I'm sorry about the awful video quality - was filming with my old Windows Phone, while playing the game with my other hand ^_^

 
Just revisited this topic after reading about html5 games on the XBox. @SLotman you basically showed off the steps to create/modified a target here.
I just need an Xbox now to test this. I can't wait!
 
And this should also work on the new ones too. The only issue is having to use VS2017 since MS removed UWP on VS2019 :/
 
Back
Top Bottom