Page 1 of 7 1 2 3 4 ... LastLast
Results 1 to 30 of 193

Thread: How Supply and Demand Lists Are Determined

  1. #1
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41

    How Supply and Demand Lists Are Determined

    Overview

    The key to understanding Supply and Demand lists in cities is recognizing that each commodity has its own formula and set of determining factors which govern its appearance and disappearance. Each of these commodity formulae derive what I call a Supply Quotient and a Demand Quotient. When a trigger event occurs, such as the 16-turn "solo" cycle, the SQ and DQ are calculated for each of the sixteen commodities.

    If a particular commodity's Demand Quotient is higher than its Supply Quotient, it goes on a roster of demanded commodities. If not, it goes on the supplied commodities roster. (This prevents a commodity from being both supplied and demanded by the same city, as a rule.) The top three commodities on each roster become the city's supply and demand list.

    If either the supply or demand roster does not have enough commodities to fill its list, then the commodity with the highest ID number that is enabled and not already on the list is used.

    There are also two Wildcard commodities, one for supply and one for demand. These are based solely on the city's map coordinates. The wildcard formulae are:

    Supply Wildcard = RemainderOf ( (Horizontal x 13 + Vertical x 7) / 14)

    Demand Wildcard = RemainderOf ( ( Horizontal x 3 + Vertical x 5) / 14)

    Because coordinate pairs on Civ2 maps are always either both even or both odd, the remainder from this division by 14 is an even number between 0 and 12. This number is used as an index into the commodity list to choose the Wildcard. The commodity list is:

    0 Hides
    1 Wool
    2 Beads
    3 Cloth
    4 Salt
    5 Coal
    6 Copper
    7 Dye
    8 Wine
    9 Silk
    10 Silver
    11 Spice
    12 Gems
    13 Gold
    14 Oil
    15 Uranium

    Each Wildcard is then checked against the six commodities on the Supply and Demand lists and against the other wildcard to prevent duplicates. If the Wildcard is not present on either list, it replaces the middle commodity on its respective list.

    After a civilization has acquired 32 Techs, the wildcard formulae for its cities changes slightly. The divisor is now 9 instead of 14, and 5 is added to the remainder, as follows:

    Supply Wildcard = RemainderOf ( (Horizontal x 13 + Vertical x 7) / 9) + 5

    Demand Wildcard = RemainderOf ( ( Horizontal x 3 + Vertical x 5) / 9) + 5

    This eliminates commodities 0-4 (Hides to Salt) from the Wildcard spot in the middle and late game and allows odd numbered commodities to appear. Again, if the wildcard commodity is already present on either list, it is not used and the originally determined 3 commodities remain.

    If the supply and demand Wildcards are the same commodity, it is used only on the demand list.

    After the discovery of Industrialization, Oil becomes available as a secondary wildcard, used to substitute the middle commodity when the primary wildcard was eliminated as a duplicate. It is because of its role as a secondary wildcard that Oil sometimes appears on both the Supply and Demand lists of a city.

    Wildcard commodities, when present, always appear in the middle position on the list.

    Determinants of Supply and Demand

    The formulae for calculating each commodity's Supply and Demand Quotients involve a number of factors.

    Terrain. Terrain is probably the most important factor in determining supply and demand. The terrain of all 21 squares in the city radius are counted by type to create a city's Terrain Profile. Resource specials count as 4 of their base type. Thus, Fish and Whale count as 4 Ocean; Wine counts as 4 Hills; Wheat counts as 4 Plains, etc. Rivers are counted as a separate terrain type, making for a total of 11 terrain counts. Each commodity's selection and weighting of terrain types will be unique.

    Location. In addition to the Wildcard calculation, location affects a number of commodity SQs and DQs. Location's role includes use of the city map coordinates in calculating proximity to the poles or equator for a simulation of historical distribution patterns of commodities.

    Continent. Continent number and continent size(?) are important determinants for some commodities.

    City Size. The population of a city affects many commodity SQs and DQs, but in different ways. There is no one city size algorithm, although a pattern of 3, 8, 13, etc. (increments of 5) occurs in a number of instances.

    Tech Acquisition. The number of techs acquired is used as a measure of progress and time passage, reducing or increasing demand and supply of certain commodities in simulation of their historical importance to civilization. Specific technological advances have profound affects on certain commodities, many of these are well known, such as Industrialization and Automobile's impact on Oil. Tech acquisition applies to all cities in a civilization. In a few rare cases, a tech discovery may have global impact.

    City Improvements. Some city improvements affect the SQs and DQs of commodities for that specific city.

    Nationality. Occasionally, a civ's historical association with a specific commodity is reflected in its supply and demand. French cities are more likely to be suppliers of Wine, while Silk is often common in Chinese cities.

    Some of these determining factors are static, unchanging throughout the game, or change only rarely (like terrain). Others change rapidly over time. It is the changing factors alone, City Size and Tech Acquistion, that are responsible for the changes in supply and demand lists that occur over the course of the game. Once all of the commodity SQ and DQ formulae are known and well-tested, it will be possible to determine not only the initial commodities of a newly founded city, but to chart all future changes to these lists based on city growth, terrain modification, and the strategic acquistion of technologies.
    Last edited by samson; December 6, 2002 at 16:27.

  2. #2
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Commodity Supply and Demand Quotient Formulae

    Note: All formulae assume the use of Civ2 integer math, i.e. all fractional parts of division results are dropped, never rounded up.

    Hides

    Supply = Forest x 4 + Tundra x 6 + Glacier x 6 + Jungle x 3 + Rivers x 3
    Location: N/A
    Techs: N/A
    # of Techs 1-15: 4x 16-23: 2x 24-48: 1x >48: 1/2
    City Size 1-2: 2x 3-7: 1x >7: 1/2

    Special Note: If Techs>48 the 2X bonus for Size<3 does not apply.

    Demand = Forest + Mountains x 2 + Tundra x 5 + Glacier x 5
    Location: + DistanceToEquator x 3/2
    Techs: Industrialization: 1/3 Mass Production: eliminates demand
    # of Techs: 1-9: 4x 10-19: 2x 20-47: 1x >47: 1/2
    City Size: 1-2 2x


    Wool

    Supply = (Grass + Hills x 2 + Rivers/2 ) x (Tundra + Glacier + 2 + PolarCircle)
    Location:
    Techs:
    # of Techs:
    City Size:

    Demand = Plains x 2 + Forest
    Location: + TemperateZoneOffset x 2
    Techs: Industrialization: 2x
    # of Techs:
    City Size:

    Beads

    Supply = Ocean x 8
    Location: - DistanceToEquator
    Techs: none
    # of Techs: >32: 1/2
    CitySize: 1-9: 1x >9: 1/2

    Demand = Land x 3/2
    Location: + DistanceToEquator
    Techs: none
    # of Techs: >47: 1/2
    CitySize: 1-3: 3/2 4-12: 1x >12: 1/2

    Cloth

    Supply = Desert + Plains x 3 - Rivers
    Location:
    Techs: Industrialization: x 3/2
    # of Techs: 1-7: 1/4 8-15: 1/2 16-19: 1x >19: 2x
    CitySize:

    Demand = Forest x 4 + Hills x 4
    Special: + ( (Techs/10) x (Forest + Mountains x 2 + Tundra x 5 + Glacier x 5 + DistanceToEquator x 3/2) ) / 8


    Salt

    Supply = Desert x 4 + Swamp x 2 + Ocean x 3
    # of Techs: - Techs/6
    Location:
    Continent#: 1,3,5: x 3/2
    Techs: Pottery, if not discovered: 1/3
    CitySize:
    City Improvements: Aqueduct: x 3/2

    Demand =
    Location:
    Techs:
    # of Techs: - Techs/2
    CitySize: 1-5: + pop x 8 6-10: + pop x 4 11-15: + pop x 2 16-20: + pop x 1 >20: +75

    Special Note: The first five citizens each demand 8 salt, the next five demand 4 salt, the next five 2 salt and the fourth group of five demand 1 salt. Size-based demand maxes out at 75.


    Coal

    Supply = (Plains + Forest + Swamp + Jungle +1) x (Hills x 5)
    Location:
    Continent#: If ODD and >1: x 3/2
    Techs:
    # of Techs: <20: 1/2
    City Size: 1-7: 1/2 8-17: 1x >17: 2x

    Demand =
    Location: (DistanceToEquator + 10) x (CitySize+2)/5
    # of Techs: + Techs
    CitySize: 1-4: Demand = 0 5-7: 1/2x >7: 1x
    Techs: Industrialization: 2x Electricity: 2x
    City Improvements: PowerPlant: 2x NuclearPlant, HydroPlant, SolarPlant: 1/ 8

    Special Note: CitySize has two affects in this formula: once as a multiplier of the location factor and later, after # of Techs has been added, a penalty is applied to smaller cities.


    Copper

    Supply = Hills x 5 + Mountains x 5
    Continent#: If EVEN: 2x

    Demand = Rivers + Roads
    Techs: Electricity: 3/2 Computers: 1/4
    CitySize: 1-2: Demand = 0 3-4: 1/2 5-7: 1x 8-12: 2x 13-17: 3x
    18-22: 4x ... etc.
    City Improvements: Marketplace: x 3/2 Bank: x 3/2

    Special Note: The formula for Copper Demand is theoretical, as there appears to be a serious bug in all versions of Civ2 with regards to the demand of both Copper and Dye.

    On 2.4.2, the formula as given is valid only when the city's Supply and Demand lists are updated by a caravan delivery. When the update is caused by viewing the City Display on that city's 16-year turn, the Base Demand is Rivers + Roads + City#. When the update is caused by the 16-year automatic update, then Copper's DQ is a LARGE NUMBER.

    On the Gold Edition, the formula as given is valid only when the city's update is caused by the 16-year automatic update. Both caravan deliveries and City Displays during the 16-year turn cause the DQ to be set to a VERY LARGE NUMBER.


    Dye

    Supply = Grass x 10 + Rivers x 2 - Plains x 2
    Continent#: If multiple of 4: 2x

    Demand = SupplyOf(Cloth) + Roads
    Techs: Chemistry: 1/2 Mass Production: 1/2

    Special Note: See the note for Copper Demand. The same bug affects the demand of Dye. The common factor in both formulas appears to be "Roads".


    Wine

    Supply = LesserOf (Plains x 4, Rivers x 5 - Grass)
    Location: +DistanceToDateline/4 If NorthernHemisphere: x 2
    Continent#: If RemainderOf(Continent# /4 ) = 2: x 3/2
    CitySize: 1-2: 1/2 8-10: 2x
    Civ: If FRENCH: 2x

    Demand = 0
    Location: + | Horizontal - Vertical |
    CitySize: 1-2: +4 3-7: +8 8-12: +12 13-17: +16 18-22: +20 23-27: +24 28-32: +28 etc.

    Silk

    Supply = (Forest x 2 + Jungle + 1) x (Hills + 1)
    Location: + LongitudeEast x 2
    Continent#: Multiple of 5: 2x
    Civ: If CHINESE: 2x

    Demand = Desert x 4 + Plains/2 + Swamp x 2 + Jungle x 4
    Location: + DistanceToPole x 2 + DistanceToDateline
    Continent#: If Continent = 1 AND CityNumber/2 is ODD: x 3/2
    Techs:
    # of Techs:
    CitySize: 1-2: 1/4 3-6: 1/2 7: 1x >7: 2x


    Silver

    Supply = Mountains x 8 + Hills
    Location: If NON-ZERO: + DistanceToMeanMeridian
    Continent: >8: 3/2
    Techs: If Iron Working not discovered, 1/2
    # of Techs:
    City Size: 1-4: 1/2

    Demand = CitySize x 8
    Location: RemainderOf( (Horizontal + Vertical) / 3): 0 = silver, 1 = gems, 2 = gold
    Techs: Chemistry: x 3/2 Economics: 1/2 Computers: 1/2
    Civ: If SPANISH: 2x
    City Improvements: Bank: x 3/2 Cathedral: x 3/2

    Special Note: The Demand Quotients for Gems and Gold use the same formula as Silver. The remainder from the division by 3 of the sum of the city's map coordinates determines which commodity the formula is applied to. All cities demand Silver as CitySize x 8, but the Tech modifiers only apply to Silver if the location is 0 mod3. If the location is 1 mod3, the city demands Gems at the full formula rate. If the location is 2 mod3, the city demands Gold at the full formula rate.

    Spice

    Supply = (Desert + Swamp + Jungle x 3/2 ) x (Ocean + Rivers)
    Location: DistanceToEquator < 10: 2x; - DistanceToEquator
    Continent#: 1: 1/2
    ContinentSize: <26: 2x >300 1/2

    Demand = ContinentSize/10
    Location: If ContinentSize > 400 and (Horizontal + Vertical) /2 is EVEN: demand is zero
    Techs: Refrigeration: 1/2
    CitySize: < 4: 1/2 5-7: 1x >7: 2x

    Gems

    Supply = (Desert +1) x (Mountains + 1) x (Swamp + 1) + Plains
    Location:
    Continent#: 7: 3/2 x
    Techs:
    # of Techs:
    CitySize: 1-7: 1/2 8-12: 1x 13-17: 3/2 >17: 2x

    Demand: See Silver

    Gold

    Supply = (Mountains x 2 + Hills + 2) x (Rivers +2)
    Terrain: If Mountains < 3: 1/2
    Location:
    Techs:
    # of Techs:
    CitySize: 1-4: 1x 5-9: 2x >9: 4x

    Demand: See Silver


    Oil

    Supply = Desert x 10 + Tundra x 8 + Glacier x 8 + Swamp x 6
    Location:
    Continent#: 9: x 3/2
    Techs: If Combustion NOT discovered by anyone: 1/8
    # of Techs:
    CitySize: >37: 2x

    Demand = 0
    Location:
    Techs: Enabled by Industrialization; Automobile: 3x
    # of Techs: + Techs/6
    CitySize: 1-2: 1/2x 3-4: 3/4x 5-7: 3/2x 8-9: 2x 10-12: 4x 13-17: 5 x 18-19: 6x 20-22: 12x 23-27: 14x 28-32: 16x 33-37: 18x 38-42: 20x
    CityImprovements: Factory: 3/2x Superhighways: 2x Mass Transit: 1/2x Recycling Center: 1/2x

    Special Note: Oil can appear as both a demand and supply wildcard after Industrialization if the regular wildcard is not expressed.


    Uranium

    Supply = (Desert + Tundra + Glacier + 1) x (Mountains + 1) x (Hills + Rivers + 1)
    Location:
    Techs: Enabled by Nuclear Fission
    # of Techs:
    CitySize: 1-2: x0 3-7: 1/6 8-12: 1/3 13-17: 1/2 18-22: 2/3 23-27: 5/6 27> 1x

    Demand = 0
    Location:
    Techs: Enabled by Nuclear Fission
    # of Techs: + #Techs squared
    CitySize: 1-2: 1/8 3-7: 1/4 8-12: 1/2 >12: 1x
    City Improvements: Nuclear Plant: 2x SDI: 2x

    Special Note: Uranium can appear as a demand wildcard after Nuclear Fission if the regular wildcard is not expressed.



    ---------------------------------------------------------------
    Terms used

    # of Techs. This is acquired techs plus 1. It does not include starting techs but does include the tech being researched.

    Land. Land is calculated as (21 - Ocean).

    DistanceToEquator. The "equator" on a civ map is a horizontal line whose vertical coordinate is half the map height (Y size). DistanceToEquator is the difference between a city's vertical coordinate and the equator.

    TemperateZoneOffset. The "temperate latitude lines" are halfway between the equator and the poles. The TemperateZoneOffset is the difference between a city's vertical coordinate and the nearest temperate lattitude line.

    LongitudeEast . For cities in the Eastern Hemisphere, the difference between its horizontal coordinate and the mean meridian (map width divided by 2).

    LongitudeWest . For cities in the Western Hemisphere, the negative of the difference between its horizontal coordinate and the mean meridian.

    DistanceToMeanMeridian The absolute difference between the horizontal coordinate and the map's width divided by 2.

    DistanceToPole. DistanceToPole is the difference between a city's vertical coordinate and the nearest Pole.

    DistanceToDateline. DistanceToDateline is the absolute difference between a city's horizontal coordinate and the Dateline (0 meridian) via the shortest route.

    PolarCircle. The Polar Circles on a civ map lie at MapHeight/6 and MapHeight x 5/6. If a city's lattiude places it within a Polar Circle then the value of PolarCircle is 1, otherwise it is 0.
    Last edited by samson; December 6, 2002 at 16:14.

  3. #3
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    I had a dilemma with this post. I've made considerable progress in understanding the general nature of the supply/demand problem and in reconstructing some of the commodity formulae, but there is much work remaining to be done. Although I dislike posting partial results, I decided to offer what I am confident of and leave a placeholder to edit later as the individual formulae are determined and thoroughly tested. Thus, this thread is a work-in-progress, but structured so that the relevant information will all appear at the top when complete. Your comments and questions are welcome.

  4. #4
    solo
    King
    Join Date
    06 Jan 2001
    Location
    Lowell, MA USA
    Posts
    1,704
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Fascinating, so far. I was starting to notice the different way the even-numbered commodities were being treated in the early part of the game, but it is quite a leap to be able to quanitfy this, as you have done in the wildcard formulas. I am very curious about your methodology used in deriving these, if you would care to elaborate some.

  5. #5
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Methodology. Okay. In studying terrain affects, I created a set of mono-terrain worlds: all desert, all grass, all forest, etc. I noticed certain commodities appearing in almost all cities, but the middle commodity varying in patterns based mainly on rows. Curiously, the same middle commodity pattern held on all worlds, regardless of terrain. I loaded up saved games and found, astonishingly, the pattern held true in random maps as well. (At least in the early game). This led to discovery of the Wildcard algorithm.

    The notion of sorted lists of high-to-low priority demand and supply comes from the observation that changes in lists often involve a shift to the right or left. This would be expected in sorted lists. Of course, the wildcard commodity obscures this phenomenon because it masks one of the true sorted elements. But after I understood how wildcards work, I could design test cities where the wildcard was a duplicate and therefore not expressed. This allowed a truer picture of the shifting of commodities as mods were made to terrain and other factors.

    The idea of selecting commodities for either the demand or supply list by SQ and DQ is based on your observation of the rarity of duplicates. And the phenomenon of "jumping" commodities which move between the two lists. If the SQ and DQ values are close, then slight changes will push the commodity from one list to the other.

    Now, how to determine the actual formulas for the commodity SQ and DQ? Tough problem. Start with terrain. By using mono-terrain city sites and slowly changing squares one at a time to different terrain types, you can determine what terrain is associated with which commodities for supply or demand. The relative weighting of terrain types for a single commodity can also be found this way.

    However, to get the absolute terrain weights requires comparisons between different commodities. This assumes that the commodities work on the same scale, of course. And also that DQs and SQs use the same scale. To accomplish this, you need to design cities without wildcard commodities and then, by changing terrain squares, find the points where one square change causes a switch in places of two commodities. This is the (almost) equal point. At that point you can derive an absolute weighting scale with algebra.

    The problem is, of course, there are many more factors than terrain at work. In fact, almost everything someone has suggested in these threads has proved to be valid, as you can tell from the list.

    Generally speaking, I think the commodity DQs and SQs have a root formula based on terrain to which bonuses and penalties are applied, much like the delivery and trade route formulas. The DQ and SQ bonuses and penalties are from factors like # of Techs, city size, specific techs, continent #, etc. Part of the methodology for discovering these bonuses is simply making a list of things that are already known about commodity supply and demand. Then quantifying these relationships with testing.

    There's still a lot of work to do, I've only got a couple of commodity formulas I'm confident of yet. And they can only be shown to be true in relation to each other at this point. However, each piece of the puzzle that falls into place helps give shape to the next.

  6. #6
    solo
    King
    Join Date
    06 Jan 2001
    Location
    Lowell, MA USA
    Posts
    1,704
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Samson,

    This is great stuff! Thanks, for elaborating. Now I can see how noticing the pattern of middle commodities appearing on rows led you to the wildcard idea and its formulas.

    Were your observations made from actual games being played on these test maps?

    Or did you find a shortcut for testing all of the possibilites that must have been required to acquire the data you have gathered so far?

  7. #7
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Were your observations made from actual games being played on these test maps?
    Not games, just Cheat Mode testing. I filled a small world map with cities 2 squares apart and started recording the S and D lists. After a while the pattern was pretty obvious.

    MY "shortcut" is hypothesis, test, deduction, repeat.

    When I first realized how complex this problem was (32 formula, not just one!!!) I almost quit. But at this point, I think it's doable.

  8. #8
    Scouse Gits
    Emperor Scouse Gits's Avatar
    Join Date
    24 Nov 1999
    Location
    Liverpool, United Kingdom
    Posts
    6,348
    Country
    This is Scouse Gits's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    November 1, 2014
    Local Time
    00:41

    Sick

    samson...dare I ask how many hours of work went into the above?

    I have printed it out to re-read so I can digest it all! I think I understand most of it...thanks I will study your findings.

    We keep coming back to certain numbers, 21 squares in a city, 21 specials + 11 terrain types makes 32.

    ------------------------

    SG(2)
    "Our words are backed by empty wine bottles! - SG(2)
    "One of our Scouse Gits is missing." - -Jrabbit

  9. #9
    DrFell
    King
    Join Date
    28 Sep 2000
    Posts
    1,131
    Country
    This is DrFell's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    November 1, 2014
    Local Time
    00:41
    It's interesting how changing the terrain in cheat mode changes the demand items, and how changing it back changes the demand items right back to their original. I did a couple tests on my own whole grassland world after reading this. I used to believe there was a random factor in supply/demands but now I see that they seem quite predictable. Just goes to show how complex the trade formulae are. Wish there was something this detailed in civ3.

  10. #10
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    SG and DrFell -- thanks for your interest and for reading the post.
    Last edited by samson; November 19, 2002 at 10:34.

  11. #11
    solo
    King
    Join Date
    06 Jan 2001
    Location
    Lowell, MA USA
    Posts
    1,704
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Samson,

    I have been using your wildcard formulas, doing a few spot checks on some cities in my hot seat test game. After checking 4 cities with confirming results, I might have come upon an exception when checking Bombay. Details are summarized below:

    Coordinates (86,66)
    Supply wildcard – gems
    Demand wildcard – hides

    Events follow:

    2250 Trade learned s: silk,gems,coal d: dye,hides,cloth
    2150 s: silk,gems,silver d: dye,copper,hides
    1350 gems caravan built s: silk,(gems),beads d: dye,copper,cloth
    975 silk caravan built
    800 beads caravan built
    775 s: (silk),(gems),hides d: dye,copper,cloth

    Bombay was the 11th city founded, and has been through 3 cycle years so far, 2150, 1350, and 775. The supply wildcard, gems, is acting as expected, but the demand wildcard, hides, should be appearing in the middle of the demand list on the 1350 cycle turn, shouldn’t it? For sure two things are out of the ordinary for this turn, because a caravan was built, and the supply wildcard just happened to be chosen for this build, but that shouldn’t affect the demand wildcard, right?

    I have double-checked Bombay’s grid coordinates (from a medium map), and have loaded the 1350 turn to double-check the S/D lists, and double-checked the calculation of the demand wildcard, too. Perhaps commodity builds on cycle turns cause glitches, since I was able to build a dye caravan for Washington earlier in the game on its cycle turn, when dye was not on Washington’s supply list.

    By the way, one thing I have been noticing is that when commodities are built, shifts of certain commodities, such as hides seem to happen on or after build turns. Hides (or whatever is shifting for other cities) makes a transition from one list to the other. Notice how hides moves to the supply list for Bombay in 775, after moving off the demand list in 1350.

    As for the problem with dyes, I have a possible explanation. I believe your suspicion of a programming glitch of some sort is true, which has resulted in a very high demand quotient for dye, making it a permanent fixture in the top spot of all demand lists. In my test games, the only supply of dye so far have come from new cities, yet to encounter the cycle, after which the supply switches to numero uno demand, from where it never budges! I would be much more worried about dye, if there happened to be an assortment of established cities supplying it instead of demanding it, but they all demand. Since game turns probably have to go by to cause the glitch, it does not show up in your tests.

    Before continuing my test game, I will determine the wildcards for each city, so that I can continue to follow these to see how they are corroborated in an actual game. So far, with the possible exception of Bombay, things look fine, though.

  12. #12
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Solo,

    The explanation for the demand wildcard (Hides) not being asserted in 1350BC is that Hides was the middle supply commodity which was replaced by Gems. Wildcards are not played if the commodity is already on either list. So if the original lists were:

    Supply: Silk, Hides, Beads
    Demand: Dye, Copper, Cloth

    then Hides will not be used as the demand wildcard because it is already on the Supply list. However, the supply wildcard, Gems, is played and so removes Hides. This disguises the fact that Hides was originally supplied.

    I've seen this happen many times. If you diddle with the terrain enough to shift the supply either right or left, Hides will pop out from behind the wildcard mask and appear in the left or right supply slot. Confirmation of this explanation occurs in 775BC when Hides does reappear in the 3rd slot.

    To my knowledge, building a caravan is not a trigger event. But perhaps more testing is needed to confirm or refute that.

    As for commodities jumping from supply to demand lists ... this happens when a commodity has both a high SQ and and high DQ. It will be placed on the list of whichever is higher, but if the values are close then slight changes can cause it flop to the other list.

    Yes, the bug with Dye appears to be an extremely high demand quotient. Which either erodes naturally over time or gets corrected by some unknown event. The problem with the Dye bug for me is that it screws up the predictability of supply and demand lists.

  13. #13
    solo
    King
    Join Date
    06 Jan 2001
    Location
    Lowell, MA USA
    Posts
    1,704
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Okay, without knowing any terrain effects yet, I hadn't a clue that hides would have been sitting in the middle slot of supply unless overridden by gems. You might have warned us that this could happen, as it is kind of subtle!

    By the way, I tried a replay, without having the caravan built on the cycle turn of 1350, and the lists were identical, so for now I agree that building caravans on cycle turns probably did not have any effect on S/D lists.

  14. #14
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Solo,

    Yes, it is subtle. The whole damn thing is pretty subtle. And sly, too. You'll get a kick out of some of the commodity formulas I think.

    The wildcard mechanism makes it harder to see the patterns than it would be without them. It also makes testing of the formulas tricky. Just when I get the list order the way I want to see them to compare quotients of two commodities, a wildcard messes it up and I have to fudge around some more.

  15. #15
    solo
    King
    Join Date
    06 Jan 2001
    Location
    Lowell, MA USA
    Posts
    1,704
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    I forgot to mention that even though dye may be making things harder on you, while investigating S/D changes, the action it spawned made the 16 turn cycle much easier for me to spot! Hurrah for dye!

    Enough kidding around. The knowledge of wildcarding has open a new realm of strategy. At the moment, it appears to me that when a supply wildcard hits its own list, it will be very likely for it to stick there for a long time, especially if it is one of the higher valued commodities, like wine, silver or gems. They don't seem to go through so many adjustments in the earlier half of the game. With dye, hogging spot #1, and when the demand commodity occupys the middle position of deamnd lists, there is only one position the supply wildcard can have on the DQ list in order to show up on the demand list. If it can't show up there, it can not leave the supply list, right?

    It looks to me that one would want cities with a high quality supply commodity and with a frequently shifting demand one. If the high quality supply commodity is used to establish the first trade route, then it should become a valuable participant in an alternating supply situation, later on. A volatile demand commodity is apt to set up alternating supply sooner.

    Another idea might be to select city sites where hides will be the supply commodity, to take advantage of its unique behavior.
    Last edited by solo; November 16, 2002 at 10:41.

  16. #16
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Any and all,

    I've posted the formulas for Hides to the placeholder spot above. I'm looking for feedback on the format in which to present them. Is this clear and understandable?

    The first line is the terrain-based part of the formula. Although not all commodities use terrain, the vast majority do. The lines that follow terrain are other factors that affect the S/D calculations: location, techs and # of techs, city size, etc. Not every formula uses every factor, but I thought presenting them in a common format would make comparisons easier.

    Like I said, I want feedback before moving ahead with this. Even those who have no intention of ever calculating S/D lists can learn something about how Trade works if the data is presented clearly, I think. All comments are welcome.

  17. #17
    solo
    King
    Join Date
    06 Jan 2001
    Location
    Lowell, MA USA
    Posts
    1,704
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    The format is very clear and looks good to me.

    If hides are typical, there are many factors to calculate for each commodity in each city, making it likely that only a few players will end up doing this. However, just a glance at the formulas can tell you in a more precise way of trends that can be expected and if a site is likely to produce or demand hides, which to me, will make all the formulae quite useful.

    Keep them coming, please!

    Back to wildcards, for a moment, where I have a question about one city, Nineveh (43,33), which has a supply wildcard of copper and a demand wildcard of hides. So far, there has been one change:

    2200 s: hides,copper,salt d: dye,wool,silk
    1550 s: beads,salt,wine d: dye,hides,silk

    The only explanation I can see for not having copper on the supply list in 1550, is that it moved to the demand list, underneath hides. If this is the case, it seems like quite a wide shift from where it was in 2200. The only event of note to happen in the city in the meantime, was that I built a temple. Did the temple give copper enough of a boost in its DQ to end up 2nd on the demand list? Or is there some other factor I am missing here?

    (Note: the Babs learned Astronomy & Navigation during this interval, but I don't see them listed above as affecting copper.)
    Last edited by solo; November 16, 2002 at 15:22.

  18. #18
    Grigor
    Prince Grigor's Avatar
    Join Date
    12 Jan 2000
    Location
    Oberlin, Ohio
    Posts
    388
    Country
    This is Grigor's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    19:41
    OK, this is fascinating! Cold places seem to want hides... So far it looks like a group of programmers got together over a couple bags of Cheez Pops and tried to describe real world demand and supply of hides in game parameters. This paradigm may help in guessing future formulas, but I suspect Samson is already trying that.

    I still don't see any mention of the special aspect of hides - namely that its supply never seems to appear as (Hides), and often is not listed as the Trade Route from the source city. Could there be a factor which reduces a commodity's SQ if it is currently supplied to another city? That might be part of an explanation for the repeating of some commodities on supply lists, especially if it is subtractive not multiplicative.

    And on the subject of the Dye bug, a silly thought - is it possible that it may be an inverse side effect of the set of parameters which make Uranium supply so rare? Or is Uranium (which can never be a wild card according to these formulas) just given such unlikely SQ parameters that it will always be rare? In any case, the scarcity of Uranium is unusually effective in most games, either by a programmer's mistake or as his pride and joy.

  19. #19
    Marquis de Sodaq
    King Marquis de Sodaq's Avatar
    Join Date
    21 Jul 2000
    Location
    ... no, a Marquis.
    Posts
    2,179
    Country
    This is Marquis de Sodaq's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    17:41
    Excellent study! I spent a fair amount of thought on doing something similar, but never got up the nerve to put together such a time consuming test. Hats off to samson!

    I feel especially good for having speculated that map location was the prime determinant of commodity availability, particularly after reading:
    There are two Wildcard commodities, one for supply and one for demand. These are based solely on the city's map coordinates.
    Thanks, samson, for the effort.
    The first President of the first Apolyton Democracy Game (CivII, that is)

    The gift of speech is given to many,
    intelligence to few.

  20. #20
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Grigor -

    OK, this is fascinating! Cold places seem to want hides...
    Yeah, and the places that supply Hides are Forest and Tundra (where "Game" is found) and Rivers and Jungle where furry animals abound. Small trading posts (city size 1 or 2) have 2X modifiers for both supply and demand.

    I think the formulas do tell a story. Take a look at Beads, posted above.

    Could there be a factor which reduces a commodity's SQ if it is currently supplied to another city?
    Possibly. There are several formulae I haven't been able to crack yet. But Hides is close to correct, I think, with nothing in its formula to explain its unique property.

    The scarcity of Uranium is probably caused by having a extremely high DQ relative to its SQ, which means that it only rarely shows up the Supply list.

  21. #21
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Marquis -

    You're very welcome. And yes, your suggestion about location was one of the things I tested, proving fruitful not only in the wildcard notion, but also in geographic concepts as well: proximity to poles or equator, etc. In fact, I think all of the ideas people have suggested here have turned out somewhere in my testing to being valid.

  22. #22
    solo
    King
    Join Date
    06 Jan 2001
    Location
    Lowell, MA USA
    Posts
    1,704
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    First, here's a hunch I've always had that you probably can not make any use out of! I've always suspected that irrigation of hills causes more wine to appear on S/D lists.

    I have gone back and checked many situations where hides has either gone off or come on lists in my hot seat test game, and there is a strong correlation with the hides formulae.

    When Trade was shared with all civs, there was a lot of tech gifting that causing almost every civ to loose their 4x multipliers in the tech department for both supply and demand. Hides on supply lists even slipped further as cities started growing past size 2. In my MGE game, hides are definitely following the expected trends predicted by the hides formulae.

    Even more convincing is the fact, that in cases where hides have been added to supply and demand lists, this has often happened because of their status as wildcards in cities where this has happened!

    There were also 3 cases where it appeared that hides were added to demand lists, when this actually may not have happened. In all three, it looked very likely that they had just remained on lists, having moved out of the middle position where they had been previously covered by a wildcard. In two out of three cases, hides might have actually lost status by moving down to the third position on the demand lists.

    So with hides, the current trend towards having less on both lists has become even more noticeable and predictable. It is encouraging news that quotients and wildcards work for both the 2.42 and MGE versions of the game.

    The depth of insight and proficiency with which Samson has been able to unravel the mysteries behind these lists sometimes leaves me wondering whether or not he has a copy of the Civ II source code.
    Last edited by solo; November 16, 2002 at 15:12.

  23. #23
    Grigor
    Prince Grigor's Avatar
    Join Date
    12 Jan 2000
    Location
    Oberlin, Ohio
    Posts
    388
    Country
    This is Grigor's Country Flag
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    19:41
    >Wool: Supply = (Grass + Hills x 2 + Rivers/2 ) x (Tundra + Glacier + 2)

    Are you sure about this Wool Supply formula? The multiplication of Tundra + Glacier seems strange.

    The Cheez Puffs theory might go this way: Wool comes from sheep and goats (and llamas which we will ignore) which grow in, like, England, so grass and hills are good, and rivers make it extra green so they are sort of good (?) plus it's extra thick wool if it's real cold, which for some reason we will measure by tundra and glacier squares instead of distance from the equator.

    >Demand = Plains x 2 + Forest
    >Location: + TemperateZoneOffset x 2
    >Techs: Industrialization: 2x

    The Demand side is harder to figure - let's see: only plains and forest count because everything else is either too comfortable for wool or too severe for wool (or else grows their own) and this demand gets greater as we move to the Tropics (Our Man in Havana) or to the poles (Ragg socks). But with industrialization, we can make Nylon.

    I am not totally following this logic.

  24. #24
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Originally posted by solo
    I've always suspected that irrigation of hills causes more wine to appear on S/D lists.
    I've tested irrigation, mining, and roads but have found no correlation to any commodity S/D changes so far. I thought at one point that roads were a factor but that data proved suspect and I have discarded the notion.

    Originally posted by solo It is encouraging news that quotients and wildcards work for both the 2.42 and MGE versions of the game.
    Yes it is. And much thanks again for the independent testing you are doing on MGE and the confirmation of these findings. This project is much tougher than the work I did with caravan delivery payments. There the payment numbers were known and thus the derived formula could be tested for correctness. In this case, the entire model and even the existence of DQs and SQs is supposition; an hypothesized mechanism for explaining the Supply/Demand phenomenon. So there is nothing to check correctness against except the same behaviors from which the model was derived. However, correspondence of the model to the actual design is not necessary, as long as its predictions are close enough to fact to be useful.

    ... sometimes leaves me wondering whether or not he has a copy of the Civ II source code.
    No, not hardly. I will say this though, this project has given me a real appreciation for the depth of thought and intelligence in the game's design. Perhaps, I'm reading too much into it, but it seems to me that the Trade system attempts to simulate the historical importance of different trading commodities to civilizations and eras with an understated humor and elegance.

  25. #25
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Originally posted by Grigor
    Are you sure about this Wool Supply formula? The multiplication of Tundra + Glacier seems strange.
    ... I am not totally following this logic.
    The formulas are empirically derived; correspondence, or lack of it, to historical or economic reality is an interesting result not a contradiction or confirmation. I like the Beads formula because it reflects the distribution of seashells from which beads were made. But the formulas I present here are simply what I've found and I don't understand all the logic of them either. I do understand the increase in demand for Wool caused by Industrialization though. The cloth mills of England is where the Industrial Revolution got its start.

  26. #26
    solo
    King
    Join Date
    06 Jan 2001
    Location
    Lowell, MA USA
    Posts
    1,704
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Yes, the design of this game never ceases to impress, especially the parts dealing with trade.

    I have some news about dye on my pattern thread that shows more conformance by MGE with 2.42. This is good news.

    When you have enough commodities finished, I'm looking forward to checking them against what really happened in my MGE game.

    Also, I'm hoping that I'll be able to block all supplies in that game fairly soon to see the effects this might have on the whole trading system. With all civs building and delivering caravans, supplies are starting to disappear rapidly.

  27. #27
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    I've updated the formulas list above with all my latest results. TBD means "to be determined". A note on testing methodology. All factors have been tested singly, that is by changing only that factor and holding others constant. There may be factors that interact to produce effects only when combined. The problem is too complex to test for all such possibilities.

  28. #28
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    I've found and added the Demand Quotient formulas for Silver, Gems, and Gold. Interestingly, these three commodities demands are interrelated. More remarkable is that the demand is based solely on the city's size. This is great as it means that there are now three demand commodities that can be easily and surely calculated. This should make the determination of other demand formulas easier. It also should allow more rigorous testing of existing formulas and the underlying model of the trade system.

  29. #29
    Elephant
    Prince Elephant's Avatar
    Join Date
    14 Aug 2002
    Location
    Phila PA
    Posts
    828
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    18:41
    I'm stumped by the complexity you are finding, but it is clever. So the system can tell the difference between the Chinese and any other civ regarding Silk? I thought it only knew the CivNumber. In one of my recent games all the Japanese cities demanded Silk for a while. Guess that was just a fluke.

    Some of these Location formulas, it can all be expressed mathematically using the map size and the city location. But it helps us understand logically the way you relate it to the zones and lines you do. Good work. Now for some serious testing...

    Practically speaking, we're all wondering how we can use this to make a city that Supplies Uranium consistently...

  30. #30
    samson
    Prince samson's Avatar
    Join Date
    10 Apr 2001
    Posts
    440
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Local Date
    October 31, 2014
    Local Time
    23:41
    Elephant,

    Yes, there will be lots of testing to do. I'm sure the formulas have flaws in them, and perhaps the model will need to be rethought, too. Anyone who wants to help, can. Just check the S/D lists of some cities during gameplay against the predictions of the model and formulas and report the results. If they don't matchup post a save and I'll look into it.

    As for Uranium, I've posted its formulas above. The reason for Uranium's scarcity is apparent. Uranium's supply is terrain based and scaled by city size. But Uranium's demand is based an the square of the number of Techs acquired. It, too, is scaled by city size, but faster than supply. In a typical game, Nuclear Fission is discover rather late, by which time the player has 50 or more techs. This creates an enormously high demand quotient which the supply side equation can never match. Thus U is always demanded, not supplied.

    To supply Uranium, you need to steal or trade for Nuclear Fission while you are still far behind in the tech race. This would give you a low enough demand quotient in cities with the appropriate terrain to be able to supply Uranium. Alternatively, you could give NF to a low-tech civ, wait for some of their cities to start supplying Uranium and then conquer them. I don't believe that conquering a city triggers S/D list changes. So you would have until that city's next solo-cycle year to build Uranium caravans.

    Some of my testing suggests that Uranium may, like Oil, also be a secondary Wildcard. If that proves true, then there may be another way of getting a city to supply Uranium.

Page 1 of 7 1 2 3 4 ... LastLast

Similar Threads

  1. The Fallacy of Supply and Demand?
    By Heraclitus in forum Off Topic
    Replies: 10
    Last Post: September 2, 2008, 20:56
  2. City supply/demand
    By Eivind IV in forum Civilization I and Civilization II
    Replies: 3
    Last Post: January 29, 2008, 18:16
  3. Demand/Supply denomination
    By Eivind IV in forum Civilization I and Civilization II
    Replies: 3
    Last Post: December 13, 2005, 09:31
  4. Testing how terrain affects supply and demand lists
    By solo in forum Civ2-Strategy-Archive
    Replies: 5
    Last Post: November 10, 2002, 21:26
  5. supply=demand
    By m qu in forum Civ2-General/Help-Archive
    Replies: 3
    Last Post: April 29, 2001, 22:59

Bookmarks

Posting Permissions