Correct the rulesets civ1 and civ2

Do you want to help out with Freeciv development? Then check out this forum.
User avatar
meynaf
Veteran
Posts: 99
Joined: Sun Jan 21, 2018 10:27 am
Location: Lyon / France
Contact:

Re: Correct the rulesets civ1 and civ2

Postby meynaf » Mon Sep 09, 2019 4:19 pm

nef wrote:After some research it seems that rivers do provide trade but NOT cumulative with roads.

nef wrote:Although a minor issue it would be good if my (new) assumption is confirmed (or denied).

Checked in an old saved game, rivers produce trade which it is definitely not cumulative with roads.
Your assumption is confirmed.

nef
Hardened
Posts: 244
Joined: Mon Jun 25, 2018 5:01 pm

Re: Correct the rulesets civ1 and civ2

Postby nef » Mon Sep 30, 2019 2:36 pm

Thanks again to meynaf for nailing down another loose end.

Happened to be reading a forum post (or 2) when I noticed a problem with [effect_isaac_newtons_college] and [effect_isaac_newtons_college_1. In fact , there are two.

A. The "Output_Bonus" for libraries and universities is 1/3 not 1/2 making the total 5/6 for each. Freeciv (and commentators) code this in percentages so we get the following from 'Rome' p303 "Increases the light bulb production of all Libraries and Universities from 50% each to 83% each (for a total, when both exist in the same city, of 166%)". (The last figure probably would be better at 167% but who cares about such trivia?)

B. Another case of wrong range; in the ruleset the range for the first effect (library) was "City".

So in civ1 effects.ruleset replace the sections mentioned above with:

Code: Select all

[effect_isaac_newtons_college]
type    = "Output_Bonus"
value   = 33
reqs   =
    { "type",       "name",                   "range"
      "Building",   "Library",                "City"
      "Building",   "Isaac Newton's College", "Player"
      "OutputType", "science",                "local"
    }

[effect_isaac_newtons_college_1]
type    = "Output_Bonus"
value   = 33
reqs   =
    { "type",       "name",                   "range"
      "Building",   "University",             "City"
      "Building",   "Isaac Newton's College", "Player"
      "OutputType", "science",                "local"
    }


In section [building_isaac_newtons_college] buildings.ruleset the helptext reads:

Code: Select all

helptext   = _("\
Boosts science production by 100% in the city where it is built.\
")
How wrong can you get? Replace it with

Code: Select all

helptext   = _("\
Increases the science production bonus of all the player's Libraries and Universities from 50% each to 83% each (for a total with both of 166%).\
")

nef
Hardened
Posts: 244
Joined: Mon Jun 25, 2018 5:01 pm

Re: Correct the rulesets civ1 and civ2

Postby nef » Mon Sep 30, 2019 2:40 pm

'Rome' is quite specific about the tech bonuses for Copernicus' Observatory and for the SETI wonders. For SETI: "Increases light bulb production in all cities by 50% after all adjustments for Libraries, Universties and Einsteins" For the observatory the language is identical with the differences being the rate is 100% and range city not player.

The Einstein component "Citizens" is always included with "Taxed From Trade" as a basis so there is no need to do anything about the effect [effect_scientist]. But the civ1 ruleset is all wrong with the accounting for the SETI wonder. Fortunately there is an unused effect which actually makes the fix easy but first a note: it is possible to have both these wonders active at the same time and there is no clear indication of how they interact so I will proceed under the assumption that they simply 'add' together but together they form an independent multiplier.

The unused effect is [Output_Bonus_2].

So here is the replacment section for [effect_copernicus_observatory], [effect_copernicus_observatory_1], and [effect_copernicus_observatory_2] (n.b. all three) in the civ1 effects.ruleset

Code: Select all

[effect_copernicus_observatory]
type    = "Output_Bonus_2"
value   = 100
reqs   =
    { "type",       "name",                    "range"
      "Building",   "Copernicus' Observatory", "City"
      "OutputType", "science",                 "local"
    }

and for [effect_seti_program]:

Code: Select all

[effect_seti_program]
type    = "Output_Bonus_2"
value   = 50
reqs   =
    { "type",       "name",         "range"
      "Building",   "SETI Program", "Player"
      "OutputType", "science",      "local"
    }


There does appear to be a minor cosmetic glitch - client and server disagree on how to deal with integer rounding issues.

The help text for Copernicus' was wrong (humans 0, AGH silent). The percentage increase is 100% not 50 so replace the text with:

Code: Select all

helptext   = _("\
Boosts science production by 100% in the city where it is built.\
")

nef
Hardened
Posts: 244
Joined: Mon Jun 25, 2018 5:01 pm

Re: Correct the rulesets civ1 and civ2

Postby nef » Sat Oct 05, 2019 10:13 am

After searching the literature I could find no reference to Civ I trade routes giving a one time bonus to science. In fact there were many times where the issue was raised in discussions on Civ II - suggesting that the concept was novel (to Civ II). So - replace section [trade] in civ1 game.ruleset with :

Code: Select all

[trade]
settings =
  { "type",       "pct", "cancelling", "bonus"
    "National",   100,   "Cancel",     "Gold"
    "NationalIC", 200,   "Cancel",     "Gold"
    "IN",         200,   "Cancel",     "Gold"
    "INIC",       400,   "Cancel",     "Gold"
    "Ally",       200,   "Cancel",     "Gold"
    "AllyIC",     400,   "Cancel",     "Gold"
    "Enemy",      200,   "Cancel",     "Gold"
    "EnemyIC",    400,   "Cancel",     "Gold"
    "Team",       200,   "Cancel",     "Gold"
    "TeamIC",     400,   "Cancel",     "Gold"
  }

I have tried this out on a few games but it seems to have had little effect on actual gameplay. Still, I expect it will help even out the play a little.

In other respects my earlier comments appear to be correct.

nef
Hardened
Posts: 244
Joined: Mon Jun 25, 2018 5:01 pm

Re: Correct the rulesets civ1 and civ2

Postby nef » Sat Oct 05, 2019 10:17 am

Clarification of a previous post?
According to wiki baracks uk is 0/1/2 whereas the civ1 ruleset codes 1/2/3.
I now suspect that this was a change with version 3 (from 0/1/2 to 1/2/3), perhaps being part of an attempt to reduce the advantage of the ICS (smallpox) strategies.

I am not sure that this particular change is all that important (one way or the other), but maybe one could consider reinstating (or not changing) the original values in the fc2.6 distro; these being 1/2/3. If the values are to be 1/2/3 then there is a clear paradigm in Civ I that NO improvements are free of upkeep. This has important gameplay consideration (but, as usual, this nuanced point was to be thoroughly trashed in Civ II). [N.b. an economic siege of a player under despotism is a strategy I sometimes use to force the selloff of all city improvements (read: city walls). If the player changes to another goverment type then I change the siege to shields - reducing the defenders to (typically) 1. Anarchy is a problem but the AI don't usually persist with it for long.]

nef
Hardened
Posts: 244
Joined: Mon Jun 25, 2018 5:01 pm

Re: Correct the rulesets civ1 and civ2

Postby nef » Mon Oct 14, 2019 12:55 pm

Lighthouse can be built in inland city???

EDIT: meynaf has put paid to this one - forget it. His answer - YES.


If not then change the reqs vector in [building_lighthouse] to read:

Code: Select all

reqs   =
    { "type",         "name",       "range"
      "Tech",         "Navigation", "Player"
      "TerrainClass", "Oceanic",    "Adjacent"
    }


Exactly the same for [building_magellans_expedition]

Code: Select all

.
reqs   =
    { "type",         "name",       "range"
      "Tech",         "Map Making", "Player"
      "TerrainClass", "Oceanic",    "Adjacent"
    }

Unfortunately the wiki is rather silent about conditions for building wonders (as distinct from improvements). 'Rome' doesn't help either.

No changes are needed to the help text since AGH does the job quite nicely.

The changes above would make the civ1 ruleset consistent with classic (but not civ2 which also does not have the "oceanic" predicates.)

(meynaf - would you be able to find a savefile that has inland and coastal cities together with the other criteria? [N.b. lighthouse is made obsolete by Magnetism.])
Last edited by nef on Mon Oct 14, 2019 2:40 pm, edited 1 time in total.

User avatar
meynaf
Veteran
Posts: 99
Joined: Sun Jan 21, 2018 10:27 am
Location: Lyon / France
Contact:

Re: Correct the rulesets civ1 and civ2

Postby meynaf » Mon Oct 14, 2019 2:05 pm

nef wrote:Lighthouse can be built in inland city???

As surprising as can be, yes. I confirm that in civ1 you can build Lighthouse everywhere.


nef wrote:(meynaf - would you be able to find a savefile that has inland and coastal cities together with the other criteria? [N.b. lighthouse is made obsolete by Magnetism.])

A savefile maybe not (they're too advanced), but it's easy to get to this situation in a new game.

Ignatus
Elite
Posts: 481
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Civ2 trade route system

Postby Ignatus » Wed Oct 16, 2019 11:07 pm

Civilization II had a sophisticated trade route system that is only partially makeable within FC3.0 rulesets. I have no copy of the game so could missed or misinterpreted something but generally:
1. Trade routes can be established by civs that have discovered Trade (for cities of size>=3 that have Marketplace built?). Maximum 3 per city (outcoming amd incoming both?). Cities with bigger basic trade tend to beat ones with smaller trade even if the profit is for some reason lower.
2. Trade routes are unidirectional (food ones influent both ends but with different signs) and make profit to the city that has sent the Caravan/Freight. Min.dist is 10, no cancel from rival trading (Civilopedia thinks there is even a bonus but actually just foreign cities have twice more).
3. Each city of a civ that has developed Trade provides 3 commodities that can be loaded on caravans and demands 3 another commodities. The commodities seem random but their probability depends on quite a lot of factors (mainly, surrounding terrain, latitude and continent number, corresponding resource on city tile may add only several times more probability weight than its terain itself). Fulfilling a demand gets much greater bonus but then the demand/supply may change... Sometimes they just don't change... (Likely, you need a diplomate to know well the foreign demands?)
4. One time bonus has sophisticated system of calculation and depends on distance, basic trade and even connectivity. Some factors regard only one side, some either, and some both. The overall bonus is limited (usually with 2/3 of current research cost). The bonus in CivII changes when you rearrange workers within turn!
5. Then the trade route adds one or few trade points ("arrows") to its origin city. The income is not distance dependent.
6. You can load your caravan with any commodity your city produces, or with food. Only one caravan of one produced commodity may be supported by a city at time (they can be rehomed, what's the effect?) if it is not Hides (demand for them is also always unlimited). Food caravan fulfils 50% of destinstion granary (not taking the origin's?) and establishes a food trade route that transfers 1 food per turn from origin to the target (cancelled by starving origin condition?).
Last edited by Ignatus on Sun Oct 20, 2019 6:41 pm, edited 1 time in total.

Ignatus
Elite
Posts: 481
Joined: Mon Nov 06, 2017 12:05 pm
Location: St.Petersburg, Russia
Contact:

Re: Correct the rulesets civ1 and civ2

Postby Ignatus » Thu Oct 17, 2019 4:42 am

Civ2 Scrolls of Ancient Wisdom. Airbase = irrigation + railroad! And many other quirks.

nef
Hardened
Posts: 244
Joined: Mon Jun 25, 2018 5:01 pm

Re: Correct the rulesets civ1 and civ2

Postby nef » Mon Oct 21, 2019 12:30 pm

The popular fc paradigm for gardening times is that the 'work' required for railroad, forts, and pollution cleanup is 3.

According to table 3-2 in 'Rome' the first two of these are dependant on the terrain, and the last is actually 4.

In short, these values can be expressed in terms of the basic move cost of the terrain. So, for example, build time for road is 0 + 2 x M.C. (unchanged).

According to the table in 'Rome' the build cost for railroad is 0 + 4 x M.C., i.e. twice the road cost. For forts the cost is 4 + 1 x M.C., and for pollution 4 + 0 x M.C..

RAILROAD:

Since 'road_time' is set to 2, 4, or 6, the simple fix for railroad is to replace
in section [extra_railroad] the line that reads

Code: Select all

build_time     = 3

by

Code: Select all

build_time_factor = 2


(A better fix would be to follow the algebra expressed above for both road and railroad.)

FORTRESS:

In [extra_fortress] change the line that reads

Code: Select all

build_time     = 3

by

Code: Select all

build_time_factor = 1
AND, for the following sections, replace the line that reads

Code: Select all

base_time            = 1
by the following:

For sections [terrain_desert], [terrain_grassland], [terrain_plains], [terrain_tundra]

Code: Select all

base_time            = 5


For sections [terrain_arctic], [terrain_forest], [terrain_hills], [terrain_jungle], [terrain_swamp]

Code: Select all

base_time            = 6


For section [terrain_mountains]

Code: Select all

base_time            = 7


An algebraic approach can't be used for fortress because in this more complex case the arithmetic in the server is not algebraic (for no apparent reason).


POLLUTION:

For all 'land' terrain i.e. sections [terrain_*] that contain the field 'class = "Land"', (that is, all those listed for FORTRESS above,) ADD the following field

Code: Select all

clean_pollution_time = 4
Just after "pillage_time" would be a suitable place. Note that this is 'add' not 'change' so it appears to be that 3 is the (undocumented) default for pillage (no doubt previously hardcoded for civ2).


These changes are to be made to the civ1 terrain.ruleset (only).

'Tundra' is actually missing from the table but the inference is obvious. Although pillage is discussed I could find no mention of work cost so I presume that it was always 1.

Finally, the table (and text) is actually misleading, and may have been the cause of a great deal of confusion in the fora (civfanatics, apolyton). The 'work' cost of gardening activities in Civ I was actually stochastic (random), so I presume these table values were averages.

meynaf, perhaps if you can spare the time firing up one of your 'advanced' saves, see if pillage time is deterministic (or stochastic) and what the work cost (or average work cost) is.

Also, the table is not clear as to whether the work time for rail includes, or does not include, the time for roads. I have assumed that it is in addition to the road time. So a second request if I may ask: try to get some statistics on rail build times to estimate the average. You could use the "wakeup" exploit to speed things up (just keep waking up the settler and trying 'road' again and again until it happens. The count of 'road' commands would be the same as the number of turns if the settler is left to complete in its own sweet time.)