Skip to content

Freeciv-web is an Open Source strategy game implemented in HTML5, which can be played online against other players, or in single player mode against AI opponents.

License

Notifications You must be signed in to change notification settings

codesorc/freeciv-web

Repository files navigation

THE FREECIV-WEB PROJECT

Freeciv-web is an open-source turn-based strategy game. It’s built entirely in HTML5 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.

Freeciv-web is 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.txt for details.

Freeciv-web is now playable online at http://play.freeciv.org/

Contact: The Freeciv Project - [email protected] https://mail.gna.org/listinfo/freeciv-dev

Freeciv-web

Overview

The Freeciv Web client consists of these components:

  • freeciv - a fork of the main Freeciv C client and server.

  • freeciv-proxy - a HTTP proxy which allows web client users to connect to Freeciv civservers. The proxy is a HTTP and WebSocket server, and proxy between web browsers and civservers.

  • freeciv-web - a Java web application for the Freeciv web client. This application is a Java web application which consists of HTML, Javascript, images and JSP files which make up the application viewed in each user's web browser.

  • freeciv-img-extract - extracts the images of the Freeciv tileset, and generates a version for the web. This produces a tileset PNG and Javascript. Run this to sync with the upstream Freeciv SVN repository.

  • publite2 - a simple way to launch multiple civservers.

Running Freeciv-web with Vagrant on VirtualBox

Freeciv-web can be setup using Vagrant on VirtualBox to quickly create a local developer image running Freeciv-web on Ubuntu 13.10 on your host operating system such as Windows, OSX or Linux.

  1. Install VirtualBox: https://www.virtualbox.org/

  2. Install Vagrant: http://www.vagrantup.com/

  3. Install Git: http://git-scm.com/ then check out Freeciv-web from git to a directory on your computer, by running these two git commands:

git config --global core.autocrlf false
git clone https://github.com/freeciv/freeciv-web.git
  1. Run Vagrant with the following commands in your Freeciv-web directory from step 3:
vagrant plugin install vagrant-vbguest
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.

  1. (Skip this step if you run Windows) For Linux or OS X, then you need to setup a SSH tunnel to port 80 like this:
sudo ssh -p 2222 -gNfL 80:localhost:80 vagrant@localhost -i ~/.vagrant.d/insecure_private_key

Then test Freeciv-web by pointing your browser to http://localhost/ on your host operating system.

To log in to your Vagrant server, run the command:

vagrant ssh

Note that running Freeciv-web using Vagrant requires about 4Gb of memory and 3 Gb of harddisk space.

System Requirements for manual install

Install this software if you are not running Freeciv-web with Vagrant:

Compiling and running the Freeciv Web client (old method)

When not using Vagrant, or with other Linux distributions, follow this manual installation procedure to setup Freeciv-web:

  1. Checkout Freeciv-web from github to ~/freeciv-build

  2. Install the system requirements.

  3. Create mysql database called 'freeciv_web' Import mysql tables into a MySQL database from: freeciv-web/src/main/webapp/meta/private/metaserver.sql

  4. Get, prepare, and build freeciv server:

    cd freeciv ./prepare_freeciv.sh

  5. Install Freeciv. This involves running the following commands:

    cd freeciv/freeciv make install (as root user)

    copy freeciv-web/freeciv/data/fcweb to /usr/local/share/freeciv

  6. Build and configure freeciv-web.

    • Run setup_links.sh and sync.sh in freeciv-img-extract
    • Run sync-js-hand.sh in the scripts/ directory.
    • Edit /freeciv-web/src/main/webapp/WEB-INF/resin-web.xml.dist, rename this file to resin-web.xml, and update the values for your MySQL database.
    • Run 'build.sh' in the freeciv-web directory
    • Copy nginx configuration file from publite2/nginx/freeciv-web to /etc/nginx/sites-enabled/ and edit to suit your needs.
  7. Start and stop Freeciv-web with the following commands: scripts/start-freeciv-web.sh scripts/stop-freeciv-web.sh
    scripts/status-freeciv-web.sh

Also: Set ulimit -n 65535 in /etc/profile and add some TCP/IP tuning in /etc/sysctrl.conf

Developers interested in Freeciv-web

If you want to contibute to Freeciv-web, see the TODO file for some tasks you can work on.

Contributors to Freeciv-web

Andreas Røsdal
Marko Lindqvist
and the Freeciv.org project!

About

Freeciv-web is an Open Source strategy game implemented in HTML5, which can be played online against other players, or in single player mode against AI opponents.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 74.1%
  • Python 11.3%
  • CSS 5.3%
  • PHP 5.0%
  • Shell 2.3%
  • Java 1.3%
  • Lua 0.7%