On Mon, 27 Aug 2007, Per I. Mathisen wrote:
On Sun, 26 Aug 2007, Andreas Røsdal wrote:
I sent a proposal about a web client for Freeciv some time ago.
Now I've implemented a prototype / proof of concept.
It uses a webservice which allows a browser to communicate with a
civclient process on the server. The mapview is renederes using the canvas
That is impressive. When you posted the original proposal, I thought it was
silly because surely it could never work...
Does this mean the player does not have to download anything to play?
Correct, nothing is required in order to play, except for a compliant web
to be downloaded by the web browser. Currently 1,2 MB of files are
downloaded in this way. This is compressed with gzip. In addition there is
the constant polling of the server from the client to keep it updated.
Most of this file size is because of the large png files in the tileset,
with a lot of wasted space.
The performance still has a way to go, perhaps someone has some
How bad is it?
Initializing the client currently takes about 30 seconds. This includes
downloading everything, cropping and preparing the tileset, and starting a
civclient and civserver process.
Rendering the mapview on the canvas element is now at about 7 fps, which
includes the time it takes to poll the server for coordinates to render,
and rendering the graphics to the canvas element. This framerate will
increase a lot if more clever caching of the map is used in the client,
and the framerate will probably decrease once more complex maps are
rendered (with fog etc). Thinking out more clever ways to transfer and
render the map to the client would be a good idea.
The server side appears to perform pretty well, each civclient requires
about 5 MB of RAM, and not very much CPU power. So I would imagine that
quite of lot of clients could use the same server, perhaps over 100
What is needed to set it up?
This can be run using a Java application server, I'm currently using
Resin (www.caucho.com). You also need Apache Axis and libcsoap, including
their dependencies. I might write up a description about how to deploy
this. Or even setup a test-server once I'm satisfied with it.
Freeciv-dev mailing list