MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
437 stars 51 forks source link

[Problem/Bug]: My Construct 3 game does not work on Xbox. #4370

Open Pedro1234-code opened 7 months ago

Pedro1234-code commented 7 months ago

What happened?

Since WebView2 released on Xbox I tried to port my game made using Construct 3 for it. It always worked fine on PC, and still does, but never worked on Xbox. It launches but the launch screen is empty. The only thing that appears is the "Play" button and the background music that plays normally. Once the Construct 3 beta r378 was released (this version officially adds support for Xbox/UWP WebView2 export) I tried to export by the official methods but I still got the same results.

Note that I also tried to launch the game in the Edge browser on Xbox through itch.io and the same thing happened.

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

10.0.22621.0

Framework

WinUI2/UWP

Operating System

Xbox

OS Version

10.0.22621

Repro steps

  1. Export the game in Construct 3
  2. Build with VS2022 and deploy it into Dev Mode
  3. Launch it on the console.

Repros in Edge Browser

Yes

Regression

No, this never worked

Last working version (if regression)

No response

AB#49099762

victorhuangwq commented 6 months ago

@AshleyScirra would this issue be more relevant to Construct 3?

AshleyScirra commented 6 months ago

This was also reported to us directly here: https://github.com/Scirra/Construct-bugs/issues/7823

Here is a Visual Studio solution that can be tested: Viajante Espacial.zip

I cannot reproduce this on my Xbox One in developer mode: the game displays identically for me both when run on Windows, and when using the "Remote machine" option to launch directly on the Xbox. However I was testing on an Xbox One, and on the issue filed with us they noted they were using Xbox Series S.

The described result would appear to suggest that the WebGL-rendered canvas element remains black, while other HTML elements (e.g. the button) and audio playback continue to work normally. This could potentially be a bug in the WebGL implementation in WebView2 on the Xbox Series S specifically. The affected user also notes that it works OK on Windows, and only exhibits a problem on Xbox Series S, which is usually good evidence of a problem with WebView2 on Xbox rather than any problem with Construct itself. In fact based on the comment that it reproduces with the Edge browser on Xbox when published to the web, this suggests a problem with the Edge/Chromium browser WebGL implementation on Xbox rather than something specific to WebView2 only. (Is there somewhere else such issues should be reported?)

I don't currently have an Xbox Series S, and would rather not order one in given the likelihood that this is a problem with Edge/WebView2 and not Construct, so I would recommend Microsoft try reproducing this by running the Visual Studio solution I provided on an Xbox Series S.

Pedro1234-code commented 6 months ago

Note that the same thing happens in Edge browser on Xbox.

victorhuangwq commented 6 months ago

Thanks for looking into it @AshleyScirra. @jennifer-jacobs could you help see if the issue reproduces, specifically on the Series S? Seems like it does not repro on Xbox One. Do let me know if someone else is better suited for looking into it.

Pedro1234-code commented 6 months ago

Just to add that the full game is now released on Microsoft Store for Xbox. I decided to release so more people could test without Dev Mode. The name is "Viajante do Espaço".

Here is the link if anyone would like to test on the full sized version (not the stripped down):

https://www.microsoft.com/store/productId/9MTCN09D44TL

Pedro1234-code commented 6 months ago

Heard from another person with Series S that same thing is happening to her. I also want to add that I'm not able to play preview on Construct 3 on Xbox Edge. The entire screen goes black for a second and then the tab is closed.

jennifer-jacobs commented 6 months ago

Hi @Pedro1234-code, Which API specifically doesn't work on Series S? Can you point me to the code in your sample app that has the difference in behavior?

Also, I'm curious if this repros on a Series X (if you have one)?

Pedro1234-code commented 6 months ago

Hi @Pedro1234-code, Which API specifically doesn't work on Series S? Can you point me to the code in your sample app that has the difference in behavior?

Also, I'm curious if this repros on a Series X (if you have one)?

No I don't have an Xbox Series X, only the S sadly. I can't exactly point which API does not work, but I released the game on Microsoft Store to make it easier for testing (and heard from another Series S user that the same thing happened to her). If you want to test the game you can just download it, it's called "Viajante do Espaço" in portuguese. I can also send you the full project file but I don't think it's needed as there is already a stripped down version of it here. I also wanted you to understand that I don't have so much experience with coding and me and my team decided to use Construct specifically because it's more graphical and beginner friendly.

Also wanted to add that I'm 99% sure that it has some relation with the other bug where you can't play Construct 3 games on Edge. I think it's not related to WebView2 but more with the rendering engine.

Pedro1234-code commented 6 months ago

@jennifer-jacobs I can confirm that the issue reproduces on Series X. Got the confirmation from someone at Reddit that the same thing occurs on Series X.

jennifer-jacobs commented 6 months ago

I was also able to confirm this problem repros on a Series X. It's been added to our backlog!

Pedro1234-code commented 6 months ago

@jennifer-jacobs Ok, thanks. Hope it gets solved soon.

thejacs commented 5 months ago

Hi guys. Same problem testing on Xbox Series X

It works well on Windows, but when testing on Xbox Series X it just start in a black screen and later change to a white screen and gets frozen there forever (could be the background of my first scene, but not sure...).

My doubt is if this is only when testing through Visual Studio (Remote machine) or if the compilation would fail also with a native package executed from Xbox...

thejacs commented 5 months ago

Hi @jennifer-jacobs, How is this problem going on? Do you think guys it will be solved soon?

Also I guess, for what @Pedro1234-code said, it wouldn't make sense to upload a game to Xbox yet because the problem goes beyond the remote machine, is this right?

Pedro1234-code commented 5 months ago

@thejacs Didn't exactly understand your question. I already uploaded to Microsoft Store/Xbox Retail Mode as it's working perfectly on Xbox One but on Xbox Series it just shows the black screen.

thejacs commented 5 months ago

@Pedro1234-code, It was actually a question for Jennifer, sorry. I just meant that if the problem is not the remote machine (as you confirmed) it doesn't make sense to upload more games on Xbox Store for now, until they fix the problem on Series X/Y.

Pedro1234-code commented 5 months ago

@thejacs I uploaded first because it's working on Xbox One and second because it's easier for people to test.

thejacs commented 5 months ago

I know @Pedro1234-code What you did has been very useful. I said "more" games.

thejacs commented 5 months ago

Hi @victorhuangwq, is there any advance with this problem? Do you know when (more or less) will be able to upload UWP (WebView2) games to run on Xbox Series?

Thank you.

victorhuangwq commented 4 months ago

@thejacs and @Pedro1234-code I'm wondering if https://webglsamples.org/aquarium/aquarium.html works for you on Edge on Xbox Series?

thejacs commented 4 months ago

Hi @victorhuangwq . Yes, the aquarium sample works fine on Edge in my Xbox Series X.

thejacs commented 4 months ago

On the other hand, @victorhuangwq @AshleyScirra , I tried to open "Ghost Racer" (an example Construct 3 game) and it doesn't work on Xbox Series X Edge. I get a black screen and back to the editor. (But of course it works on PC Edge).

victorhuangwq commented 4 months ago

@thejacs could you get a dump of the browser and GPU process when you see the black screen if you know how to?

@AshleyScirra if the WebGL Aquarium works on the Xbox Series X, I don't want to entirely rule out the possibility of it possibly being a Construct 3 issue, or at least how it uses WebGL.

thejacs commented 4 months ago

@victorhuangwq I just develope indie games with Construct 3 and I'm not an expert on this area. But I can try if you explain to me what to do. I'll be glad to help.

AshleyScirra commented 4 months ago

I can't completely rule out there being some problem with Construct, but given that it works on all other platforms, usually this type of problem works out as a graphics driver bug, or a bug in the browser WebGL implementation.

victorhuangwq commented 4 months ago

We are still investigating this issue; we are indeed suspecting something to do with Xbox graphics driver bug. We have to figure it out from the crash dump.

thejacs commented 4 months ago

Thank you @victorhuangwq, I'm sure you guys will find the bug. Please let us know when we'll be able tu run Construct 3 Games on Xbox Series :D

victorhuangwq commented 4 months ago

No problem. Thanks for the patience, we provide any updates here.

thejacs commented 3 months ago

Hi @victorhuangwq / @AshleyScirra,

Is there anything new about this? It is a pity we still can not publish Construct 3 Games on Xbox Series because of this bug :S

victorhuangwq commented 3 months ago

We have some parties looking into this issue who are currently out of the office, we will circle back to this when they are back.

AshleyScirra commented 3 months ago

I ordered in an Xbox Series S and I'm now able to reproduce this. The canvas content is blank when run on the Xbox Series S specifically, but works correctly on Windows.

I managed to attach Edge DevTools to the Xbox Series S and it logs some errors - firstly from our engine with a "framebuffer incomplete" error, and secondly a "context lost" event.

Overall I'd say this looks a lot like a graphics driver bug (or possibly WebGL implementation bug) - I'll tinker with it and see if we can come up with a workaround, but dealing with graphics driver bugs can be really hard going.

AshleyScirra commented 3 months ago

I think I figured it out! The problem is on Xbox Series S, the WebGL extensions EXT_disjoint_timer_query_webgl2 and EXT_disjoint_timer_query are broken. Using these extensions appears to cause the WebGL context to crash. In Construct I've worked around the problem by making sure these extensions are not used in Xbox exports. The workaround is in the next Construct release (r394+) which should unblock publishing to Xbox for Construct users.

Of course, it would be great if Microsoft could still fix this - either return null for unsupported extensions, or better still, make sure those extensions work.

victorhuangwq commented 3 months ago

Thank you @AshleyScirra for figuring the issue out! I am following up with my team on this:

Of course, it would be great if Microsoft could still fix this - either return null for unsupported extensions, or better still, make sure those extensions work.

Does running https://registry.khronos.org/webgl/sdk/tests/conformance/extensions/ext-disjoint-timer-query.html on your Xbox Series S crash as well?

thejacs commented 3 months ago

Very good news! Thank you @AshleyScirra. Once (r394+) will be available, beta or stable, I will export my game again and try it on Xbox Series X too, so I can confirm you guys if it also works. Definately, it should :-)

Pedro1234-code commented 3 months ago

@AshleyScirra That's amazing news! Thanks for your dedication on solving this problem!

AshleyScirra commented 3 months ago

Just an update, the workaround is in Construct 3 r394 (which came out last week) and newer, so it should be possible to publish to Xbox using those releases.

AshleyScirra commented 2 months ago

@thejacs - this issue is about a specific problem with Microsoft WebView2. If you believe there are different problems with Construct, please file an issue on our own tracker following all the guidelines, as we need all that information to be able to help: https://github.com/Scirra/Construct-bugs

thejacs commented 2 months ago

Hi guys @victorhuangwq @AshleyScirra, I have been doing several tests more on Xbox Series X. Yes, I can confirm you that it now runs on the console, but definately the bug is still there somewhere. There are objects that randomly appear or dissapear. And not only sprites, also, for example, Text objetcs. I hope this info helps to solve the problem and to have Construct 3 Games 100% playable on Xbox Series soon.

thejacs commented 1 month ago

Hi @victorhuangwq, did you guys find the bug? It looks that Construct 3 games work properly in all platforms (even on desktop Edge or Xbox One) but not in Xbox Series X/Y. Let us know, please. It's taking too long :-(

victorhuangwq commented 1 month ago

So, I am assuming this issue replicate in the Edge Browser in Xbox Series X?

If so, could you try https://registry.khronos.org/webgl/sdk/tests/conformance/extensions/ext-disjoint-timer-query.html and see if this works on the Edge browser in Xbox Series X?

thejacs commented 1 month ago

Hi @victorhuangwq I made the test you asked for, and definately there are 3 errors only on Xbox Series X/S Edge. I also tried the test on 2 Desktop computer's Edge and even on Android Edge with no errors. So 100% is a Xbox Series X/S Edge bug. Let me know if you need anything else.

Test

Errors

thejacs commented 2 weeks ago

Hello @victorhuangwq, did you have time to check the 3 EDGE Fails that I posted? @AshleyScirra let us know what you think, please. I know is an EDGE bug, but maybe your opinion helps here. Thank you, guys.

AshleyScirra commented 2 weeks ago

There is a bug in the Xbox system that the latest Construct release has already got a workaround for. If you are using the latest release and there is still a problem, I would strongly advise to file a separate issue, as it is unlikely to be related to this issue, and trying to discuss it here will be confusing and make it harder to solve both problems.

thejacs commented 2 weeks ago

If you recomend that, I will start a new Issue, no problem. Yes, I even tried yesterday R403 Construct version, and still there are images and texts that just vanish (on Xbox Series X/Y). So definately is an Xbox bug.