Follow-up Comment #2, patch #5554 (project freeciv):
I'm not sure if I understand exactly what you are suggesting. I therefore
can't answer your question truthfully. What I can do is to explain the
reasoning behind this patch while keeping various possible interpretations of
your suggestion in mind. I hope that parts of what follows will address at
least some of you concerns.
The built in AI currently uses the role system to ask for a unit with a
certain unit flag when it really wants a unit that can do an action associated
with the flag. It assumes that all units with that flag are capable of
performing the action. Note that it cares about the action it self, not what
particular action enabler(s) make it possible.
The motivation behind this patch is to allow follow up patches that makes the
AI look for the ability to perform the wanted action in stead of looking for
flags like "TradeRoute" and "HelpWonder".
How an action behaves is independent of what action enabler(s) makes it legal.
Generalized actions aren't planned to change that. The difference in action
behavior will depend on the generalized action it self, not on the action
enabler(s) that make it legal.
Actions aren't generalized in 2.6. The number of actions is therefore
constant. This patch creates a unit role (located after the unit role flags
that are located after the real unit type flags) for each action.
The advantage of creating a unit role is that the existing unit role system
can be reused. Storing information about what units can perform it to the
action structure would enable less reuse. (A disadvantage of reusing the role
system is that action specific custom functionality becomes more difficult. If
many action specific customizations are wanted it would make a separate system
more appealing)
Automatically creating the role in stead of requiring it to be defined in the
ruleset (or added to the unit role enum) creates less work. It also makes the
role to ask for in cases when a unit capable of performing action X is wanted
known. (Generalized actions will require a way to find an action to look for.
Probably some action flag. It is therefore like associating a unit flag with
an action)
Using unit type flags to grant permissions to do a (set of) action(s) (under
certain circumstances) should probably be the recommended style in the
documentation. It makes it possible to continue thinking about the ability to
do an action as a flag. In many cases it will also increase order. But
enforcing it would make other cases more complex.
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?5554>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev