Project

General

Profile

Actions

Feature #1598

open

HACKING: update guideline for generalized actions

Added by Alexandr Ignatiev about 7 hours ago. Updated about 7 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Documentation
Target version:
Start date:
07/12/2025
Due date:
% Done:

0%

Estimated time:

Description

This is needed for 3.[12] to some extent but is vital for a consistent development since new actor kinds are introduced.

Now, what is an action and what is not action? Considerations:

An action is an ingame momentary event of a specific type that involves a game piece (player, city or unit) called actor and a game piece (player, city, unit, tile) called target, for self-targeted actions the target is the actor. Some actions are characterized also by subtarget of certain type (a characteristic of the target that it changes - e.g. building to sabotage, extra to build etc.). Game rules, hardcoded or ruleset-defined, either enable or prohibit any action according to the context of consideration and specify its possible ingame outcomes.

An action may be initiated by a player's will or by game rules (triggered by turn change, other objects changing state, scripted event etc.). A player initiating action must own the actor.

Sometimes player does not have enough data to tell if an action is possible. They may request the action and see if it is performed, or an illegal action event happens. Even a legal action may fail in certain situation (e.g. stealing a rtech from a player who knows no new techs).

Action type properties:
  • Actor kind and target kind - specify the possible type of actor and target as well as the way how actor and target context are evaluated from them for checking the requirements.
  • Action result - a generic "what happens" hardcoded identification (attack, found city etc.) Action results restrict actor and target kinds but few allow some variation.
  • Action enablers - a set of ruleset elements bundling an action type, actor requirements vector and target requirements vector.
    Rules to tell the actor and the target of a newly introduced action:
  • If you can't possibly impose any requirements for the action on it, it's neither.
  • If it can potentially be foreign to the action requesting player, it is a target.
  • If it has subtarget, it is a target (but for self-targeted actions, it will be also the actor).
  • There is less actor kinds than target kinds. Tiles can't act.

I am raising this ticket in doubts of will "Settle Specialist" be a player-to-city action or a city-on-self action. Also, if we make placing worker a city-on-tile action, it appears that its specialist subtarget relates to the actor and not the target. Also, "enabler check" actions concept look so dubious that I could not find a place to include it into guidelines, maybe we should distinguish actoion enablers and non-action enablers as we distinguish unit flags from unit roles.

Actions #1

Updated by Marko Lindqvist about 7 hours ago

Alexandr Ignatiev wrote:

"enabler check" actions

Yeah, they are not actions. Rather they are "enabler checks" that just re-use actions code.

Actions #2

Updated by Alexandr Ignatiev about 7 hours ago

  • Description updated (diff)
Actions

Also available in: Atom PDF