Freeciv-web Freeciv server changes

Web version of freeciv at play.freeciv.org
sveinung
Elite
Posts: 469
Joined: Wed Feb 20, 2013 4:50 pm

Freeciv-web Freeciv server changes

Postby sveinung » Thu Jul 21, 2016 1:36 pm

This thread may be boring unless you are a JavaScript developer or a ruleset author. It is about changes to Freeciv-web's Freeciv server.

The thing you see in your web browser is not the server. It is Freeciv-web's Freeciv client. The rules you play by is not the server. It is the ruleset. (Freeciv currently supports two rulesets: fcweb and webperimental)

Changes to the server influences what the client and the ruleset can do. A new webperimental rule may become possible. It can become easier to implement a feature in the client. The need for a certain client feature may increase.

Note that changes listed here may not have reached play.freeciv.org yet.

sveinung
Elite
Posts: 469
Joined: Wed Feb 20, 2013 4:50 pm

Re: Freeciv-web Freeciv server changes

Postby sveinung » Thu Jul 21, 2016 1:40 pm

The server used to have a Freeciv-web specific way of changing worklists. It could append an item to the end of a worklist or remove an item from an arbitary location in the worklist. This made it impossible to move an item up or down in the worklist.

The Freeciv-web server now changes the worklist the same way as regular Freeciv: by sending the packet PACKET_CITY_WORKLIST(city_id, worklist) to the server. It changes the complete worklist at once.

This makes it possible to change the Freeciv-web client's worklist UI to allow rearranging worklist items. It can be done in pure JavaScript. How it could be done has been documented under "Unimplemented Freeciv client features" in Freeciv'web's TODO.

sveinung
Elite
Posts: 469
Joined: Wed Feb 20, 2013 4:50 pm

Re: Freeciv-web Freeciv server changes

Postby sveinung » Thu Jul 21, 2016 3:08 pm

The server is now capable of supporting unit focus controlled action selection dialogs like the 2.6 and 3.0 C clients have. Unit focus controlled action selection dialogs means that the action selection dialog pops up when the unit it belongs to gets focus. The Freeciv C clients will also give units that wants an action decision higher priority in the the unit focus queue. This keeps fast player decisions.

Unit focus controlled action selection dialogs makes turn change less confusing when many units on a goto reaches their targets. It gives the user freedom to delay a response without losing the reminder. The Freeciv server will store open action selection dialogs in save games. It makes action selection dialogs based on more recent information. (It asks right before showing the dialog)

How it could be done has been documented under "Unimplemented Freeciv client features" in Freeciv'web's TODO. It can, as far as I know, be done in pure JavaScript.

sveinung
Elite
Posts: 469
Joined: Wed Feb 20, 2013 4:50 pm

Re: Freeciv-web Freeciv server changes

Postby sveinung » Fri Jul 22, 2016 12:39 pm

The action system has taken control over more unit actions.

Players: This is visible to the player. Any action now under action control that can't be done to a target on a tile the unit isn't on or next to is now in the action selection dialog.

Ruleset developers: This allows the webperimental ruleset to add new restrictions to the rules that controls the actions. Some restrictions on when an action can be done have moved to the ruleset and made optional. This allows webperimental to remove them.

The actions and restrictions for the current development version of Freeciv-web are documented here.

An example of what can be done is Freeciv 3.0's sandbox ruleset's airlifting rules. Light weight units can be airlifted once Flight is known. Medium weight units can be airlifted once Advanced Flight is known. Heavy weight units can be airlifted once Fusion Power is known. To airlift heavy and medium weight units an airport is required both in the source and in the destination city. Cities that know Flight can airlift one (light weight) unit per turn. An Airport allows a city to airlift one more unit per turn.

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

Re: Freeciv-web Freeciv server changes

Postby dunnoob » Sat Jul 23, 2016 5:47 pm

About webperimental:
sveinung wrote:an airport is required both in the source and in the destination city.
Sounds good, I'd like that also in classic + experimental.

sveinung
Elite
Posts: 469
Joined: Wed Feb 20, 2013 4:50 pm

Re: Freeciv-web Freeciv server changes

Postby sveinung » Sun Jul 24, 2016 2:15 am

dunnoob wrote:Sounds good

Ported to webperimental.

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

Re: Freeciv-web Freeciv server changes

Postby AndreasR » Sun Jul 24, 2016 11:28 am

A new version of Freeciv-web has been released to the production server today.
It contains a lot of improvements and bugfixes, mostly contributed by Sveinung Kvilhaugsvik.
Freeciv-web is now updated to the latest Freeciv development svn version thanks to Sveinung.

Please report any issues here. Thanks!

cazfi
Elite
Posts: 1750
Joined: Tue Jan 29, 2013 6:54 pm

Re: Freeciv-web Freeciv server changes

Postby cazfi » Thu Dec 29, 2016 3:07 pm

Now would be a good time to update server to latest revision - to a relatively stable revisions before branching S3_0 and all the 3.1 stuff going in after that.

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

Re: Freeciv-web Freeciv server changes

Postby AndreasR » Thu Dec 29, 2016 4:38 pm

cazfi wrote:Now would be a good time to update server to latest revision - to a relatively stable revisions before branching S3_0 and all the 3.1 stuff going in after that.


This is a good idea. That would mean upgrading from svn rev. 34448 to about 34748. Perhaps you or Sveinung could please help with that. I will probably be having fun completing the 3D WebGL version again in 2017.