patchFreeciv - Patches: patch #3976, Extra requirements

 
 
Show feedback again

patch #3976: Extra requirements

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Sat 06 Jul 2013 03:02:20 PM UTC  
 
Category: generalPriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Marko Lindqvist <cazfi>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)

Mon 15 Jul 2013 07:49:44 PM UTC, SVN revision 23049:

Moved requirement list from road/base definition to main extra definition.

See patch #3976

(Browse SVN revision 23049)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Mon 15 Jul 2013 07:20:22 PM UTC, comment #7:

> we should have separate RFC -ticket for this


Created patch #4004 that will remain open (and thus not so easily forgotten) when I commit this patch and close the ticket.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 14 Jul 2013 07:23:09 AM UTC, comment #6:

Ok, we should have separate RFC -ticket for this as it doesn't immediately affect this ticket.

I wonder if we could tie that "actions" stuff to "causes" I've partly implemented. The idea has been that "causes" are hardcoded set (cause is like "someone building irrigation", "pollution", "mapgenerator placing river", "someone building mine")

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sun 14 Jul 2013 02:27:10 AM UTC, comment #5:

> Isn't current model (that has the problem of being somewhat overlapping) about just what you propose.

Yes. It is a generalization of it. Only some extras have an effect. There is an Irrig_Possible but no Maglev_Possible. What I suggest is moving the build action (and its requirements) from the extras to actions.

A simplified draft that ignores grouping etc:
[action_road_basic]
result_build_extra = "Road"
reqs =
{ "type", "name", "range", "present"
"UnitFlag", "Settlers", "Local", "TRUE"
"TerrainClass", "Land", "Local", "TRUE"
"Extra", "River", "Local", "FALSE"
}

[action_road_bridge]
result_build_extra = "Road"
reqs =
{ "type", "name", "range", "present"
"UnitFlag", "Settlers", "Local", "TRUE"
"TerrainClass", "Land", "Local", "TRUE"
"Tech", "Bridge building", "Player", TRUE
}

[action_irrig_from_river]
result_build_extra = "Irrigation"
reqs =
{ "type", "name", "range"
"UnitFlag", "Settlers", "Local"
"Extra", "River", "CAdjacent"
}

[action_irrig_from_irrig]
result_build_extra = "Irrigation"
reqs =
{ "type", "name", "range"
"UnitFlag", "Settlers", "Local"
"Extra", "Irrigation", "CAdjacent"
}

Sveinung Kvilhaugsvik <sveinung>
Project Member
Fri 12 Jul 2013 09:23:28 PM UTC, comment #4:

- Updated against svn
- Updated also to apply on top of patch #3987 - use base_extra_get() and road_extra_get() instead of slower extra_type_get()

(file #18265)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 12 Jul 2013 08:30:30 PM UTC, comment #3:

Isn't current model (that has the problem of being somewhat overlapping) about just what you propose. Irrig_Possible effects define what you call distinct "actions": one has requirement of adjacent irrigation, one requires adjacent river, one in alien ruleset requires cardinally adjacent city center, another in alien ruleset requires certain tech + adjacent city center...

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Fri 12 Jul 2013 02:18:04 PM UTC, comment #2:

> Unfortunately we cannot obsolete the effects either. As we cannot have OR requirements in extra requirement list, one cannot make irrigation possible from nearby Ocean OR River OR Irrigation.


Possible solution: Separate the action of building an extra from the extra definition. Many actions can result in the same extra. Irrigation from Irrigation is a separate action from Irrigation from River but only one of them appear in the GUI when both are possible as they are defined to be the same (say by belonging to the same class).

Generalized actions could also be usable in other areas than extra building. To establish a generalized action beach head in the code base without without getting in the way of your extras work I could try to create a proof of concept in another area.

Sveinung Kvilhaugsvik <sveinung>
Project Member
Wed 10 Jul 2013 05:32:17 PM UTC, comment #1:

- Updated against svn

(file #18239)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sat 06 Jul 2013 03:02:20 PM UTC, original submission:

Move requirement list from road/base definition to main extra definition. This also adds it for specials. Roads and bases should work like they used to. Check for target extra (S_IRRIGATION/S_FARMLAND/S_MINE) requirements is added for Irrigation and Mining activities. Note that these irrigation and mine requirement lists are currently redundant - one can give same requirements for effects of type Irrig_Possible and Mining_Possible. Unfortunately we cannot obsolete the effects either. As we cannot have OR requirements in extra requirement list, one cannot make irrigation possible from nearby Ocean OR River OR Irrigation.

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #18265:  ExtraReqs-3.patch.bz2 added by cazfi (9kB - application/x-bzip)
file #18239:  ExtraReqs-2.patch.bz2 added by cazfi (9kB - application/x-bzip)
file #18207:  ExtraReqs.patch.bz2 added by cazfi (9kB - application/x-bzip)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by sveinung (Posted a comment)
  • -unavailable- added by cazfi (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.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 15 Jul 2013 07:50:00 PM UTCcazfiStatusReady For Test=>Done
      Assigned toNone=>cazfi
      Open/ClosedOpen=>Closed
    Fri 12 Jul 2013 09:23:28 PM UTCcazfiAttached File-=>Added ExtraReqs-3.patch.bz2, #18265
    Wed 10 Jul 2013 05:32:17 PM UTCcazfiAttached File-=>Added ExtraReqs-2.patch.bz2, #18239
    Sat 06 Jul 2013 03:02:20 PM UTCcazfiAttached File-=>Added ExtraReqs.patch.bz2, #18207
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup