Announcement

Collapse
No announcement yet.

How Supply and Demand Lists Are Determined

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #91
    In the 725BC save I have, Philadelphia does not demand spice. If it did once, it doesn't now. All spice demands are on continent 13 and are ODD.

    You said the second largest continent has 300 tiles? Oddly, that's the breakpoint for a 1/2 reduction in spice supply I detected. One more tile on that continent would reduce the SQ of cities there and thus favor demand of spice over supply.

    I think we're getting close with Spice. Cloth Demand, on the other hand, is still giving me fits. Under 10 techs, the simple terrain formula works well. But after 10 techs, the demand increases at 10 tech boundaries. This indicates a formula something like:

    Demand = Forest x 4 + Hills x 4 + Techs/10 x (???)

    ??? is different for different cities. CitySize doesn't seem to have any effect on the DQ.

    Comment


    • #92
      Yes, when Philadelphia was founded, it demanded spice, but this went away on its first cycle turn. By the way, 3 new cities in row had this happen, but this is probably just a coincidence. Spice calculations are holding up, so far in further tests, after I got the continent count. On continent #13, its 34 at size 1-3 is fairly decent and the 68 at size 4 and higher gives it a good shot at making demand lists.

      By the way, I did find another EVEN spice in another game, but it's continent looked like it was #2 in size. I did not want to count two continents to check just one example, though. I have found much to confirm ODD only on the #1 sized continent in other saves. No exceptions to that yet.

      You may want to count up tiles on continent #1 just as double check, since just 1 tile cuts things very close. I am not including internal oceans in my counts, since they are numbered different.

      Cloth demand may be hinging on another factor we have yet to consider, so I will keep an eye on this, to see if I can spot something unique happening with cities demanding cloth as I continue through the ones in my test game. One thing maybe worth a try is changing dates as another way of simulating the passage of time. I doubt it, but from what we've seen so far, you never know.

      Another thing I have been forgetting to mention is that when there is a tie among 2 or more commodities on a roster, the dearest commodity is given the nod, just as you experienced when there is a tie at zero. This consistency is no surprise, but worth noting.

      I'm off to check the lists for the Babylonians.

      Comment


      • #93
        While doing Babylon, I have had the first chance to use rivers and to have gold in contention, with which there is a slight problem. Babylon(37,33) (gems,silver) continent #13.

        grass = 4
        desert = 2
        Plains = 5 + buffalo = 9
        hills = 3 + wine = 7
        mountains = 2
        ocean = 3
        rivers = 4

        2100 coal,gems,copper dye,silver,wool size 2, techs:20
        1300 coal,gems,gold dye,silver,silk size 3, techs:21
        750 coal,gems,gold dye,silver,spice size 4 techs: 22

        (techs now include the one being researched)

        First, the demand side works okay, as long as one assumes that copper gains enough steam to get under the silver wiildcard in 750. By size 4, it usually does.

        On the supply side, coal is guaranteed for slot #1, since it is way ahead of the others. However, I calculate gold to be 78, all three years, with no competitors at that level, the closest ones being:

        2100 hides = 48 and copper = 45
        1300 copper = 45 and wine = 38 (hides down to 24)
        750 wine = 38 and hides = 24 (copper now in demand)

        For things to work better, I would like gold to be half of what it is, which might be possible if the x 1/2 modifier for mountains < 2 were adjusted to read <= 2. This would change gold to be 39. With gold at 39 we would get everything right for 2100 and 1300, and with a little fiddling with either the wine or gold equation, we could have 750 come out right, too.

        One consideration is that wool has a SQ of 40 all three years, but this is wiped out by its DQ of 44 each time. If there could be less demand for wool at size 4, then its supply would inch out gold at 39, putting gold in slot 3 where it belongs. This scenario requires no fiddling to the gold or wine equations.

        (A final note, is that hides can not be on the supply list in 2100 UNLESS techs are 20, and for this to happen, the tech currently being researched has to be included in tech totals, as you suggested might be necessary, in your previous post.)

        (Note 2: I have moved on to Ellipi, and think I have found a definite problem with the wine formula. The LesserOf function should take it off the supply roster, but does not. I may be mis-interpreting how it works, but Ellipi has no rivers and IS supplying wine)
        Last edited by solo; November 23, 2002, 18:36.

        Comment


        • #94
          Solo,

          Did the Babylonians have any starting techs? The numbers you give indicate that you are counting all techs. You'll need to go back to a 4000BC save to see what they had. I suspect they had some and that is throwing the calculations off.

          Yes, the gold modifier for mountains should be <3: 1/2.

          I've also seen the ties are resolved by choosing the commodoties with the highest ID#.

          For continent #1, I count 310 tiles.

          Comment


          • #95
            Running the numbers, I get that Babylon must have had 5 starting techs. This would give the following supply lists (with wildcards removed):

            2100: coal, hides, copper
            1300: coal, wine, gold
            750: coal, wine, gold

            Comment


            • #96
              Yes, the Babylonians had 5 starting techs. So to get tech totals are you saying:

              1) Get total from science advisor screen
              2) Add one for the tech currently being researched
              3) Then subtract the number of starting techs

              I haven't tried doing it this way yet. If so, I'll have to re-check the Roman cities to see if they still are working correctly. Before they only seemed to be working if staring techs were ignored.

              Other starting tech totals for that map:

              1) Romans - 3
              2) Germans - 0
              3) Egyptians - 5
              4) Americans - 3
              5) Greeks - 5
              6) Indians - 4

              How do starting techs affect the SQ's of wine or gold for Babylon? Looks to me that this only changes hides.

              What numbers are you getting for Babylon supply commodities of hides, wine and gold? Please give details on the wine calculation, as I am not sure I am doing it as intended.


              310 tiles is close enough for me. This means /10 for spice yields 3 then, using either count. Were you adding in lakes? They have a different ID.

              Comment


              • #97
                Yes, the Babylonians had 5 starting techs. So to get tech totals are you saying:

                1) Get total from science advisor screen
                2) Add one for the tech currently being researched
                3) Then subtract the number of starting techs
                Yes, acquired techs +1.

                I also checked the current research cost of each civ and calculated how many techs they were paying for, subtractiing this from the total to get their starting techs. My numbers were:

                Romans - 2
                Babylonians - 5
                Germans - 0
                Egyptians - 5
                Americans - 3
                Greeks - 5
                Indians - 4

                Thesea are the same as your numbers except for the Romans which you list as 3. Just to be sure we're on the same page, I am in year 725BC, Babylonians turn.



                My supply numbers for Babylon:

                2100BC

                Coal: 131
                Hides: 96
                Copper: 45
                Wool: 40
                Gold: 39
                Dye: 30
                Silver: 27
                Wine: 25
                Beads: 17
                Salt: 15
                Cloth: 12
                Spice: 10
                Gems: 9
                Silk: 8
                Oil: 2


                1200BC

                Coal: 131
                Wine: 50
                Copper: 45
                Wool: 40
                Gold: 39
                Dye: 30
                Silver: 27
                Cloth: 25
                Hides: 24
                Beads:17
                Salt:15
                Spice: 10
                Gems: 9
                Silk: 8
                Oil: 2

                725BC

                Coal: 131
                Wine: 50
                Copper: 45
                Wool: 40
                Gold: 39
                Dye: 30
                Silver: 27
                Cloth: 25
                Hides: 24
                Beads:17
                Salt:15
                Spice: 10
                Gems: 9
                Silk: 8
                Oil: 2

                In 1200 and 725, Copper and Wool have higher DQs and so Gold pops onto the Supply list.

                Wine = 36 (plains x 4) or 16 (Rivers x 5 - Grass)
                (16 is the lesser of two)
                + DistanceToDateLine/4 (37/4) 16+9 = 25
                x 2 (Northern Hemisphere) = 50

                In 2100 at size 2, Wine is 50/2 = 25. When size goes to 3 it jumps to 50.

                Comment


                • #98
                  Thanks, for those details. A lot was clarified for me. You are right about the Romans, as starting techs were 2, not 3. My earliest save was 3950 BC, from which I noted 3 techs on the scoreboard. However, now my written log of the game reminds me the Romans opened a hut to get a tech on the 4000 BC turn! Good grief!

                  Anyways, earlier Roman results still tally okay when taking this into account.

                  I was off a bit on wine, so thanks for that details.

                  I think we are on the same page now in all departments, and can check off Babylon as another city that tallies up okay.

                  Is cloth still giving fits? Are all cities coming out different from each other?

                  If it's not city size, perhaps it's some calculation based on the cities' locations. An EVEN, ODD or reaminder kind of thing, or perhaps something new like distance of the city to its capital, or the order that cities were founded in. Could be related to the cycle year in some way, too, since this is usually different for each city in each civ. This would give up to 16 different variations.
                  Last edited by solo; November 23, 2002, 22:18.

                  Comment


                  • #99
                    One more question about wine.

                    In Ellipi, there are no rivers, but there are 3 grass, with a -3 result which is defintely lowest, because there are plenty of plains. Does the LesserOf function really yield -3 or do you just count it as supply = 0?

                    The reason I ask is because the DQ turns out to be 16.

                    If -3 is used for wine supply, then when it's adjusted for location, the result is 10, otherwise it is 16.

                    However, wine ends up on the supply list.
                    Last edited by solo; November 23, 2002, 23:24.

                    Comment


                    • Wine ... yes, it looks like the (Rivers x 5 - Grass) part of the equation is zero-limited.

                      Also on wine, the continent# modifier extends beyond continent # 10: 2,6,10, 14, 18, etc. ... the series continues. I guess this would be expressed as RemainderOf(Continent# /4 ) = 2.

                      Re: Cloth. I don't have an answer yet, but I've designed a testing plan.

                      First, there are two formula templates that could be at work here. One is:

                      Forest x 4 + Hills x 4 + ( Techs/10 x ???)

                      the other is:

                      GreaterOf( Forest x 4 + Hills x 4, (Techs/10) x ???)

                      The second seems likely since so many factors and formulas have opposites and we already have a LesserOf relation in Wine.

                      In either case my testing plan is to create cities without Forest and Hills to eliminate the known factors, then tackle the unknown as if it was formula itself, testing for the usual factors: terrain, location, continent#, etc.

                      I may pump the techs up to 100 to get a 10x multiplier so Cloth appears more easily. Since CitySize doesn't affect Cloth Demand I can use the Silver/Gold/Gems triad with varying city size to measure Cloth within +/- 2.

                      If this approach doesn't find anything, then we'll have to consider unknown factors.

                      Comment


                      • Nineveh and Ur have been checked.

                        Ur is an EVEN city, and would want to demand spice in 600 BC when it reached size 4, with a count of 68, but hides, with a count of 58, appeared in the third slot on the demand list, instead. So it really looks like only ODD cities on the largest continent are eligible for demanding spice, since it was screened from Ur's demand list. Hopefully, this will happen to more cities on continent #13, and help confirm this theory.

                        No other problems, as lists went as predicted.

                        I like your plan for attacking the unknown factor(s) in cloth. Without terrain influencing the equation, an observable pattern may emerge. Good luck!

                        A thought I had was that the basic terrain formula may change every 10 techs, but it looks like you will be testing for this. Adjusting the terrain formula every ten techs would make each city's increase in demand pretty much unique. For example, after the first 10 techs go by, another terrain type might be added into the terrain equation. 10 more techs, another terrain type is introduced, and so on.
                        Last edited by solo; November 24, 2002, 14:44.

                        Comment


                        • Uruk, Akkad and Ashur check out okay, to finish to Babylonian cities.

                          Comment


                          • I have a formula for Cloth Demand. The testing plan worked pretty well, with a few modifications. Turns out it didn't use a GreaterOf relation. Also, no new factors were needed to explain Cloth demand, just terrain and location in a new ordering with the Techs/10 modifier. In the process of setting up the tests I also found corrections to the Hides supply and Coal Demand formulas. Now posted.
                            Last edited by samson; November 24, 2002, 16:48.

                            Comment


                            • Nice job of finding the rest of the cloth demand formula!

                              I have tested it with Pompeii, where cloth (16 with the original forumla) needed to pick up some points to make it past the value of wool (20). Having a lot of mountains and a tundra tile was enough to give tile 6 more points, resulting in a total of 22.

                              Back when the game was being developed and when they were coding the formula for cloth demand, they probably chuckled and said, "here's one they'll never figure out!" It's a good thing that a similar scheme was not used for the other commodities.

                              Since my last post I have moved on to German cities and have checked out Berlin and Frankfurt, with no further problems. It could be that we now have most of the kinks out of the forumas pertaining to smaller cities.

                              Without a way of deciphering the values of dye and copper, it looks like the list is finally complete, and just needs to be tested some more as cities grow in size and techs accumulate. I will be continuing tests, but in the meantime have a few notes that might be useful for users of the formulae, and you might want to post some of these in that section of this thread:

                              1) You mentioned that wine supply gets a x 3/2 multiplier for every 4th continent. The entry needs to be updated to reflect this.

                              2) Under techs it is worth mentioning how the tech total is determined.

                              3) A note that integer arithmetic is in effect and how this affects calculations.

                              4) For Land, note that this is a straight count, excluding rivers and specials.

                              5) For other formulae, rivers AND their underlying terrain are both used.

                              6) In the case of ties, on rosters, the most valuable commodity is given preference.

                              7) Give an example or two to illustrate the geographical formulae, especially for the ones that involve longitude.

                              8) It wouldn't hurt to illustrate commodity formulae either, with a few examples.

                              9) I'm not sure about this, but at some time I think I remember you mentioning that you found that wool demand can be influenced by city size. I can not find that post, so I might just be mistaken about this.

                              Comment


                              • All good points, I'll include them in the final writeup.

                                As for Dye and Copper, I think their behavior needs to be defined even if no formula is possible. They certainly act differently on MGE from 2.4.2. It may even be possible to derive formulas for 2.4.2 (with a list of exceptions once they are understood.) I may give them a little more time before closing the civlab casebook on this project.

                                Also, I'm still not sure when Oil and Uranium are used as wildcards and how to deternine which is used. They may be a few more issues, I'll have to check my notes.

                                But in general, yes, I think the main questions of how supply and demand commodities are selected and what factors cause them to change are pretty much answered. We probably need to write something up about known triggers and include that information here as well just so everything about Supply and Demand is in one reference place.

                                A fun project it was.

                                Comment

                                Working...
                                X