I'm curious how human multiplayer works with webassembly. I assume it uses websockets, but how does the code hook into it? How does the original code compile?
Show HN: Full Freeciv client running on WebAssembly
11–20 of 33 posts
Re: Show HN: Full Freeciv client running on WebAssembly
#12Does not work on firefox
Re: Show HN: Full Freeciv client running on WebAssembly
#13I'm curious how human multiplayer works with webassembly. I assume it uses websockets, but how does the code hook into it? How does the original code compile?
Qt and emscripten took care of the bulk of it. Emscripten turns socket calls into websocket somewhat "transparently". The error handling is slightly different, but it only took minor code changes to get that working. More effort was involved in making the Qt event loop play nicely in the browser. Freeciv is based on a server-client model, we host servers that the wasm clients connect to via websockets.
would it be possible to make this completely p2p so that another browser hosts the server and connect to it via webRTC style?
Re: Show HN: Full Freeciv client running on WebAssembly
#14Re: Show HN: Full Freeciv client running on WebAssembly
#15Earlier quoted context omitted.
Qt and emscripten took care of the bulk of it. Emscripten turns socket calls into websocket somewhat "transparently". The error handling is slightly different, but it only took minor code changes to get that working. More effort was involved in making the Qt event loop play nicely in the browser. Freeciv is based on a server-client model, we host servers that the wasm clients connect to via websockets.
> we host servers that the wasm clients connect to via websockets. would it be possible to make this completely p2p so that another browser hosts the server and connect to it via webRTC style?
Re: Show HN: Full Freeciv client running on WebAssembly
#16I've been playing Freeciv for years, but was disappointed that the pool of players was dwindling. A few of the members of the community stepped up to work on revitalizing the project. We decided to focus on WebAssembly to run on browsers, dropping support of the GTK+ and SDL clients in favor of the Qt client that we decided would make it easier to create a Wasm port, and eventual mobile apps. There's still a lot of U…
When I played some multiplayer freeciv, the playstyle was weird to say the least, a lot of early agression. Then I spectated a lot of the extreme island/race to stealth fighters games too.
Re: Show HN: Full Freeciv client running on WebAssembly
#17Re: Show HN: Full Freeciv client running on WebAssembly
#18Does not work on firefox
Admittedly we have not tested on firefox as much, but I suspect that is happening is that we have a race condition in waiting for the 30+MB package of wasm and data files to load.
How are you hosting the site and assets?
Re: Show HN: Full Freeciv client running on WebAssembly
#19Is there a FAQ somewhere? I couldn't see a link to any help or anything.
Re: Show HN: Full Freeciv client running on WebAssembly
#20Earlier quoted context omitted.
Admittedly we have not tested on firefox as much, but I suspect that is happening is that we have a race condition in waiting for the 30+MB package of wasm and data files to load.
This is impressive and shows a lot of dedication! How are you hosting the site and assets?