Creating web interface for standard Freeciv server

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
User avatar
Corbeau
Elite
Posts: 719
Joined: Mon Jan 13, 2014 11:13 pm

Creating web interface for standard Freeciv server

Postby Corbeau » Sun Dec 03, 2017 1:30 pm

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.

Lachu
Elite
Posts: 301
Joined: Sat May 04, 2013 2:19 pm

Re: Creating web interface for standard Freeciv server

Postby Lachu » Sun Dec 03, 2017 2:14 pm

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.
Last edited by Lachu on Sun Dec 03, 2017 3:11 pm, edited 1 time in total.

Lachu
Elite
Posts: 301
Joined: Sat May 04, 2013 2:19 pm

Re: Creating web interface for standard Freeciv server

Postby Lachu » Sun Dec 03, 2017 2:28 pm

Just one other thought.
To make it working, you/I/whoever should use emscripten module support. I never used it (before).

User avatar
AndreasR
Elite
Posts: 685
Joined: Thu May 02, 2013 10:26 pm
Location: Norway

Re: Creating web interface for standard Freeciv server

Postby AndreasR » Sun Dec 03, 2017 4:32 pm

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

User avatar
Corbeau
Elite
Posts: 719
Joined: Mon Jan 13, 2014 11:13 pm

Re: Creating web interface for standard Freeciv server

Postby Corbeau » Sun Dec 03, 2017 4:56 pm

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

Lachu
Elite
Posts: 301
Joined: Sat May 04, 2013 2:19 pm

Re: Creating web interface for standard Freeciv server

Postby Lachu » Sun Dec 03, 2017 5:31 pm

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.

User avatar
dunnoob
Elite
Posts: 326
Joined: Mon Dec 23, 2013 3:13 am
Location: Hamburg
Contact:

Re: Creating web interface for standard Freeciv server

Postby dunnoob » Tue Dec 19, 2017 12:26 am

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.