Changes in what a 2.6 rule set can do

Contribute, display and discuss rulesets and modpacks for use in Freeciv here.
sveinung
Elite
Posts: 430
Joined: Wed Feb 20, 2013 4:50 pm

Changes in what a 2.6 rule set can do

Postby sveinung » Mon Aug 26, 2013 7:13 pm

This thread is about changes that has been made to the development version of Freeciv that changes what can be done in a rule set or how it can be done. A similar thread existed on the previous forum. No promise is made about what will/won't be covered here or how much details will be included.

When I wrote this 2.3 was the stable version, 2.4 had a release candidate, 2.5 had been branched and 2.6 was the development version.

[edit] A summary of the new 2.6 stuff available to modders can now be found in NEWS-2.6.0.
Last edited by sveinung on Thu Apr 24, 2014 6:26 am, edited 1 time in total.

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

Re: Changes in what a rule set can do

Postby sveinung » Mon Aug 26, 2013 7:13 pm

Output_Tile_Punish_Pct is a new effect. It reduce the output of a tile by amount percent. The number of units to remove is rounded down. Applied after everything except a city center's minimal output. It replaces pollution_*_penalty and fallout_*_penalty in terrain.ruleset.

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

Re: Changes in what a rule set can do

Postby sveinung » Mon Aug 26, 2013 7:14 pm

DiplRel is a new requirement type for diplomatic relations. In the world range it is fulfilled if some player in the world has the specified diplomatic relation to some other living player. In the player range it is fulfilled if the player has the specified relation to some other living player. In the local range it tests if the first player has the given relation to the second player. In the context of building an extra the first player is the owner of the unit and the second player the owner of the terrain the extra is built on. At the moment no other users support local DiplRel requirements.

The diplomatic relationship tested for can be "Never met", "War", "Cease-fire", "Armistice", "Peace", "Alliance", "Team", "Gives shared vision", "Receives shared vision", "Hosts embassy", "Has embassy", "Hosts real embassy" or "Has real embassy". A real embassy isn't from an effect. Only the exact relation you require is acceptable. Those below or above won't fulfill it. In other words: If the player has Alliance or Armistice and you test for Peace the requirement won't be fulfilled.

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

Re: Changes in what a rule set can do

Postby sveinung » Tue Aug 27, 2013 10:11 am

Unit_Bribe_Cost_Pct is a new effect. It changes the bribe cost of units. Requirements are from the point of view of the target unit, not the briber. In other words: An improvement requirement will be about the units home city, a local diplomatic relation requirements will be about the diplomatic relationship the target unit's owner has to the briber and an extra requirement will be about the tile the target unit stand on.

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

Re: Changes in what a rule set can do

Postby sveinung » Fri Aug 30, 2013 9:44 am

Unit_Bribe_Cost_Pct now keeps 100% by default. To make it keep 50% change its value from 50 to -50.

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

Re: Changes in what a rule set can do

Postby sveinung » Sat Aug 31, 2013 8:51 pm

Generalized action enablers are a new concept. An action is something a player can do. An action enabler enables a player to do an action (as long as nothing else is blocking it). The action enablers of some actions are rule set defined. The actions them self - their name, cost, effects and probability for success - are not.

Each action can have zero (always disabled), one or more action enablers. A generalized action enabler lives in game.ruleset. It consists of the action it enables and two requirement vectors. The first requirement vector, actor_reqs, applies to the entity doing the action. The second, target_reqs, applies to its target. If both requirement vectors are fulfilled the action is enabled as far as the action enabler is concerned. It may still be disabled by a hard requirement in the action it self. Hard requirements should be documented.

At the moment only two actions, the diplomat actions "Poison city" and "Sabotage unit", are enabled by action enablers. The only requirement moved to the action enablers is that the actor must have the spy flag. Note that the diplomat flag still is required. Note that other benefits given by the spy flag aren't given to diplomats doing those actions. If you wish to add a unit that always dies after poisoning a well give it the "Diplomat" flag, avoid giving it the "Spy" flag, and add an action enabler that let it poison a city.

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

Re: Changes in what a rule set can do

Postby sveinung » Sun Sep 01, 2013 9:16 am

The minimal size requirement for the diplomat action "Poison city" is now moved to the rule set.

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

Re: Changes in what a rule set can do

Postby sveinung » Sun Sep 01, 2013 4:20 pm

The requirement that the actions "Poison City" and "Sabotage Unit" only can be done to those you are at war with have been moved to the rule set action enablers.

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

Re: Changes in what a rule set can do

Postby sveinung » Thu Sep 05, 2013 12:14 pm

The server will now tell the client if it tries to do an action it isn't allowed to do. This can be caused by the client having inaccurate information about an action enabler's requirements. The opposite case, were the client don't know it is allowed to do an action, is not yet fixed. See https://gna.org/bugs/index.php?21105 for more information about this corner case.

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

Re: Changes in what a rule set can do

Postby cazfi » Thu Sep 05, 2013 9:26 pm

I just updated http://freeciv.wikia.com/wiki/How_to_up ... 2.5_to_2.6
While it's not list of new features (it omits anything that does not require actions from someone updating old ruleset), it gives quite a good picture of what we have been doing this summer.