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

Back to archive index
OSDN Ticket System norep****@osdn*****
Wed Mar 30 22:45:40 JST 2022


#44085: custom actions

  Open Date: 2022-03-12 17:38
Last Update: 2022-03-30 15:45

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-30 15:45 Updated by: alienvalkyrie

Comment:

Reply To cazfi
Could e.g. alienvalkyrie check this work in a more timely manner than I? If not, I will get to it, eventually.
I'll see if I can take a look

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

      Reporter: dark-ether
         Owner: (None)
          Type: Feature Requests
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: Rulesets
      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