Announcement

Collapse
No announcement yet.

Colonialism (II) - The Age of Discovery

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

  • #46
    I think Mapcopy could be looked at for a solution. Apparently it also works with land mass numbers besides just fertility. From the readme:

    Body Counter (+bc)

    The Body Counter is an integer assigned to each continent. It may be used to determine if a trade route is between two continents or not. You can see this information by enabling cheat mode and positioning the cursor on a square. The number next to the square's location is its body counter.

    Note that if you are copying from a .MP file to a .SAV file, I recommend validating the .MP file before saving it. This will cause the Map Editor to calculate Body Counters for continents. Failure to do so may cause trade routes to behave strangely. (For additional information for ToT saved games see the Multi-Map Copies section below).
    Fertility (+f)

    This information determines how desirable a square is for building a city, this is used by the AI to pick city locations. Normally, only grasslands and plains are considered fertile, so the AI won't build cities on other terrain types. The fertility is usually considered low if a grassland or plains square is next to a city.

    When copying from a .MP file to a .SAV file, there is no fertility information in the .MP file to copy. To handle this, MapCopy can calculate a value for fertility, similar to the values the game calculates. By default, when copying from a .MP file to a .SAV file, the +f:CALC option is on, which calculates fertility information. When copying from a .SAV to another .SAV file, the +f:ADJUST option is on. This copies fertility information, but adjusts it to be lower when a city is nearby.

    Additionally, the +f:CALCALL option will cause MapCopy to calculate a fertility value for all terrain types. This should cause the AI to build cities on non grassland/plain squares. I don't know how this affects the AI's game playing ability. Note that CALC and CALCALL also adjust their fertility results based on the presence of a near by city.

    I have attempted to come up with a formula for fertility that is as close to how Civ 2 works as I can. However, I did not have time to figure out how resources work. The following algorithm is what I came up with, and seems to work well for maps with all special resources suppressed. I'm somewhat skeptical of some of the hard coded constants in this algorithm (especially the 2/3rds
    bonus for irrigation), and it may be that I'm one test case short of finding an exception to this algorithm.

    begin func calc_fertility(x, y)
    {
    Set selfFood, selfShields, and selfTrade to be the food, shields, and trade production for the square x,y.
    (See notes below on how production for a square is calculated).

    Set innerFood, innerShields, and innerTrade to be the total food, shields, and trade production of the 8 adjacent to x,y.

    Set outerFood, outerShields, and outerTrade to be the total food, shields, and trade production of the 12 squares in the outer ring of the city radius around x,y.

    Let combinedFood = (selfFood * 4) + (innerFood * 2) + outerFood
    Let combinedShields = (selfShields * 4) + (innerShields * 2) + outerShields
    Let combinedTrade = (selfTrade * 4) + (innerTrade * 2) + outerTrade

    Let fertility = (combinedFood * 3) + (combinedShields * 2) + (combinedTrade)
    Let fertility = fertility / 16

    Round fertility to the nearest integer.

    If the square at x,y is a grassland square without a shield then reduce fertility by one.

    If fertility < 8 then set fertility to 8.
    If fertility > 15 then set fertility to 15.

    return fertility
    }

    General Notes:

    * All calculations are floating point up until the fertility is rounded to the nearest integer.

    * After calculating fertility, mapcopy performs the "ADJUST" operation, which will subtract 8 from the fertility if it is >= 8 and nearby a city. "nearby" means within the nearest 45 square radius of the city. (Think the city radius with another ring added).

    Notes on calculating production:

    Civ 2 seems to start with the values of food, shield and trade production in RULES.TXT and then modify them as follows:

    If a square can be irrigated it gets a (2/3) boost to its food production. (That's the full floating point value 2/3, 1.67 does not seem to work). Note the value of the irrigation bonus does not matter, it can be zero and the production gets a boost for the purposes of fertility.

    If a square can be mined it gets a 0.5 boost to its shield production. Again, the value of the mining bonus does not matter. However, if a square can be both irrigated and mined, the mining bonus does NOT apply. (i.e. irrigation bonus overrides the mining bonus).

    If a square is a grassland square without a shield, its shield production is 0 regardless of what's in RULES.TXT.

    If a square is a grassland square with a shield, its shield production is 1 regardless of what's in RULES.TXT.

    Note that MapCopy does not read any RULES.TXT files, but has the default values from the original Civ2 RULES.TXT hardcoded in.

    Comment


    • #47
      Originally posted by Eivind IV
      @HT:
      As it is now the AI is too stupid to ship colonists to settle different continents. I tried to use goto events, but they only sent over ships, without units in them, so I skipped that.
      Wasn't there a trick someone used to load missile units onto AI subs? Was it Nemo?


      Btw, as they did build ships in New Enland, they didn't in other colonies, did they? I mean, outside North America...
      No, North America was pretty much the only colony that built ships, but that was because of one good reason: Lots of wood. "Iron Wood" to be exact. A very dense, now extinct species of tree that was great for ship hulls. Africa and South America just didn't have good hardwood for ship building.

      Comment


      • #48
        @Test results:
        It may seem I was overly optimistic . I've done a series of tests, trying to tweak my way to get the AI on my side, but the civ2 AI remains a feeble minded ******, almost not fit for life.

        The first thing I did, was trying to duplicate the TRON 'mechanics' into my scen, as they seemed successfull in that scen. He uses no goto events, everything else than Europe is covered, but yet the AI civs understand they must colonize overseas continents.

        So, I made all of Europe grassland, everything else plains, as he did, copied the TRON grassland/plains stats, made all civs expansionist, and ran the test. No results. I tried to limit my galleons to the standard Kobe was using, with 1 units in every transporter. Nothing. I tried to let the Galleons start outside the city ready and loaded, as he did, but still no similar results. Everytime they turned around and used the gallons in and around Europe. They had no urge to explore the unknown terrains of the world. Not even when I tried with goto events.

        And it wasn't so much they didn't want to found new cities either. Everytime a slave was created, they used them to found African cities right away.

        Not even the Portuguese and Habsburg civs, which has knowledge of the new land, bothered to colonize anything. The English as well has knowledge of Newfoudnland, but they too seem more comfortable in Europe.

        My only conclusion is that the giga map may confuse the AI. Because I can't figure why they would colonize in his scen, and not in mine, when all his standars were used.

        @HT:
        I tried making the workers missiles, but this has no effect on the colonizing urge of the AI.

        What exactly is it you want me to use mapcopy for? Forgive my ignorance, I read the quotes you attached, but I don't see what mapcopy has to do with anything here. As far as I know, all mapcopy does is copying a map onto another map of save file, which I have used it for on numerous occations for my scenarios.
        Find my civ2 scenarios here

        Ave Europa, nostra vera Patria!

        Comment


        • #49
          I suspect that your use of MapCopy in this scenario is the cause of the land mass = 0 phenomenon. If I'm right, we never would have rediscovered this shipbuilding restriction had you used mapcopy according to Dusty's recommendations. In my line of work we call this an inspired experiment. Here are some recent quotes from this thread.

          What happened when I imported an unanalyzed map into a scenario using map copy, was that all the body counter numbers were the same, (zero I think).
          Note that if you are copying from a .MP file to a .SAV file, I recommend validating the .MP file before saving it. This will cause the Map Editor to calculate Body Counters for continents. Failure to do so may cause trade routes to behave strangely.
          I haven't used MC in years, and never tried its advanced capabilities. If you really want to master the AI's behavior with settling, you'll need to read up on fertility. Catfish/Wobbegong, Mercator, and Dusty have a very informative thread over on CivFan.

          Harry, isn't there a method in MC to copy only fertility values from one map into another (Yes, I should RTFM, too )? That would get away from a need for hex editing.

          To get the desired AI behavior, I'd recommend using some of those TRON mechanics on a map with heavily tweaked terrain/fertility values.

          Eivind, in your experiment, did the target continents targeted for settling have a land mass >0?
          El Aurens v2 Beta!

          Comment


          • #50
            Originally posted by Boco
            If I'm right, we never would ave rediscovered this shipbuilding restriction had you used mapcopy according to Dusty's recommendations.
            Heh, isn't many of the great inventions made by accident?

            I may have been sloppy reading his reddommendations. I somtimes get to eager and go ahead with a project without looking at instructions. Many o' times have I went ahead with IKEA projects, only to realise I should have done it step by step as suggested...

            Originally posted by Boco
            Eivind, in your experiment, did the target continents targeted for settling have a land mass >0?
            Um, yeah, and that may explain why they didn't want to go, right? As I asked you above, how do you get it back to 1 or whatever is most desired? Is it so that higher the number, the higher the likeability they would go to those squares?
            Find my civ2 scenarios here

            Ave Europa, nostra vera Patria!

            Comment


            • #51
              Yep, my most useful results have been derived from such inspired experimentation.

              To get AI-friendly land mass numbers, hex the map or import a map validated/analyzed by MC into the scenario.

              The number just needs to be different from 0 or that of any ocean. The magnitude makes no obvious difference as long as it's legal (<63).
              El Aurens v2 Beta!

              Comment


              • #52
                "Custom maps the AI can function on", a very useful CivFan thread that discusses land mass number and fertility.
                El Aurens v2 Beta!

                Comment


                • #53
                  Originally posted by Wobbegong, Jan 29, 2005, 09:05 PM

                  1. Open up your saved game in Civ2's Map Editor.
                  2. For all those grassland/plains tiles on which you don't want the AI to build, replace them with a zero-fertility terrain type. For any remaining tiles on which you do want the AI to build, do the reverse.
                  3. When you're done editing the map, save it.
                  4. Start a new normal game with this new map. Pick Romans. Civ2 will set new fertility values. Don't build. Save the game as NewFert.sav.
                  5. Type the following command line for MapCopy:
                  Code:
                  mapcopy NewFert.sav Scenario.sav –s –t –bc
                  This will copy the fertility data only, using the ADJUST option (by default) to lower the values of tiles which fall within city radii.
                  6. Done.
                  El Aurens v2 Beta!

                  Comment


                  • #54
                    Yep, sounds familiar

                    Comment


                    • #55
                      Eivind, if the AI is such a wimp in this scen, are you interested in having some map modifications made directly to the SAV file for this scenario? It wouldn't be difficult for me to hex terrain, land mass, and fertility values. Either route would work: MapCopy or hex-editing.
                      El Aurens v2 Beta!

                      Comment


                      • #56
                        In my Imperial Ambition scenario, the AI refused to colonize the Americas despite them being largely empty and fertile. There weren't all that many cities alreayd on the map, so this perplexed me muchly. I wonder if the problems stemmed from me not running the Analyze Map command before starting the scenario, and I should perhaps try updating it. :P
                        Blog | Civ2 Scenario League | leo.petr at gmail.com

                        Comment


                        • #57
                          I greatly apreciate your help here, Boco and HT!

                          Anything that may improve the AI, I'm interested in, so yes to the save file for the scen. I'm not sure if you just volounteed or you suggested I should do it. Either works for me, but if you ment the latter, I could need some pointers.
                          Find my civ2 scenarios here

                          Ave Europa, nostra vera Patria!

                          Comment


                          • #58
                            Conditional volunteering.

                            Probably should do this hush-hush so you don't give away AI strategy. PM/email me coordinates of squares where you would like the AI to settle, along with your current SAV. In return, I'll jack up the fertility in those squares and renumber continents. If there are squares where you don't want the AI to go, list them, and I'll keep their land mass at 0.

                            It's an easy thing to check, St. Leo. Any need for Russian cities? I know of a great site for inspiration!
                            El Aurens v2 Beta!

                            Comment


                            • #59
                              Great! But in fear of a future misunderstanding, I'll just ask now: Can't you just add this fertility and land mass number to all squares with the plains terrain? Because as it is now, I made all of Europe Grassland and everything beyond plains.
                              Find my civ2 scenarios here

                              Ave Europa, nostra vera Patria!

                              Comment


                              • #60
                                As far as I remember you cannot change just the plains terrain on a map using mapcopy. You can only change the tiles in the grid in reference to the map being copied.

                                Comment

                                Working...
                                X