patchFreeciv - Patches: patch #3933, Method of transferring unit upkeep...

 
 
Show feedback again

patch #3933: Method of transferring unit upkeep from cities lost to conquering enemies

Submitted by:  Micke <mss_8734>
Submitted on:  Mon 03 Jun 2013 10:24:19 PM UTC  
 
Category: generalPriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open
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.

 

Fri 07 Jun 2013 11:19:10 PM UTC, comment #2:

Attachment 1 affects the following files:
common/fc_types.h
common/game.h
common/packets.def
server/citytools.c:unit_enter_city()
server/ruleset.c
I.e. the same ones as the original submission plus fc_types.h - I hope that was the correct place to define the new enum (on a sidenote, using SPECENUM was surprisingly easy considering how scary the code looked). Apart from that I also added another couple of possible settings (see below). I had to add to the possible cpu workload and player notification spam in unit_enter_city(), but on the plus side the new code makes use of existing notifications and thus doesn't add any work for translators.

Attachment 2 affects the game.ruleset files for alien, civ1, civ2, civ2civ3, classic, experimental and multiplayer. Full addition:
; Method of transferring unit upkeep from cities lost to conquering enemies
; (all styles but "None" require gold_upkeep_style > 0). Where applicable
; units will have their upkeep transferred to the city closest to their
; current location in which they can exist.
; None - (Default) No units are transferred.
; BaseGold - Units with gold only or free of upkeep prior to applying any
; effects have their upkeep transferred.
; EffGold - Units with gold only or free of upkeep after applying player-
; and city effects (including Shield2Gold) have their upkeep transferred.
; BaseNoFood - Units without food upkeep prior to applying any effects have
; their upkeep transferred.
; EffNoFood - Units without food upkeep after applying current effects have
; their upkeep transferred.
; All - All units have their upkeep transferred.
upkeep_transfer_style = "None"

(file #18056, file #18057)

Micke <mss_8734>
Mon 03 Jun 2013 10:47:15 PM UTC, comment #1:

- You should make sure you don't transfer units to cities where they cannot exist
- I don't like magic numbers in ruleset format. I'd prefer ruleset to have textual values that are converted to numerical values at ruleset loading time
- Also, internally the numerical values should be descriptive enum and not "0" ... "4".
- Comment documenting the ruleset field should be added to all included rulesets

Also note to committer if this goes so far: network protocol is changed, so capstr must be refreshed.

Marko Lindqvist <cazfi>
Project Administrator
Mon 03 Jun 2013 10:24:19 PM UTC, original submission:

This patch introduces game.info.upkeep_transfer_style with values in [0,4] for transferring unit upkeep from cities lost to conquering enemies (all styles but 0 require gold_upkeep_style > 0).

  1. - (Default) No units are transferred.

1 - Units without food- or shield upkeep (including ones affected by shield2gold) have their upkeep transferred to the city closest to the lost one.
2 - Units without food upkeep have their upkeep transferred.
3 - All units have their upkeep transferred.

It affects the following files:
common/game.h
common/packets.def
server/citytools.c:unit_enter_city()
server/ruleset.c
data/classic/game.ruleset

Micke <mss_8734>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #18057:  uts_rulesets.patch added by mss_8734 (9kB - text/x-diff)

 

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 mss_8734 (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 07 Jun 2013 11:19:10 PM UTCmss_8734Attached File-=>Added upkeep_transfer_style.patch, #18056
      Attached File-=>Added uts_rulesets.patch, #18057
    Mon 03 Jun 2013 10:47:15 PM UTCcazfiCategoryrulesets=>general
      Planned Release=>2.6.0
    Mon 03 Jun 2013 10:24:19 PM UTCmss_8734Attached File-=>Added unit_upkeep_transfer.diff, #18047
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup