Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Full Freeciv client running on WebAssembly (freecivweb.com)
97 points by freeciv21 on Jan 23, 2022 | hide | past | favorite | 31 comments



I'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 UX tuning to do, but we wanted to put this out there today to get some early feedback.


What kinds of games are being played? How is longturn? Regular multiplayer?

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.


There are only about 4-6 players left who still do regular multiplayer, that is playing a whole game in a 2-3 hour session. And they tend to be a traditional sort who still use an old 2.0 "warclient" from over a decade ago. The playstyle there converged pretty quickly on radio around turn 65, and extreme fighting for the rest of the game. Longturn works pretty well, but it takes a bit of a commitment to play every day, which is one reason we are trying to revive other game styles.


haha, ok warclient is what I remember. I never seriously played myself, but it was intriguing. Happy to hear it's still going on


Plenty of other WebAssembly ports that are online, another one online is The Curse of Monkey Island: (press escape key as soon as it loads to skip to playing!)

https://personal-1094.web.app/scummvm.html


Don't get too invested in the gameplay though, as after 15 minutes the game stops and prompts you to host it yourself.


Is this project related to freecivweb.org ? If so, how? If not, isn't there room for a fair amount of confusion there? What are the main differences from .org that players should be aware of?

Is there a FAQ somewhere? I couldn't see a link to any help or anything.


It's not related, but we know of each other. Regarding technicalities, FCW.org is based on different client architecture. FCW.com has - or it is planned to have - most capabilities as the native client. Right now changing tilesets comes to mind. But if you played both FCW.org and Freeciv on the native client,l you know the differences.

Regarding organisation, the two sites are quite different when it comes to developing rulesets: FCW.org sticks to its own Multiplayer line of game rules, while FCW.com is going to go much wider and incorporate a lot of flexibility and development in different directions, something FCW.org has been refusing to do for years.

As for FAQ, this is just in its infancy, sorry, but we'll gladly answer all questions either here, if we catch them, or on Discord, which is much more lively. There is also a forum at longturn.net which is also a bit slow, but we get stuff eventually.


I am so excited about WebAssembly. I truly hope that in just a few years it will have revolutionized how people write code and run apps.


Is there anywhere I could go to pay someone to port an open source project to webassembly? Would pay for a working version of vcv rack 2 https://github.com/VCVRack/Rack


Issues that I might anticipate there would be interfacing with the browser’s audio apis. Freeciv uses sdl audio, which works decently with browser apis, but “clipping” sounds can be observed. My email is in my profile.


Exciting project. Where is the webassembly source located? I could not find it here : https://github.com/longturn/freeciv21


https://www.freecivweb.org/ is way better, as it is a pure native HTML5 client version. I may be slightly biased though. Freeciv is fun!


Does 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.


I generally think it'd be wise to develop for either Safari or Firefox first. Then fix for Chrome after.

i.e. develop for the underdog(s) first.


This is impressive and shows a lot of dedication!

How are you hosting the site and assets?


Hetzner, with Cloudflare to do the CDN for such large game assets.


same issue in FF I think. "Couldn't start server"... and it is a pretty quick timeout, like 2 seconds


The link with the Curse of Monkey Island works fine on my Firefox mobile


Does not work on Chrome or Safari either


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?


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?


It should be possible, but it would take more invasive netcode changes to be able to handle webRTC. Emscripten does not do similar translation of socket calls to webRTC.


Very cool. In what language did you write it to produce wasm bytecode?


Freeciv is about 85% C: https://github.com/freeciv/freeciv


We have forked it and are allowing more C++, but it is still mostly C style. https://github.com/longturn/freeciv21


Who is "we" and what is the original freeciv project doing? Also alive?


The main freeciv21 developers you can see on the repo are mir3x and lmoureaux. The original freeciv project still has some activity, but we wanted to iterate faster, focus more on multiplayer, and allow modern C++ language constructs to make development easier.


Are you a full time developer? Our startup is currently working to bring Unreal Engine to the web, we've also done various ports of classic games to WebAssembly. We're building a platform and suite of optimization tools to enable any game developer to be able to deploy 3D games and apps to the browser. WebAssembly, WebGPU, and WebXR are going to disrupt the games industry and create a whole new platform category that doesn't revolve around 30% fees or walled gardens. It's also the path to the metaverse.

Our Discord if you're interested: https://discord.gg/3t8bj5R




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: