Help has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...

Feature #672612

Pick what "Attack" target reqs should be evaluated against

Added by Sveinung Kvilhaugsvik about 5 years ago. Updated about 5 years ago.

Start date:
Due date:
% Done:


Estimated time:


When the "Attack" action was introduced in gna patch #7260 it was made tile targeted until the proper target class to evaluate its action enablers against could be determined. Releasing a version of Freeciv where the target is a tile would bind us to support DiplRel requirements against the owner of the tile the target unit is located at in future versions.

The "Attack" action's current target requirements are made against three different target classes. Two of the target classes, "individual cities" and "unit stacks", are supported as action enabler target kinds. The last class, "any or, if the unreachableprotects server setting is enabled, all untransported units", has no current support in the action enabler system.

Related issues

Blocks Freeciv - Task #656466: S3_0 datafile format freeze (d3f)Closed2019-10-05

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>


#1 Updated by Sveinung Kvilhaugsvik about 5 years ago

  • Blocks Task #656466: S3_0 datafile format freeze (d3f) added

#2 Updated by Sveinung Kvilhaugsvik about 5 years ago

The two candidates for the target to evaluate the "Attack" action's target requirement vector against are those about units. Each has a currently hardcoded unit requirement it alone can express. The unit stack target kind can express the "must be at war with all units in the stack" rule. The other target kind could, combined with the introduction of a new requirement type, have expressed the requirement that each/any non transported unit must be in a city, be in an extra native to it, not have the "Unreachable" unit class flag or belong to a unit type listed in the actor's targets.

Choose the unit stack action target kind. Move the "must be at war with all units in the stack" rule to the action enabler as an obligatory hard requirement.

A unit stack targeted "Attack" action makes ruleset authors able to specify requirements for all units in an attacked unit stack. Requirements for all non transported units in an attacked unit stacks can be achieved via the "Transported" UnitState requirement type property (and an action enabler that enables the action for a transported unit no matter what the non transported only requirements are).

Should having "Attack" action enabler target requirements closely following the unreachableprotects server setting become important in the future it can still be implemented. One potential way to do it is by introducing a version of "Attack" that targets individual units. Its and Attack's action enablers should then be able to use the "ServerSetting" requirement type to determine what action should be enabled based on the unreachableprotects server setting value.

#3 Updated by Sveinung Kvilhaugsvik about 5 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 90 to 100

Also available in: Atom PDF