patchFreeciv - Patches: patch #3871, Support airlifting units with...

Show feedback again

patch #3871: Support airlifting units with complex nativity

Submitted by:  Emmet Hikory <persia>
Submitted on:  Mon 22 Apr 2013 06:10:53 AM UTC  
Category: generalPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Emmet Hikory <persia>Open/Closed: Closed
Planned Release: 2.6.0

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


(Jump to the original submission Jump to the original submission)

Tue 29 Apr 2014 04:02:21 PM UTC, SVN revision 24827:

Use a unit class flag for airlifting

Rather than restricting airlifts to ground units, provide a
unit class flag that allows ruleset authors to control which unit
classes are considered suitable for airlift.

Implementation suggestion by David Fernandez

See patch #3871

(Browse SVN revision 24827)

Emmet Hikory <persia>
Project MemberIn charge of this item.
Sun 27 Apr 2014 08:54:40 PM UTC, comment #6:

Although I don't think this is the correct final solution, applying it to trunk will reduce the number of times I have to remember that this is an already-addressed nativity issue.

Emmet Hikory <persia>
Project MemberIn charge of this item.
Thu 03 Apr 2014 11:22:03 PM UTC, comment #5:

I've not been working on it at all, and suspect that it should probably use the action enablers framework that is currently in-progress. That said, attached is a quick patch converting it to a unit class flag, in case someone wants to play with that.

(file #20469)

Emmet Hikory <persia>
Project MemberIn charge of this item.
Thu 11 Jul 2013 01:58:55 AM UTC, comment #4:

I'm interested to see this feature implemented, in case you still working on it.
Would it be simpler if you create a new unit flag in units.ruleset to define which units can be airlifted? (without changing the ruleset effects)

David Fernandez <bardo>
Sat 27 Apr 2013 11:36:02 PM UTC, comment #3:

Err, rather, I'll not generate that soon. Whlie the base of the implementation is relatively sane, generating accurate helptext is thorny enough to likely be confusing in the face of anything other than the simplest requirements.

Emmet Hikory <persia>
Project MemberIn charge of this item.
Sat 27 Apr 2013 10:39:45 PM UTC, comment #2:

Makes sense. While the result of 3 total airlift, in a combination of air and sea is documented, I agree it that it's not as rich as it might be. Will regenerate with a separate effect.

Emmet Hikory <persia>
Project MemberIn charge of this item.
Sat 27 Apr 2013 10:25:41 PM UTC, comment #1:

I don't like the idea of Airlift capacity to be checked with RPT_POSSIBLE. Server should be sure about every rule it enforces. I haven't bothered to check if this particular change would affect any important corner-case, but if we start using RPT_POSSIBLE for enforced rules in general, there will be a lot of bugs in such corner-cases.
Hmm.. what if I define seemingly valid effects that city can airlift 2 land units and 1 sea unit each turn? What the effects actually turn to? You can just airlift total of three units of land and sea classes.

I would be much prefer separate effect to control if unit is able to airlift.

Marko Lindqvist <cazfi>
Project Administrator
Mon 22 Apr 2013 06:10:53 AM UTC, original submission:

The current code restricts airlifting to UMT_LAND units, which is annoying for ruleset authors who might want to define a unit that happens to only move on land but is unsuitable for airlift (e.g. continental assault engine) or some unit that can move on both land and sea that is suitable for airlift (e.g. frogmen). The attached patch removes the hardcoded restriction, replacing it with ruleset definitions for the "Airlift" effect: units that may be airlifted are now controlled by the reqs/nreqs of the effects, so ruleset authors may control this with any of UnitType, UnitFlag, UnitClass, or UnitClassFlag. Ruleset adjustments are included for all rulesets in source control to retain prior behaviour (all using UnitClass for simplicity).

Emmet Hikory <persia>
Project MemberIn charge of this item.


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #20469:  airlift-class-flag.patch added by persia (11kB - application/octet-stream)
file #17803:  control-airlift-nativity.patch added by persia (9kB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by bardo (Posted a comment)
  • -unavailable- added by cazfi (Posted a comment)
  • -unavailable- added by persia (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 29 Apr 2014 04:12:38 PM UTCpersiaStatusReady For Test=>Done
    Sun 27 Apr 2014 08:54:40 PM UTCpersiaStatusNone=>Ready For Test
      Assigned toNone=>persia
      Planned Release=>2.6.0
    Sun 13 Apr 2014 09:56:04 AM UTCpersiaSummaryControl airlift nativity with EFT_AIRLIFT=>Support airlifting units with complex nativity
    Thu 03 Apr 2014 11:22:03 PM UTCpersiaAttached File-=>Added airlift-class-flag.patch, #20469
    Mon 22 Apr 2013 06:10:53 AM UTCpersiaAttached File-=>Added control-airlift-nativity.patch, #17803
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup