[Freeciv-Dev] [patch #4722] City production discount effect

2014-08-25 Thread Jacob Nevins
Follow-up Comment #4, patch #4722 (project freeciv):

Patch #4470 was a less developed version of this idea (that I forgot I raised,
sigh). The description there may be more digestible than this one...

The only point raised there not yet mentioned here:
> Things that need thinking about [...] contribution of caravans 
> to boosted wonders (undiscounted, I assume)

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4722] City production discount effect

2014-05-26 Thread Jacob Nevins
Follow-up Comment #3, patch #4722 (project freeciv):

> Is this just for the civ2civ3 Aqueducts, or are there other 
> intended applications?
I'm thinking vaguely of commercial CivIV, where you can have all sorts of
miscellaneous production bonuses; some nations build workers twice as fast, or
access to stone speeds up two or three different buildings a bit. It's not
really possible to do this in Freeciv at the moment.
What made me think about how to do this in Freeciv was an IRC conversation
(with 'morphles', I think, who raised bug #22089); I can't remember what they
wanted to do with it.

> Given the difficulties of explaining any implementation for 
> both players and ruleset authors [...]
On the contrary, the explanation to ruleset authors is extremely simple: "if
you want production of a specific thing to go quicker, just use
Production_Bonus, and it will generally behave sensibly". Similarly for
players, all we need say is "meet these requirements and you get a 10%
production bonus for Horsemen" and all the edge cases should be unsurprising.
My belaboured treatment is all about defining precisely what "behaves
sensibly" means.

Also, don't be put off by the size of my description. I think the existing
logic dealing with city production (with all the special handling of changing
production just after completing something, etc) is probably about as complex
as the new proposals, it's just no-one's written it down as anything other
than code.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4722] City production discount effect

2014-05-26 Thread Emmet Hikory
Follow-up Comment #2, patch #4722 (project freeciv):

This is vastly complex, which is probably needed, given the intended
application.  Is this just for the civ2civ3 Aqueducts, or are there other
intended applications?  Given the difficulties of explaining any
implementation for both players and ruleset authors, I'd hope it would be
useful for more than just tidiness in a single ruleset (yes, I can think of
some hypothetical examples, but most of the concrete ones seem more
interesting strategically in terms of absolute restriction (e.g. can't build
Horsemen without either Horses or a Traderoute to a city with Horses)).

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4722] City production discount effect

2014-05-26 Thread Jacob Nevins
Follow-up Comment #1, patch #4722 (project freeciv):

> This would be one step towards merging the different types of 
> Aqueducts in civ2civ3 into a single building.
In fact, it's almost sufficient.
You can bodge the upkeep differences with the Upkeep_Free effect.
However, you can't fix the technology requirement without disjunctive building
requirements, I think.

___

Reply to this item at:

  

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [patch #4722] City production discount effect

2014-05-26 Thread Jacob Nevins
URL:
  

 Summary: City production discount effect
 Project: Freeciv
Submitted by: jtn
Submitted on: Mon 26 May 2014 15:15:12 BST
Category: None
Priority: 5 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
 Planned Release: 

___

Details:

(I think this idea came out of a conversation on IRC.)

Proposal: an effect which allows a city's shield production to contribute more
or less (usually more) towards the current project, depending on
circumstances. For instance, double production rate of Horsemen if city has
access to Horse resource.


; Without this no production is possible!
[prod_ratio_base]
type= "Production_Bonus"
value   = 100

[prod_discount_horsemen]
type= "Production_Bonus"
; additional 100% => 200% total
value   = 100
reqs=
{ "type", "name", "range"
  ; only affects production of Horsemen
  "UnitType", "Horsemen", "Local"
  ; resource anywhere on city map
  "Resource", "Horse", "City"
}


This would be one step towards merging the different types of Aqueducts in
civ2civ3 into a single building.

This is preferable to trying to affect an item's intrinsic shield cost,
because of the many other things that's used for (bribe cost, sell/disband
yield, upgrade cost, ...) and difficulties if the requirements for the
discount come and go during (or after!) production.

However, the accounting is still quite fiddly to avoid exploits, hence the
length of this proposal. The attached sort-of-flowchart illustrates my
proposal.

I think this should be checked and applied each turn right before adding the
modified shield increment to the city's production box. It's different from an
output bonus in that it doesn't affect shield output displayed in the city
dialog, and can be targeted at specific production with requirements like
"UnitType", "Horsemen", "Local".
* But how to handle change of production? I do want that if the requirements
only apply half the time during construction, you get half the discount; but I
don't want you to be able to apply a discount to a normally-undiscounted item
by building the cheap one and changing at the last minute; nor do I want that
you can get a "backlog" of discount if you only got the discount requirement
near the end of production, by changing from something else.
** Maybe if the city keeps a running total of "real" underlying shields that
went in, as well as progress towards current target, and if you change
production then you transfer value based on the value of the "real" shields
with no discount.
*** Probably don't need new UI to see "real" shields in city, since you can
explore it by changing production; if you don't like the exchange rate you can
change back without penalty.
*** Does mean that you can't change between two items with the 'same' discount
(say, if discount applies to all air units) and keep it, but tracking which
discounts are the 'same' is hard, especially given history of
possibly-different discounts. If this is a problem I think we solve it by
having a separate Production_Bonus_Transferable effect, which is applied
earlier and really does change the 'underlying' shields; more suitable for
broad classes of units, but subject to these loopholes (the ugly name and a
big health warning should clue ruleset authors into this).
* How to handle surplus production built up while unable to finish item (e.g.
Settlers with insufficient city size)? Don't want any current discount to
carry over to next item when it's built. I think it's probably sufficient to
stop applying the discount when progress has reached 100%, with some sort of
pro-rata arrangement for shields produced in the turn where we cross the
threshold.
** What if next item on worklist would be eligible for a discount while
building up a surplus? I think it's OK to check the discount and apply it to
the surplus only when we actually start work on the new item. However, for
non-transferable discount, if the previous item is changed while building up a
surplus, perhaps the surplus should get no discount when the next item is
started: this prevents the exploit of working on unbuildable Settlers with
Horsemen on worklist while waiting for access to horse resource, building up a
big surplus, then changing from Settlers to something else and getting the
surplus discounted for the Horsemen as if you'd had access to the resource for
the whole time you were building up the surplus. Still exploitable if you can
choose when to unblock Settlers another way (e.g. by changing food surplus)
but I think we'll have to live with that (alternative is to peek ahead on
worklist, I think).

Buy cost should probably be based on proportion of progress towards current