Page 1 of 1

Creating web interface for standard Freeciv server

Posted: Sun Dec 03, 2017 1:30 pm
by Corbeau
Just a thought...

How difficult would it be to enable Freeciv server to communicate with a web interface? And I mean a standard server, that anyone can start.

There is a number of people who are playing from computes where they can't install Freeciv and web access would be a saviour. Also, current Freeciv Web doesn't cover this because it doesn't have flexible rulesets, no tilesets, can't adjust server settings, game gets deleted if you're off for a while, basically, it's a "public server" where you can't set your own rules for a customised game.

Re: Creating web interface for standard Freeciv server

Posted: Sun Dec 03, 2017 2:14 pm
by Lachu
This year I was ported 7kaa (Seven Kingdoms something) to the web. 7kaa is an opensource game using SDL2 library. Porting isn't too hard if game uses SDL library, but one thought are in my mind - I must cut multiplayer, because it is using enet library, which isn't ported to emscripten. Even if game is using some library with emscripten support, there may be some proxy server run to communicate with C program using standard Unix sockets needed (i believe freeciv-server does), but that's rather no problem - there's many standalone proxy server written in C/Python and apache2 extension. I don''t remember protocol name, which wraps communication.

If you give me good reason to port SDL2 client (or maybe Freeciv-server too) to the web, using emscripten, then I can help.
I also must wrote, that there's Qt5 port to emscripten, but I hear SDL2 client is more complete than Qt5.

Re: Creating web interface for standard Freeciv server

Posted: Sun Dec 03, 2017 2:28 pm
by Lachu
Just one other thought.
To make it working, you/I/whoever should use emscripten module support. I never used it (before).

Re: Creating web interface for standard Freeciv server

Posted: Sun Dec 03, 2017 4:32 pm
by AndreasR
What you are describing here is essentially Freeciv-web: it is a web interface for Freeciv. I would strongly suggest that developers interested in a web version of Freeciv contribute to Freeciv-web, rather than try to create yet another web version. Compiling the Freeciv SDL client and Freeciv C server using Emscripten and running that in the browser will not allow multiplayer, longturn or play by e-mail. The issues with Freeciv-web described in this thread should be easy to fix, but most of those issues are not frequently requested by the players. Furher the SDL client was designed for desktop computers, not for running in a web-browser on many types of devices, such as smartphones and tablets, so the SDL user-interface would not be very userfriendly on the web.

If anyone is interested in running Freeciv-web with their own custom rules, it would be much easier to simply run their own instance of Freeciv-web. The information about how to do that is documented here: https://github.com/freeciv/freeciv-web

Re: Creating web interface for standard Freeciv server

Posted: Sun Dec 03, 2017 4:56 pm
by Corbeau
Well, the biggest issue is the one I haven't mentioned (and I should have) is that you can't connect desktop client and web interface to the same server. Which basically means those two are hopelessly separated communities. Which is bad because:
1. Web is superior when it comes to availability and casual...ity (you can connect anytime and from anywhere, literally)
2. Client is superior with interface: multiple and very different tilesets, many different types of information at a touch of a key, more stable, basically, a shoe that fits because it was made *for* Freeciv

Re: Creating web interface for standard Freeciv server

Posted: Sun Dec 03, 2017 5:31 pm
by Lachu
AndreasR wrote:What you are describing here is essentially Freeciv-web: it is a web interface for Freeciv. I would strongly suggest that developers interested in a web version of Freeciv contribute to Freeciv-web, rather than try to create yet another web version. Compiling the Freeciv SDL client and Freeciv C server using Emscripten and running that in the browser will not allow multiplayer, longturn or play by e-mail. The issues with Freeciv-web described in this thread should be easy to fix, but most of those issues are not frequently requested by the players. Furher the SDL client was designed for desktop computers, not for running in a web-browser on many types of devices, such as smartphones and tablets, so the SDL user-interface would not be very userfriendly on the web.

If anyone is interested in running Freeciv-web with their own custom rules, it would be much easier to simply run their own instance of Freeciv-web. The information about how to do that is documented here: https://github.com/freeciv/freeciv-web
So maybe better if Freeciv-web developers contribute to Freeciv, so Freeciv is able to play with Freeciv-web freeciv-server? And there will be possibility to play longurn or by e-mail?

In my opinion - Emscripten version will use canvas and other modern web technologies.

Re: Creating web interface for standard Freeciv server

Posted: Tue Dec 19, 2017 12:26 am
by dunnoob
Corbeau wrote:Just a thought...
There is a number of people who are playing from computes where they can't install Freeciv
If that's an issue with permissions, if they can't install Freeciv on their box they also can't start a web server, or what do you have in mind? On Windows the NSIS installer can in theory (= I never tested it) install Freeciv per user below ?:\users\... instead of per machine below ?:\Program files ...

Also on Windows you can get a portable apps distribution running anywhere. It's actually the same structure you get from an NSIS installation, but without an uninstall entry in the registry, with all languages, and wherever you want it, e.g., on a stick.