patchFreeciv - Patches: patch #3976, Extra requirements

 
 
Show feedback again

patch #3976: Extra requirements

Submitted by:  Marko Lindqvist <cazfi>
Submitted on:  Sat Jul 6 15:02:20 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)

Mon Jul 15 19:49:44 2013, 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 Jul 15 19:20:22 2013, 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 Jul 14 07:23:09 2013, 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 Jul 14 02:27:10 2013, 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 Jul 12 21:23:28 2013, 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 Jul 12 20:30:30 2013, 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 Jul 12 14:18:04 2013, 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 Jul 10 17:32:17 2013, comment #1:

- Updated against svn

(file #18239)

Marko Lindqvist <cazfi>
Project AdministratorIn charge of this item.
Sat Jul 6 15:02:20 2013, 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.

     

    Error: not logged in

     

     

    Follow 6 latest changes.

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

    Back to the top


    Powered by Savane 3.1-cleanup