URL:
<http://gna.org/patch/?6082>
Summary: Multipliers: display vs ruleset values
Project: Freeciv
Submitted by: jtn
Submitted on: Sun 10 May 2015 14:29:10 BST
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: 2.6.0, 3.0.0
_______________________________________________________
Details:
Allow the number used in effects to be an arbitrary linear function of the
number used in the UI.
This has two uses:
0 Rudimentary story-telling: the UI number can be a nominal percentage of GDP,
or a budget in billions, or something.
0 Currently it's not possible to have some of the effects of a multiplier be
fractional (e.g., one extra unhappy citizen per two policy steps). A
fractional factor would allow this.
----
Proposal: the [multiplier] section gets a coefficient (specified as a
percentage, default 100) and an offset (default 0) mapping between UI values
and the multipliers used in effects.ruleset.
This makes case 1 easier and case 2 harder (since if the mapping is changed,
every effect must be updated). The alternative would be to have the function
parameters attach to individual effects. This doesn't seem worth the clutter.
With this facility, it would be possible to do away with the "step" parameter
of multipliers. However, I think I'd keep it, as routine use of the mapping
function will make rulesets harder to understand.
----
Example:
[multiplier_health]
name = _("Hospital Health Target (%)")
rule_name = "Health Target"
start = 80 ; UI value
stop = 100 ; UI value
step = 5 ; UI value
default = 95 ; UI value
offset = -80
factor = 5 ; percent
effect_value = (ui_value + offset) * (factor/100)
Possible effect_values are 0.0, 0.25, 0.5, 0.75, 1.0. This is multiplied by
effect.value before the result is truncated to an integer.
; Health Target has up to 20% effect on Health_Pct
[effect_health_target_1]
type = "Health_Pct"
value = 20
multiplier = "Health Target" ; x0.0 .. x1.0
reqs =
{ "type", "name", "range"
"Building", "Hospital", "City"
}
; Health Target can make up to 2 citizens content
[effect_health_target_2]
type = "City_Unhappy_Size"
value = 2
multiplier = "Health Target"
reqs =
{ "type", "name", "range"
"Building", "Hospital", "City"
}
; Health Target can cost up to 12% of a city's gold
[effect_health_target_cost]
type = "Output_Waste"
value = 12
multiplier = "Health Target"
reqs =
{ "type", "name", "range"
"Building", "Hospital", "City"
"OutputType", "Gold", "Local"
}
Results of having a Hospital in your city depend on your Health Target:
Health Target (%) Health_Pct Content citizens Lost gold
================= ========== ================ =========
80% +0% +0 +0%
85% +5% +0 +3%
90% +10% +1 +6%
95% +15% +1 +9%
100% +20% +2 +12%
_______________________________________________________
Reply to this item at:
<http://gna.org/patch/?6082>
_______________________________________________
Message sent via/by Gna!
http://gna.org/
_______________________________________________
Freeciv-dev mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-dev