-
Notifications
You must be signed in to change notification settings - Fork 109
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
Idea: Networking/Sockets #67
Comments
As far as I understand, you're building a WASM-only game/engine, so then something Emscripten-specific could work too, right? This introduction from @Squareys might help: https://blog.squareys.de/emscripten-sockets/ We actually discussed introducing wrappers for these APIs directly to Corrade/Magnum but then other things took a priority. Looking at how Emscripten wraps websockets to mimic the Unix sockets, I'm wondering if there's a way to use those APIs directly, without the extra wrapper layer (and possibly code size / runtime overhead). ... actually, there seems to be something: https://emscripten.org/docs/api_reference/emscripten.h.html#socket-event-registration (I didn't use any of these myself, though). Hope this helps! |
Not exactly, my idea is to build a generic setup project that works well when targeting native mobile, web and desktop (client and server). This is why magnum is an excellent choice in terms of graphics and audio. The ultimate goal would be to write a game I have in mind, but it requires a networking so I'm currently investigating what could I use. Ideally a thin abstraction layer over sockets would be enough but if it has more things (like a websocket protocol already implemented for the server) then it would be better. I also discovered HumbleNet that looks like the best alternative for P2P games where the host could be one of the players. I'm still thinking if making a new lib with custom optimized bindings in emscripten and part of the API using HumbleNet is a good idea. |
Hi @isc30 ! I am building a WASM-centered engine based on magnum and have written a networked WASM game with Magnum before (=> WebVR Pong, though the network mode is currently disabled):
Abstractions are nice, but when it comes to sockets, trying to abstract those for emscripten seems to mainly cause a lot of confusion. HumbeNet looks nice, using something like that is probably the way to go. Feel free to ask more, if that doesn't answer your questions 🙂 |
It's really difficult to find a good/lightweight library with no dependencies that also compiles with emscripten regarding sockets.
-s USE_SDL=2 -s USE_SDL_NET=2
) and it isn't easy to integrate (no websocket layer for the server, many bugs, many incompatibilities, etc)I know this is a crazy idea that maybe should be added as a plugin/integration to Magnum but it would open a world of possibilities
Wasm + GPU Graphics + Audio + Networking == fully fledged game framework
The text was updated successfully, but these errors were encountered: