More things configurable within action enablers.

What would you like to see in Freeciv? Do you have a good idea what should be improved or how?
Post Reply
Ignatus
Elite
Posts: 644
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

More things configurable within action enablers.

Post by Ignatus »

On the early stage of development, someone suggested that effects depending on one requirement vector and returning a value will be ever merged with action enablers that have two req vectors as something like "Action Possible" effect with an "Action" requirement and two req vectors (and maybe its value denoting basic probability?) While I don't suggest such a big thing (finally, some engine limitations make the game studiable and the ruleset more straightly designable), I would just make action enablers more rich.

Firstly, let there be user interface name configurable per enabler (backed with a common one defined for the enabled action). The client will put into the menu one from the first found active enabler for the selected unit(s), it's up to the ruleset author to avoid much messup. Let also the name be accessible for Lua action_started_* callbacks by the parameter of the "Action" value type (it provides the one name now and not much more, let's redefine the action as a more multipliable object). This will make customized actions configured more easily then just multiplying hardcoded values by "fake generalization" (actually, don't know the exact developers' plan of what they think to be the not fake generalization).

Next, let the enabler track some parameters that requirements can't, basically, the relations between the actor and the target (e.g. distance, dominance by culture or other parameters etc.). This is also a development of "fake generalized" bombard ranges for three splitted "Bombard"s.

Finally, we can put some parameters we now have in effects (like basic cost, success and survive probability etc.) into the enabler as we test there some requirements any way. Putting "actor can survive" into a field will require merging the actions devs have done much work to split ;) Of course this is dubious, there can be rules more complicated then the enabling rules, e.g. "to bribe a unit, actor must have the "Diplomat" flag and having any mp and the target not belonging to a nation with Fundamentalism; double the basic cost and halve the chances near cities with Courthouses, add another -25% if the target player is in Republic..." etc. - the rules are better tracked by an effect system then by a single complicated syntax. The obvious reason for it is that secfiles are bad with nested repetitions, no wonder CivIV uses XML instead. But the simpleness of the possible rules for AI and the players has bigger value. But, on the other hand, the idea of "action effects" is not fully infertile since we still have no more place to test both sides together, so maybe we may put here just one table of additions to the effects involved:

Code: Select all

[action_enabler_cheat_savages]
action = "Enter Marketplace"
ui_name = _("Exchange glass beads for gold sand")
survive_base_pct = 90 ; 10% they just cook your rascal explorer
effects_base = {"type", "value"
 "Trade_Revenue_Bonus", 3200
}
relations = {"type", "name", "range" ; actor_val / target_val
 "MinCultureRel", 10.0, "Player"
 "MinTechsRel", 2.5, "Player"
 "MaxFirstContactTurns", 10 ; they'll know you too good later
}
actor_reqs = {"type", "name", "range"
 "UnitType", "Explorer", "Local"
 "Tech", "Trade", "Player"
}
target_reqs = {"type", "name", "range", "present"
 "Tech", "Trade", "Player", FALSE
 "Extra" , "Gold", "City"
}
sveinung
Elite
Posts: 548
Joined: Wed Feb 20, 2013 4:50 pm

Re: More things configurable within action enablers.

Post by sveinung »

Ignatus wrote: don't know the exact developers' plan of what they think to be the not fake generalization
See generalized actions. I finally got around to filing an issue in the "new" issue tracker some days ago. Sorry about the confusion.
Post Reply