[Freeciv-tickets] [freeciv] #43251: Chained upgrades lead to actionenabler inconsistency

Back to archive index
OSDN Ticket System norep****@osdn*****
Sat Feb 5 07:17:11 JST 2022


#43251: Chained upgrades lead to actionenabler inconsistency

  Open Date: 2021-11-20 14:59
Last Update: 2022-02-05 00:17

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/43251
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=43251

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2022-02-05 00:17 Updated by: cazfi

Comment:

Reply To ec429
the user would do a single upgrade action, the game would figure out it could get as far as C, *then* ... perform it as a single step.
I've now been thinking how this could work for nearly two hours, and don't really see a way. I've considered single "meta-action" that would run other actions. I've considered "virtual actions" that cannot be performed, but just lend their enabler type to other actions to conditionalize their effects.
We specifically want to check action enablers for each step, not some enabler for the entirety. Those individual enablers are not about enabling/disabling the entirety (except the first one), but affecting its behavior. How to have just one (main) action despite these things seems quite a hard problem.

---------------------------------------------------------------------
Ticket Status:

      Reporter: ec429
         Owner: (None)
          Type: Bugs
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: (None)
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

In my ruleset, I have a NoUpgrade flag that controls the Upgrade action, so that some units can be obsoleted (to declutter the build list) without being able to be upgraded (which e.g. in some cases bypasses an impr_req on the new unit).
[actionenabler_upgrade_unit]
action = "Upgrade Unit"
actor_reqs    =
    { "type",    "name",       "range", "present"
      "DiplRel", "Foreign",    "Local", FALSE
      "UnitFlag", "NoUpgrade", "Local", FALSE
    }
However, if I have three units X → Y → Z (where → represents obsolete_by), and Y has the NoUpgrade flag, an X can still be directly upgraded to Z; I don't see any way to work around this.
In my opinion, the Upgrade Unit action should check that the entire chain of obsolete_by would all pass the actionenabler individually (and if not, upgrade to the point where it fails, so that e.g. X can still upgrade to Y after inventing Z), rather than just looking at the endpoints.

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/43251
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=43251



More information about the Freeciv-tickets mailing list
Back to archive index