Giter Site home page Giter Site logo

freeciv / freeciv-web Goto Github PK

View Code? Open in Web Editor NEW
2.0K 82.0 319.0 544.93 MB

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

License: Other

Python 6.80% Shell 2.47% Java 9.10% CSS 6.04% JavaScript 73.38% HTML 0.14% GLSL 1.40% Dockerfile 0.10% Handlebars 0.56%
webgl javascript freeciv html5 canvas blender

freeciv-web's Introduction

THE FREECIV-WEB PROJECT

License: AGPL v3 Build Status

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.

Live servers

Currently known servers based on Freeciv-web, which are open source in compliance with the AGPL license:

Freeciv-web screenshots:

Freeciv WebGL 3D: Freeciv-web

Freeciv-web HTML5 version: Freeciv-web

Overview

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

Freeciv WebGL

Freeciv WebGL is the 3D version, which uses the Three.js 3D engine. More info about the WebGL 3D version can be found for developers and 3D artists. Developer: Andreas Røsdal @andreasrosdal

Running Freeciv-web on your computer

The recommended and probably easiest way is to use Vagrant on VirtualBox.

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/freeciv/freeciv-web.git --depth=10

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.

⚠️ Notice for Windows users

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. 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 respect Unix line endings or transform them with a utility like dos2unix after saving them.

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 latest Ubuntu on your host operating system such as Windows, OSX or Linux. This is the recommended way to build Freeciv-web on your computer.

  1. Install VirtualBox: https://www.virtualbox.org/ - Install manually on Windows, and with the following command on Linux:
sudo apt-get install virtualbox
  1. Install Vagrant: http://www.vagrantup.com/ - Install manually on Windows , and with the following command on Linux:
sudo apt-get install vagrant
  1. 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. If you get an error message about Virtualization (VT) not working, then enable Virtualization in the BIOS.

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

System Requirements for manual install

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

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.

Running Freeciv-web on Docker

Freeciv-web can easily be built and run from Docker using docker-compose.

  1. Make sure you have both Docker and Docker Compose installed.

  2. Run the following from the freeciv-web directory:

    docker-compose up -d
  3. Connect to docker via host machine using standard browser

http://localhost:8080/

Enjoy. The overall dockerfile and required changes to scripts needs some further improvements.

Freeciv-Web continuous integration on GitHub actions

Freeciv-Web is built on GitHub actions on every commit. This is the current build status: Build Status

Developers interested in Freeciv-web

If you want to contibute to Freeciv-web, see the issues on GibHub and the TODO file for some tasks you can work on. Pull requests on Github are welcome!

Contributors to Freeciv-web

Andreas Røsdal @andreasrosdal Marko Lindqvist @cazfi Sveinung Kvilhaugsvik @kvilhaugsvik Gerik Bonaert @adaxi Lmoureaux @lmoureaux Máximo Castañeda @lonemadmax and the Freeciv.org project!

freeciv-web's People

Contributors

adaxi avatar amandasilvbr avatar andreasrosdal avatar andrey-zakharov avatar atoooxa avatar canik05 avatar cazfi avatar chris1869 avatar cpetry avatar drdogbot7 avatar erakordnepraht avatar genewitch avatar jacobrask avatar kvilhaugsvik avatar lexxie9952 avatar lgtm-migrator avatar lmoureaux avatar lonemadmax avatar martinmlmsoe avatar mchenryc avatar quiqueolaso avatar ricardoamaro avatar santeriv avatar siyuanqi avatar snowyjune678 avatar tvon avatar xcorail avatar yogarine avatar zekoz avatar zero00072 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freeciv-web's Issues

Simpler unit models

Unit models are very complex (many vertexes). They are also divided in several groups, each of which needs a draw call. This makes batching difficult (though it's possible to do). Such complex models don't fit in small files.

Use simpler, textured models instead.

Feature request: Building (Rail)-Roads

Build Roads
I'm missing the unit Action "Build-road-to" (Shift+R in other game versions) to order a worker to build roads longer than one tile. It would improve the gameplay a lot, becaus right now its a lot of Hand work to build a continental roas/railway system.

Using boats
There are missing some contextual Keyboard commands which make using boats very hard

  • "U" to unload a boat
  • "L" to order a unit getting on the boat. Right now I can ONLY manage this by: moving the boat a field, click the previous field to get the Unit I wann a load from the city (which can be really hard too, if you want a specific unit, of which you have more of one) and make the unit step on the boat (coast: 1 move, whil in regular freeciv the Load-unit is not a move)

Game Scores not working (in some games)

Reported by Civothy in the forum.

The console shows Problem showing score log graph: TypeError: Cannot read property 'turn' of undefined.

Changing start_turn to be the same in handle_scorelog init and turn info handling so that start_turn becomes whatever the first turn it finds in the log and resultdata[tag][] starts at 0 seems to work. If that's right, details.jsp should also be changed.

But then, there's also the problem that the scorelog seems to have only the last turn info, at least in the game reported (longturn 5).

Water shader

I'd like to admire the Sun being reflected by animated waves.

This can be either vertex+fragment or fragment only. Rivers could use the same logic without waves.

Moving the mouse on the map causes low frame rate

The ray tracing function used to get the object under the cursor is slow (~3 frames) and significant frame rate drops. I don't know how to make something faster. Maybe we could give the tracer a hint by inverting the projection*view matrix ?

Run at 60 fps !

The WebGL renderer is slow. This ticket is about improving its performance. I will try to keep this post updated myself, but feel free to modify it if needed.

Findings

  • The renderer is CPU-bound, even on old IGPs (Intel HD 4000)
  • Profiling showed that ~40% of time is spent in pure WebGL calls
  • The scene contains a large number of small objects (I got up to 5,000), mostly units, cities and labels
  • Many of these objects have several children (at least units, don't know for cities, labels are clean)
  • With 50,000 objects in the scene, we have less than 1 µs/object on the average to render at 60 fps
  • Three.js will sort objects to limit state changes (source)
  • Three.js won't batch geometries
  • maprenderer.info has some useful info

Discussion

Since Three.js doesn't do any batching, it issues a draw call for every visible object. It will also bind different uniforms values for every object (model and view matrices). Issuing many draw calls is bad for performance, hence the low framerate.

Solution

TL;DR : batch-render everything.

  • Batch units. This is difficult because each unit has several meshes
    • Reduce the complexity of unit models (#49) : merge groups, but geometries are also unnecessarily complex (load time)
  • Batch flags and unit labels (#47)
  • Batch cities
  • Batch specials
  • Batch roads, rivers, ...

Rivers disappeared

I think most of the water has gone underground. Some of it is still visible at “select” locations.

Rivers are not displayed on fogged tiles.

Update UI for unit actions on mobile

I want to replace the context menu with something more touch-friendly and better looking. I made a very rough draft with what I'm suggesting. Please ignore the work in progress graphics and icons for now, they can be improved.

If all options don't fit in the circle (the icons could be made smaller though) there can be a "+" icon to display a longer context menu.

unit-orders-mockup-1

Currently the context menu opens if you tap a unit that's already selected. This menu is much less obtrusive than the context menu so I suggest that this menu will open immediately when a unit is selected or has finished it's current orders.

I will go ahead with a quick prototype implementation to try out how it feels in practice on a touch device.

Also, does this sort of issue fit well here in Github (there will be commits referencing the issue) or is it better handled in forums or mailing lists?

Fortified status of foreign units not seen

Corbeau reported in the forum than his archer had low odds against a veteran warrior. When asked if the Warrior was fortified ha said no. After inspecting the savegame it appears that the foreign Warrior is fortified. The C clients will show that it is. Freeciv-web doesn't.

UI Improovement: Catch browser Back

Maybe it's because I'm using a multitouch pad as mouse device, but I frequently have lost my (unsaved) game by accidentally triggering browser back while scrolling. Could also apply for the Back-Key of the browser.

But independently from input device it would be great to have a "realy wanna leave page?" before leaving the page.

show production below each city

In Civ III, current production of each city is shown in a tag below each city. This is incredibly useful and stops one having to cycle each turn double clicking on each city to see where they are at, or what production they are currently running. Nice enhancement to have, and presumably easy to implement.

Buying Buildings

Hey guys, why can't we buy buildings, with our gold anymore? Gold is basically useless!

Improve the unit info box

There are serval Issues with the Unit Info box:

  • it requires a lot of clicking to select a unit on a field out of a stack of units
  • NormallyI will have to click a lot of lot of times if I for example want to choose a specific 2* general boat with full health if i have a bunch of "used" units of the same type in the pile, which happens quite a lot on large scale attacking 🎃
  • There is no Info withein the units window about the grade and the health and the movement status of a unit

I would propose to change the Unit Info box the following way

  • Don't have two states ("current unit" and "all units on this tile") in order to avoid multiple clickings
  • but hi-light the active unit somehow (maybe by putting tit first and add some "highlight" :)
  • give additional Info about the current unit e.g. movements left, city ....
  • provide additional info about vetaran status and health for all units

image

Effect of Statue of Liberty missing

After having built the statue of liberty I couldn't switch to a governmental form I didn't discover yet.
This would be freeciv default behavior and is also mentioned in the statue's explanation text.

Display Income on Tax-Rate Changing dialogue

It's a little difficult to change the tax rate without seeing the Effect on the Income before applying and looking at the home screen. Alternatively position the Info Bar with the Income more on top or turn the Tax-Rate-Change dialog a dialogue window.

JavaScript warnings reported by JSHint

Freeciv-web now uses JSHint to report JavaScript errors and warnings.
These errors can be found by running 'mvn install' in the freeciv-web directory.
http://jshint.com/docs/

(This is a good task for new developers who know JavaScript and are interested in contributing to Freeciv-web).

JSHint found problems with 9 files
/vagrant/freeciv-web/src/main/webapp/javascript/mapctrl.js
32,17: 'e' is already defined.
56,17: 'e' is already defined.
141,17: 'e' is already defined.
322,14: 'i' is already defined.
341,15: 'ptype' is already defined.
343,55: Missing semicolon.
344,32: 'punit' used out of scope.
345,54: 'punit' used out of scope.
347,54: 'punit' used out of scope.
353,9: 'punit' used out of scope.
354,46: 'punit' used out of scope.

/vagrant/freeciv-web/src/main/webapp/javascript/savegame.js
54,19: Implied eval. Consider passing a function instead of a string.
203,41: Missing semicolon.
286,99: Missing semicolon.
410,14: 'i' is already defined.
554,6: Missing semicolon.
564,3: Implied eval. Consider passing a function instead of a string.

/vagrant/freeciv-web/src/main/webapp/javascript/packhand.js
1157,17: 'pplayer' is already defined.

/vagrant/freeciv-web/src/main/webapp/javascript/pbem.js
286,54: Missing semicolon.
305,29: Missing semicolon.
404,9: Implied eval. Consider passing a function instead of a string.
431,30: Missing semicolon.
448,5: Implied eval. Consider passing a function instead of a string.
492,3: Implied eval. Consider passing a function instead of a string.
505,18: Implied eval. Consider passing a function instead of a string.

/vagrant/freeciv-web/src/main/webapp/javascript/tech.js
181,20: 'tech_id' is already defined.
182,15: 'ptech' is already defined.
196,53: Missing semicolon.
213,15: 'tag' is already defined.
219,53: Missing semicolon.
227,19: 'bgcolor' is already defined.
229,15: 'tag' is already defined.
235,53: Missing semicolon.
244,16: 'i' is already defined.
250,16: 'i' is already defined.
380,14: 'i' is already defined.
438,17: 'e' is already defined.

/vagrant/freeciv-web/src/main/webapp/javascript/tilespec.js
132,25: 'tterrain_near' is already defined.
133,20: 'pterrain' is already defined.
141,27: 'tterrain_near' is already defined.
142,22: 'pterrain' is already defined.
375,22: 'i' is already defined.
376,21: 'dir' is already defined.
384,10: 'y' is already defined.
387,11: Unreachable 'break' after 'return'.
390,5: Expected a 'break' statement before 'case'.
407,26: 'result_sprites' is already defined.
410,18: 'i' is already defined.
413,14: 'dir' is already defined.
414,12: 'x' is already defined.
415,12: 'y' is already defined.
445,8: Unreachable 'break' after 'return'.
464,5: Unnecessary semicolon.
471,7: Unreachable 'break' after 'return'.
549,4: Unnecessary semicolon.
926,8: Unnecessary semicolon.
1006,16: 'i' is already defined.
1007,15: 'dir' is already defined.
1008,21: 'checktile' is already defined.
1144,64: Missing semicolon.
1152,64: Missing semicolon.
1410,26: 'current_color' is already defined.
1432,45: Missing semicolon.
1436,47: Missing semicolon.

/vagrant/freeciv-web/src/main/webapp/javascript/scorelog.js
111,17: 's' is already defined.
117,17: 's' is already defined.
139,16: 'key' is already defined.

/vagrant/freeciv-web/src/main/webapp/javascript/diplomacy.js
242,17: 'pplayer' is already defined.
243,16: 'nation' is already defined.
254,17: 'pplayer' is already defined.
255,16: 'nation' is already defined.
263,17: 'pplayer' is already defined.
264,16: 'nation' is already defined.
264,57: Missing semicolon.
267,17: 'pplayer' is already defined.
268,16: 'nation' is already defined.
268,57: Missing semicolon.
277,17: 'pplayer' is already defined.
278,16: 'nation' is already defined.
278,57: Missing semicolon.
281,17: 'pplayer' is already defined.
282,16: 'nation' is already defined.
282,57: Missing semicolon.
340,47: Missing semicolon.
343,76: Missing semicolon.
459,20: 'tech_id' is already defined.
464,17: 'ptech' is already defined.
476,15: 'pcity' is already defined.
525,17: 'packet' is already defined.
552,17: 'packet' is already defined.

/vagrant/freeciv-web/src/main/webapp/javascript/requirements.js
68,7: Expected an identifier and instead saw 'eval' (a reserved word).
76,10: Bad assignment.
76,10: Expected an assignment or function call and instead saw an expression.
76,11: Missing semicolon.
76,12: Expected an assignment or function call and instead saw an expression.
80,10: Bad assignment.
80,10: Expected an assignment or function call and instead saw an expression.
80,11: Missing semicolon.

Frontpage face-lift

Facelift Demo

In a previous pull request I stated that I would like to improve the front page and the metaserver pages.
I ended up improving the design before doing structural work on the JSP logic.

https://adaxi.github.io/freeciv-demo/

This design has some qualities that facilitate the reworking of the JSP logic.

Motivation

Currently each page defines its own CSS and Javascript, which results in some duplicate code and hard to reuse code. To address this issue I would like to include the common code using JSP include directives.

The first step is to split CSS that is used on all pages from the CSS that is being used on specific pages. The demo page already incorporates that idea. This allows us to create the following template that incorporates styles, navigation and copyright:

<html>
  <head>
	<%@include file="includes/head.jsp"%> <!-- Bootstrap/jQuery/FA -->
        <script></script> <!-- additional scripts for current page -->
	<link></link> <!-- additional scripts for current page -->
  <head>
  <body>
    <%@include file="includes/header.jsp"%> <!-- Navigation -->

    <!-- The page content goes here -->

    <%@include file="includes/footer.jsp"%> <!-- Copyright -->
  </body>
</html>

In this process I also attempted to reduce custom css code and reuse bootstrap components as much as possible, hence the face-lift.

I am 100% not a designer but I think it turned quite OK. I have tested this under Firefox/Chrome in Debian, and should perform correctly on mobile devices. I have not tested on other platforms.

Next step

Should I continue my effort with this and start working on the JSP pages?

Contributing

Feel free to comment, or provide additional pull requests:
https://github.com/adaxi/freeciv-demo

Player names not included in chat messages in event cache for LongTurn games

Player or connection names are not included in chat messages in the event cache. This means that when players rejoin a LongTurn game, they will only see the message, not the name of the sender.

I have added a very poor work-around here:
https://github.com/freeciv/freeciv-web/blob/develop/freeciv-web/src/main/webapp/javascript/clinet.js#L192

Here is also some relevant code:
https://github.com/freeciv/freeciv-web/blob/develop/freeciv-web/src/main/webapp/javascript/packhand.js#L205

Unable to build due to gna.org being down

==> default: svn: E170013: Unable to connect to a repository at URL 'svn://svn.gna.org/svn/freeciv/trunk'
==> default: svn: E000110: Can't connect to host 'svn.gna.org': Connection timed out
==> default: Svn export failed

Would using http://repo.or.cz/freeciv.git work or should we wait until another mirror of gna is up?

freeciv-web doesn't work after vagrant halt, vagrant up.

virtualbox 5.0.14, installed freeciv-web using instructions on this page on windows. Is it possible to have the continuous integration tool restart the virtual machine and see if the server still passes tests?

The exact error is "Network error
Unable to communicate with civclientlauncher servlet. Error: error Internal Server Error null" when I click "start game" on the http://localhost/webclient/?action=new dialog that asks for your username.

Drop shadows

If only map is too slow, the shadow map could be evaluated in two steps:

  1. Shadows from the landscape (land, trees and cities don't change very often)
  2. Shadows from units (changes a lot)

Compositing can then be done directly in vertex shaders, or in one dedicated shader.

Improve the unit info box

There are serval Issues with the Unit Info box:

  • it requires a lot of clicking to select a unit on a field out of a stack of units
  • NormallyI will have to click a lot of lot of times if I for example want to choose a specific 2* general boat with full health if i have a bunch of "used" units of the same type in the pile, which happens quite a lot on large scale attacking 🎃
  • There is no Info withein the units window about the grade and the health and the movement status of a unit

I would propose to change the Unit Info box the following way

  • Don't have two states ("current unit" and "all units on this tile") in order to avoid multiple clickings
  • but hi-light the active unit somehow (maybe by putting tit first and add some "highlight" :)
  • give additional Info about the current unit e.g. movements left, city ....
  • provide additional info about vetaran status and health for all units

image

Asset licenses?

Are your assets also under AGPL, or under some different license?

Batch rendering of flags and activity icons

When there are many units/cities in the scene, the frame rate is low. This is because Three.js doesn't do any batching and thus issues at least one draw call for every object. The solution to this slowdown is to render many similar objects in a single draw call -- it's faster by orders of magnitude.
Trees are already batched. Batching flags and activity icons is easy if we can afford uploading a new geometry to the GPU every time an unit changes. I think it is the case.

Clarify AGPL status.

The project says it's under the AGPL but all I can find are Javascript files under the GPLv2 (or later) when it comes to licensing information - It'd be great if licensing information is clarified such as AGPL version in the source code itself and whether it's upgradable to a later version.

Savegame compatibility lost

The web client doesn't seem to recognize the game I saved yesterday before the new version was pushed. It's rather odd, because this is reported in the load dialog:

No savegames found. Please start a new game.
Savegame usage: 1146 of 5200 kB.

Is there any hope of restoring my game?

Start using web_city_info_addition

The packet type web_city_info_addition was added to upstream Freeciv in Gna patch #7279. It takes care of extra city information Freeciv-web needs. It allows us to drop some Freeciv-web specific changes to Freeciv, including the patch that currently reverts it.

Basic Worker Automation

Hi, one thing I've noticed is that workers will never ever clear forests automatically, and they will gladly walk into the line of fire of enemy ships no matter how many of their fellow workers die there. This makes the game unplayable since every turn takes 20x longer because each worker needs to be guided by hand.

Loading savefile kicks human player

Loading a savefile with 5 players (4 AI) resulted in being kicked from the game, loading with 5 AI players. I'm not sure the normal process to re-add myself and was not able to find the method for adding myself in. Cannot start the game because there were no human players.

Diplomacy

As I progressed further into the game, diplomacy stopped working entirely! I cannot do diplomacy nor can it be done to me!
image

Random autogame test failure

The autogame will sometimes fail to start. When the build is restarted on Travis everything works fine again.

(To avoid confusion: b90d3eb fixed the biggest cause of the random broken build emails from Travis today. This is a different cause that hasn't been fixed.)

web client downloaded save game in "1907" shows "1902" and earlier game state when restored

I'm posting a save game that shows an earlier year and game state when restored.

I am posting it in the hope that it can be useful in debugging the save/restore process for everyone and don't expect a personal reply.

A single player web client game was played as "Frank" on a Toshiba Chromebook 2. For unknown reasons, the localStorage savegames are not reliable on this device so to save I will download the file and not trust it to localStorage.

save file Frank 1907 shows 1902 year and 1902 game state on restoration --

https://drive.google.com/file/d/0B-XXSCz5WC7NUnJNV3NFNDMxZ3M/view?usp=sharing

Earlier "1902" save file --

https://drive.google.com/file/d/0B-XXSCz5WC7NaXBXODhrdjhQamM/view?usp=sharing

Flying planes

I never played long enough to actually see them, but adjusting their vertical position in the 3D model would make them fly.

Low-quality water shader

There is a water shader at high quality, but it is disabled at lower qualities. Add a better fallback than just... nothing.

Idea

Use a normal map of waves, two uniform vec2 a and b, one varying vec2 uv. In the pixel shader, fetch the texture at uv + a and uv + b. Use the mean of the two as normal vector. Animate a and b in JS (rotate and scale).
To avoid repetitions in space, one may consider adding some low-frequency, low-intensity noise (with non-integer wavelength). Repetitions in time can be avoided by tuning the JS animation.

I think GPU gems has a water shader, might be worth looking at.

UI: action selection based on unit focus

The Freeciv C clients pops the action selection dialog up and down based on unit focus rather than opening all at once. This makes turn change less confusing when many units on a goto reaches their targets, allows the player to delay his response without losing the reminder and makes the dialogs based on more up to date information.

See the TODO file for more information about this feature and how it can be implemented in freeciv-web.

Password restore doesn't work

Click on "Send password" button doesn't do anything visible (nor any e-mail arrives). Tested in Chromium and qutebrowser (based on Chromium).

New Logo?

Hi there!

I'm Elio, Design contributor at Mozilla and Fedora. I was wondering whether you are looking for a new logo, as I'd love to create one for you. I have done dozens of logos for open source projects in the past and have developed videogames on my own before.

Here are some snippets:
https://dribbble.com/elioqoshi

What do you think?

Valleys

Rivers are already drawn on the map (great job Andreas), but I would expect them to be at the bottom of valleys.

Algorithm

Deducing the height from the terrain could be done in the following way:

  1. Let Ocean and Sea to be at altitude 0 (as it already is).
  2. Assign river tiles an altitude based on to their distance to the sea, as measured along the river.
  3. Starting from each river tile, walk using an algorithm like that of distance_from_sea. Assign higher altitudes to tiles farther from the river. Stop when reaching Hills, Mountains or tiles that already got a lower height from another source. Hills and Mountains don't get an altitude for now.
  4. Give Hills and Mountains a height based on their highest neighbor.
  5. Assign the remaining tiles an altitude based on their distance to the nearest tile whose altitude is known.
  6. Add up the terrain-specific height modifications.

Height function

Several functions can be used to compute the height h of a given tile from its distance d to some source. We need to take into account the height H of the source and might also use the total length L of rivers. Here are some ideas:

  • Clamped Linear: The basic h = clamp(H + a × d, max) in use now. Not very smooth, highlands are flat.
  • Adjusted Linear: h = H + a × d / L. A linear function, adjusted to compensate for the total length. Maximum is H + a.
  • Inverse: h = H + a × d / (1 + d). Steep slope a in the lower part, goes smoothly to a + H when d goes to infinity. Highlands are mostly flat, but ridges appear on small maps.
  • Reversed Inverse: h = H + a × (L - d) / (1 + L - d). For rivers: flatter in the lower part than in altitude.
  • Quadratic: Three parameters from the set (height 1, height 2, slope 1, slope 2) can be set. The third is then fixed. Not a good choice IMHO.
  • Bézier: Choose the two slopes and heights, and even two weights. Hard to compute. Overkill.

I would go for Inverse for land and Reversed Inverse for rivers.

Make Working-List Sortable

The Working list in the City is a hard to handle UI.
I would love it to be sortable, instead of click-remove.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.