[Freeciv-tickets] [freeciv] #44085: custom actions

Back to archive index
OSDN Ticket System norep****@osdn*****
Mon Mar 28 04:40:14 JST 2022


#44085: custom actions

  Open Date: 2022-03-12 18:38
Last Update: 2022-03-27 22:40

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

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

Last Changes/Comment on this Ticket:
2022-03-27 22:40 Updated by: cazfi

Comment:

Reply To dark-ether
when you mentioned this i was already working on a patch, i did what you asked but i also have other changes and want to send my patch when it is final
The very first thing I said when you told that you're starting to work on this was: "In any case, don't start implementing single huge patch."
E.g. we need #44103 separately also for the reason that it's going to both master and S3_1, unlike the rest of your work that is expected for master only. As for the rest - if you do it as a one patch at first, it's very likely that you need to split it up afterwards, which can be much harder to do than doing it one step at a time from the beginning.

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

      Reporter: dark-ether
         Owner: (None)
          Type: Feature Requests
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: General
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

i saw that there wasn't a ticket so i thought i should add one for the people that only browse here at OSDN. the idea is that the ruleset can define actions, those actions can be only a placeholder to call lua events and they would already be immensely useful. to lessen boilerplate lua code we could add a new function signal.action_connect which receives a action name to connect, a sucess callback and optionally a failure callback. in the action section  of the ruleset we could also define all other actions settings, like range , target type, ui name, basically all action specific settings would go in this section. ideally all actions would be changed to be in the ruleset, however to start we should create the possibility to add actions in the ruleset, and only after that start unhardcoding actions.
In a issue in hostedredmine there also was a suggestion of multi-actions. the idea of multi-actions is that actions are created based on effects that are composed together. so a ruleset creator could potentially create most of the sane possible actions without lua code. example: a action called Explode Mini Nuke could have a target type of Tile and a success_effect field with {"type", "value"  "Create Extra","Fallout""Kill Units","All"}
 so if this were implemented , actions would be similar to effects, created from a list of possible ones and a value(or multiple)
Another thing that could be done is add a field called formula(or something similar) in which the ruleset creator provides a string in which words have specific meaning to create a formula for the probability,  generating a number, with any between 0 and 1 being a probabilty and <0 impossible. and =>1 certain sucess example: A formula like "tanh(10*tcities*ttechs)" would generate a probability that approaches 100% as the cities of the target and their technology count increase. another example:"tanh((aattack+afirepower)/tdefense)" would be a formula for a action with target type unit
Both the formula field and the multi-actions may be unneded as lua could implement them with callback functions, and  unlike effects lua code can probably do everything a action created by multi-actions could do, although i may be wrong on this, and i don't know how hard they would be to implement, but if they are easy to implement i will probably personally submit a patch.
basically my long term plan is to unhardcode all current and future actions.

-- 
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/44085
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=44085



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