-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Godot iOS fix: Asmjs support #31383
Godot iOS fix: Asmjs support #31383
Conversation
You need to squash the commits together (see http://docs.godotengine.org/en/latest/community/contributing/pr_workflow.html#mastering-the-pr-workflow-the-rebase) |
Hi! Thanks for the PR. I'd like to note again as I mentioned on the issue that this current implementation has a very important issue: in asm.js iOS, sound playback is unsufferably distorted. At least on the devices we had for testing, which was the iPhone X and some form of iPad (don't remember which model at this moment). Due to this issue I would be hesitant to call iOS a supported platform, at least without sufficient clarification in documentation on this limitation. But even then, for a large amount of games sound might be an essential feature. Ideally someone with more knowledge of the engine's workings might be able to figure the problem before merging into a release. |
Thanks, I'll do it today! |
Hi @kroltan, Thanks for the reply, I think this issue could happen because |
fix syntax error on wrapper code for asmjs module updated web export to export both asmjs and wasm in a single build remove extraneous file expose wasm status to game iOS Safari supported platform? godotengine#26554 - fixed iPhone HTML5 export never loading godotengine#27019 - fixed iOS Safari supported platform? godotengine#26554 - fixed iPhone HTML5 export never loading godotengine#27019 - fixed iOS Safari supported platform? godotengine#26554 - fixed iPhone HTML5 export never loading godotengine#27019 - fixed fixup! expose wasm status to game fixup! expose wasm status to game fixup! expose wasm status to game
b66cdbc
to
8b8b313
Compare
@Chaosus think that I've squashed all commits in one |
@Chaosus, @akien-mga Best regards, |
I don't understand why you want to reintroduce asm.js. It was deprecated as WebAssembly works much better, and is now supported by all browsers: https://caniuse.com/#feat=wasm Reintroducing asm.js is not a good idea (as mentioned above, one unsolved problem is audio playback). If there are issues using WebAssembly on iOS Safari, they should be looked into and fixed - Safari claims Wasm support, so it should work or be fixed. |
Godot has been lacking in IOS HTML5 support for a long time for now. I'd see this as a stop gap until the actual wasm works in IOS browser, which I would not expect anytime soon. |
What are the actual problems? Are there bug reports? Did anyone look into them? If Safari claims Wasm support, it should be possible to run Godot Wasm exports on Safari. If not, that's a bug and it needs to be fixed.
Well OGG playback works fine in Wasm... There are tons of Godot games published with WebAssembly with sfx and music. |
quick search: The issue has been raised for over a year. I did not see anyone else working on this.
Ogg is not supported by Safari IOS: |
Let's look at it from a utility point: IOS HTML5 usage is currently broken. This solution does not affect any other HTML usage. It will allow HTML5 to play in IOS without ogg sound. That is much better than what we currently have. This is an open source project. Debugging IOS Html errors is rather esoteric. So, the chances of someone fixing the wasm issues short term is basically 0. So we can either have a somewhat working ios html for now or nothing for a long time to come. |
Apple fixed the wasm issue on iOS 13. tested it on an iPhone, worked fine |
I can confirm it starts up but crashes very quickly in IOS using wasm. Cannot debug, though |
have you tested different scnes/projects? |
As mentioned above, I don't want to reintroduce support for asm.js. WebAssembly is the way forward and works much better than our asm.js backend ever did. WebAssembly issues on iOS Safari are unfortunate, but this is also one of the worst browsers on the market in terms of standard compliance. The fault is on Apple and you should be sure to file support tickets with Apple about it. If anyone really wants to deploy a project for iOS HTML5 with asm.js, the code in this Pull Request can be merged manually for your custom builds. (You can retrieve it as a patch with https://github.com/godotengine/godot/pull/31383.patch.) |
I would agree with this now, that some wasm starts to work on IOS |
This might want to be looked at again. It’s been 3 1/2 years and this is still a problem. I can’t load a basic 2D game on iPadOS (every browser on iOS uses the same engine). The only reason I think this is something Godot should add a patch for is because Unity3D works perfectly fine on my iPad, it’s specifically Godot games that don’t launch, and it’s clear at this point Apple doesn’t care about making their browser function properly. asm.js should be part of Godot 4 as an optional fallback, similar to how Godot 3 let you fallback to GLES2 if you had to. Current version is iPadOS 16.5 |
@tbukfrc I'm not sure if going back to asm.js would resolve issues such as #67949 and #70621. Feel free to try on your end, but other issues such as audio playback may come back as mentioned above. asm.js is no longer maintained these days, so we would essentially have to take maintenance for ourselves, especially as people on non-iOS platforms will be using asm.js if it's reimplemented. While you could export your project for both asm.js and WebAssembly, this is probably not something most people will bother doing. In this case, this means the only playable version of a web game would be accessible via asm.js, which is less efficient. It could be possible to deploy asm.js as an automatic fallback by including both a WebAssembly and asm.js payload and choosing at load-time based on the current platform, but this can introduce difficult-to-debug issues. Also, Godot 4.x's web export requires WebGL 2.0, which is usually the problem on iOS and some macOS browsers rather than WebAssembly itself. See godotengine/godot-proposals#10044. |
Ah, that’s unfortunate. Is there any way I can export my Godot 4 project in Godot 3 with GLES2 then, if that’s the main problem? |
You would need to downgrade your project to Godot 3.x. Godot 4 has a built-in tool to convert Godot 3 projects to Godot 4, but no such tool exists for downgrading projects yet. It's not just a matter of performing replacements the other way around, as scene/resource files need to be saved in a way that restores numerical IDs as opposed to string UIDs. |
This PR is needed for all iOS HTML5 build to work well, tested on iPhone 6s, 8, iPad 2015, in browsers: Safari and Chrome. Current implementation works well.
First 5 commits were done by @kroltan, I just wanted to initiate the PR due to @kroltan doesn't have time to do it. Last commit provided in current PR is needed for the HTML5 build to do not give the error of, that engine couldn't find the pkg file. If more detailed information is needed, I can provide it by request.