patchFreeciv - Patches: patch #3832, Allow BaseFlag and RoadFlag in...

Show feedback again

patch #3832: Allow BaseFlag and RoadFlag in reqs lists

Submitted by:  Emmet Hikory <persia>
Submitted on:  Thu Apr 4 06:28:02 2013  
Category: generalPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>Open/Closed: Closed
Planned Release: 2.6.0Contains string changes: None

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)

Wed Jun 5 08:39:03 2013, SVN revision 22937:

Added "RoadFlag" and "BaseFlag" requirement types.

Patch by Emmet Hikory

See patch #3832

(Browse SVN revision 22937)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu May 9 08:04:03 2013, comment #5:

Updated patch applies over patch #3879, with the use of preq->present.

(file #17937)

Emmet Hikory <persia>
Project Member
Mon Apr 8 14:43:41 2013, comment #4:

Updated patch applies over patch #3841 and includes the !preq->negated documentation for baseflag/roadflag requirements. Also includes the Adjacnet fix (inherited from rebasing above patch #3836).

(file #17717)

Emmet Hikory <persia>
Project Member
Fri Apr 5 02:46:23 2013, comment #3:

I realise on re-reading my last post that I may not have outlined why this might be interesting at all. Apologies for that.

The ultimate goal was to be able to have different types of requirements for move_cost=2 roads, depending on terrain, to have the move_cost=1 road depend on the presence of any of the move_cost=2 roads, and to have the move_cost=0 road depend on the move_cost=1 road. Another way in which I tried to use this (before discovering it didn't work) was to define a road "Dredging", which could be applied to any river or canal (different canals have different source requirements: oceanic, river, canal), and changed the nativity so that one more step of the several different naval unit classes could use it.

Trying to do this in only 16 roads without roadflags isn't possible (as one needs to define different roads for every possible set of conditions: flags let one create OR-like models without real disjunctive reqs lists), especially if one also tries to have some move_cost=3 roads for particularly troublesome terrain. Yes, this can be simulated to some degree with high costs to build move_cost=2 roads in some terrains, but it has always bothered me that when it took a long time to build a road, follow-up units received full penalties for the tile until it was complete.

Emmet Hikory <persia>
Project Member
Fri Apr 5 01:52:18 2013, comment #2:

Indeed, this doesn't help as-is, but I thought it was a good chunk to commit while I was learning how the custom flag feature worked. That said, if you believe it to be a 2.6 feature, I'll not rush on that, as it becomes obsolete with extras.

Emmet Hikory <persia>
Project Member
Thu Apr 4 22:27:22 2013, comment #1:

Seems straightforward. The only issue I noticed was that you had copypasted typo "Adjacnet" from previous line in README.effects change.

But this is currently of quite limited usability. Road flags "River" and "Native" are the only ones I can see some ruleset wanting to use as requirement.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Thu Apr 4 06:28:02 2013, original submission:

While building my road and base definitions, I discovered that it didn't work if I added extra flags and then tried to use these in the requirements lists. Checking the documentation in README.effects, this appeared not to be clearly a bug, but it was still something I wanted. The attached patch allows these fields as requirements: although large, the vast majority is just copies of other bits of code with the names changed (I generally matched the TerrainFlag code, although because of iteration concerns, often lifted bits from the Base and Road code).

Note that this still doesn't allow definition of custom road or base flags, so my original goal remains unfufilled, but this seemed a good point to submit the patch, as it works in the current state (and could be used to implement differing requirements for "River" vs. not-"River" using the flag rather than the road name, if one wished: perhaps useful for rulesets with multiple types of river).

Emmet Hikory <persia>
Project Member


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

Attach File(s):

Attached Files
file #17937:  baseflag-roadflag-reqs+refresh.patch added by persia (28kB - application/octet-stream)
file #17717:  baseflag-roadflag-reqs+nreqdocs.patch added by persia (28kB - application/octet-stream)
file #17673:  baseflag-roadflag-reqs.patch added by persia (26kB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -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
    Wed Jun 5 08:39:14 2013cazfiStatusReady For Test=>Done
    Sun Jun 2 21:05:22 2013cazfiAssigned toNone=>cazfi
    Thu May 9 08:04:03 2013persiaAttached File-=>Added baseflag-roadflag-reqs+refresh.patch, #17937
    Mon Apr 8 14:43:41 2013persiaAttached File-=>Added baseflag-roadflag-reqs+nreqdocs.patch, #17717
    Thu Apr 4 22:27:22 2013cazfiStatusNone=>Ready For Test
      Planned Release=>2.6.0
    Thu Apr 4 06:28:02 2013persiaAttached File-=>Added baseflag-roadflag-reqs.patch, #17673
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup