+1 vote

Hello,

I've been doing tests with http client and StreamPeerTCP and both works fine on Windows, Linux, OS X, iOS & Android. I have a little performance issue on mobile devices but that's another issue.

I'm wondering about making a multiplayer html5 game and I've been reading that both http and StreamPeerTCP won't work on HTML5.

I tried both and get the same error with sockets & GET request when I export a game to html5:

bad ioctl syscall 21537

So... here comes my question:

  • Is there any possible way on Godot 2.x to do a multiplayer HTML5 game ?

I would like to know if there is any possible way to achieve this with the current Godot version.

in Engine by (84 points)

You can try this old thing https://github.com/marcosbitetti/Godot-Websocket
But I have no idea how works (and may need some tweaks since it is done for early 2.0), also HTML5 export in 2.x have some limitations so I don't know how optimal will be for that kind of use.

1 Answer

+2 votes

Currently the answer is no. However, for godot 3.0 it is planned to use the browser API to allow HTTP Client to work in the webassembly export. However, there is no current milestone set for this so when this will be implemented is unsure. Perhaps not for 3.0 stable, maybe 3.1. If you think it is important though you can raise an issue. An issue was already raised by myself: https://github.com/godotengine/godot/issues/11990.

You could add your voice if you feel it is quite important for your productions. WebSocket currently work rudimentarily as well but I have had a lot of trouble getting them working if you need a custom server. HTTP client is better and hopefully that will be added for web exports soon.

by (295 points)
edited by

Thx for your answer, Are WebSockets working on 2.x ?

Not officially by Godot I don't think. But I believe somebody has got them working before: https://github.com/marcosbitetti/Godot-Websocket

So you could give that a go.

I have just tried Godot-Websocket and it doesn't work when exporting to HTML5. This library uses StreamPeerTCP and when exported the project to HTML5 fails the same way

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected]gine.org with your username.