Freeciv-web is an open-source turn-based strategy game. It can be played in any HTML5 capable web-browser and features in-depth game-play and a wide variety of game modes and options. Your goal is to build cities, collect resources, organize your government, and build an army, with the ultimate goal of creating the best civilization. You can play online against other players (multiplayer) or play by yourself against the computer. There is both a HTML5 2D version with isometric graphics and a 3D WebGL version of Freeciv-web.
Freeciv-web is free and open source software. The Freeciv C server is released under the GNU General Public License, while the Freeciv-web client is released under the GNU Affero General Public License. See License for the full license document.
Currently known servers based on Freeciv-web:
- Freecivweb.org - Full Freeciv-web
- moving borders (Everything except longturn and real-Earth)
Freeciv-Web consists of these components:
-
Freeciv-web - a Java web application for the Freeciv-web client. This application is a Java web application which make up the application viewed in each user's web browser. The Metaserver is also a part of this module. Implemented in Javascript, Java, JSP, HTML and CSS. Built with maven and runs on Tomcat 8 and nginx.
-
Freeciv - the Freeciv C server, which is checked out from the official Git repository, and patched to work with a WebSocket/JSON protocol. Implemented in C.
-
Freeciv-proxy - a WebSocket proxy which allows WebSocket clients in Freeciv-web to send socket requests to Freeciv servers. WebSocket requests are sent from Javascript in Freeciv-web to nginx, which then proxies the WebSocket messages to freeciv-proxy, which finally sends Freeciv socket requests to the Freeciv servers. Implemented in Python.
-
Publite2 - a process launcher for Freeciv C servers, which manages multiple Freeciv server processes and checks capacity through the Metaserver. Implemented in Python.
-
pbem is play-by-email support.
For computers with x86 architecture, the recommended and probably easiest way is
to use Vagrant on VirtualBox.
FCW Install Docs on Wiki
Whatever the method you choose, you'll have to check out Freeciv-web to a directory on your computer, by installing Git and running this command:
git clone https://github.com/Lexxie9952/fcw.org-server.git
NOTE: In Dec.2023, the dev
branch is the active one, not the master
branch. Your git clone
statement should be changed to reflect that. This
is subject to change later.
You may also want to change some parameters before installing, although
it's not needed in most cases. If you have special requirements, have a look
at config.dist,
copy it without the .dist
extension and edit to your liking.
- As of November 2023, VirtualBox does not officially support Apple Silicon M chips (arm64). This may change later. If you find such support available, or if you want to use alternatives such as VMWare or Parallels, you will need to reconfigure your ~/Vagrantfile to link to an iso that's an arm64 version of the linux distro that will be used. There are some more notes in ~/VagrantfileMac for those looking into this.
- For Mac arm64 M-chips, successful installations have been achieved using
Multipass for the virtual machine. The Multipass.md document contains
info on setup steps for this. Instead of using
localhost
for the url to such a VM, you will use the IP address of that VM as found by doing amultipass list
command from Terminal.
- Please keep in mind that the files are to be used in a Unix-like system (some Ubuntu version with the provided Vagrant file). Line endings for text files are different in Windows, and some editors "correct" them, making the files unusable in the VM. If using VS Code for your editor (recommended), you can click in the lower right to change your end-of-line terminations; and also be sure to look up system-wide configuration of this throughout VS Code.
- There's some provision to recode the main configuration files when installing, but not afterwards. If you touch shared files after installation, please use an editor that respects Unix line-endings or transforms them with a utility like dos2unix after saving them (e.g., VS Code configured to LF).
Freeciv-web can be setup using Vagrant on VirtualBox to quickly create a local developer image running Freeciv-web on latest Ubuntu on your host operating system such as Windows, macOS (* see above), or Linux. This is the recommended way to build Freeciv-web on your computer.
- Install VirtualBox: https://www.virtualbox.org/ - Install manually on Windows, and with the following command on Linux:
sudo apt-get install virtualbox
- Install Vagrant: http://www.vagrantup.com/ - Install manually on Windows , and with the following command on Linux:
sudo apt-get install vagrant
- Run Vagrant with the following commands in your Freeciv-web directory:
vagrant up
This will build, compile, install and run Freeciv-web on the virtual server image. Wait for the installation process to complete, watching for any error messages in the logs.
NOTE: Vagrant is now configured to run with NFS on Linux and Mac, which speeds it up by 10-100 times. This should run out of the box for Mac OS X 10.5+ as well as Linux. If you are having problems on Linux, you might need to execute the following commands:
sudo apt-get install nfs-kernel-server nfs-common portmap
on Debian based systems or their equivalents.
- Test Freeciv-web by pointing your browser to http://localhost if you run Windows or http://localhost:8080 if you run Linux or macOS.
To log in to your Vagrant server, run the command:
vagrant ssh
The Vagrant guest machine will mount the Freeciv-web source repository in the /vagrant directory. Note that running Freeciv-web using Vagrant requires about 4Gb of memory and 3 Gb of harddisk space.
Install this software if you are not running Freeciv-web with Vagrant:
-
Tomcat 8 - https://tomcat.apache.org/
-
Java 8 JDK - http://www.oracle.com/technetwork/java/javase/downloads/
-
Python 3.6 - http://www.python.org/
-
Pillow v2.3.0 (PIL fork) - http://pillow.readthedocs.org/ (required for freeciv-img-extract)
-
Mysql 5.5.x - http://www.mysql.com/
-
Maven 3 - http://maven.apache.org/download.html
-
Firebug for debugging - http://getfirebug.com/
-
curl-7.19.7 - http://curl.haxx.se/
-
OpenSSL - http://www.openssl.org/
-
nginx 1.11.x or later - http://nginx.org/
-
MySQL Connector/Python - https://github.com/mysql/mysql-connector-python
-
pngcrush, required for freeciv-img-extract. http://pmt.sourceforge.net/pngcrush/
-
Tornado 6.1 or later - http://www.tornadoweb.org/
-
Jansson 2.6 - http://www.digip.org/jansson/
-
liblzma-dev - http://tukaani.org/xz/ - for XZ compressed savegames.
-
cwebp to create .webp files of the tileset.
When in a tested system,
you may run scripts/install/install.sh
and it will fetch and configure what's needed.
Start and stop Freeciv-web with the following commands:
start-freeciv-web.sh
stop-freeciv-web.sh
status-freeciv-web.sh
All software components in Freeciv-web will log to the /logs sub-directory of the Freeciv-web installation.
Freeciv-web can easily be built and run from Docker using docker-compose
. Web is exposed on port 80 by default.
-
Make sure you have both Docker and Docker Compose installed using MOST CURRENT VERSION of both, and are using a CURRENT Docker storage driver.
("Problems regarding 'setfacl' have been reported when using (deprecated) 'aufs' as Docker storage driver. Please try using 'overlay2' instead. You can check the storage driver by running 'docker info' or 'docker info | grep Storage'.")
-
Run the following from the freeciv-web directory:
docker-compose up -d
-
Connect to docker via host machine using standard browser http://localhost/
Enjoy. The overall dockerfile and required changes to scripts needs some further improvements. If you're an advanced user, look at the working Vagrant and Multipass implementations and adjust your dockerfile etc. accordingly.
On Mac, Windows, and Linux, another option is to try installing FCW using Multipass for the virtual machine.
On Mac with Apple Silicon chips, Multipass is the currently the only confirmed working option.
Multipass installation will use different install scripts (included). See Multipass.md for instructions.
Freeciv-Web is built on Travis CI on every commit. This is the current build status:
If you want to contibute to Freeciv-web, please visit our Discord at https://discord.gg/Zj8UQSN and introduce yourself as a developer.
Lexxie9952 @lexxie9952
Andreas Røsdal @andreasrosdal
Marko Lindqvist @cazfi
Sveinung Kvilhaugsvik @kvilhaugsvik
Máximo Castañeda @lonemadmax
Gerik Bonaert @adaxi
...others...
and the Freeciv.org project!