1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[Map Script] PerfectWorld2.py

Discussion in 'Civ4 - Map Scripts' started by cephalo, Feb 17, 2009.

  1. Burned

    Burned Chieftain

    Joined:
    Feb 17, 2009
    Messages:
    26
    I'm not sure for strategic ressources [edit : no, it seems to scatter them around the map normally]. But removing the food spacing rules did not reduce the area of the continent where they can be found, it just made them to appear in small and relatively realistic clusters (with some exceptions). And the overall number of ressources did not decrease. On the contrary, it seemed to increase. Except for sea food, which now appear almost only on starting locations. Strange.

    [second edit]Ho. I understand. I used an old file where i duplicated the addbonuses loop.
     
  2. Burned

    Burned Chieftain

    Joined:
    Feb 17, 2009
    Messages:
    26
    Oh, and I just noticed that wheat and cows can be absent of one continent, preventing the script from adding food bonuses to starting locations in large area of plains.
     
  3. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    Yes those resources are designed to actually be on one continent only. Ideally, you would have cows on one continent, pigs on another, and then sheep on yet another. Same for wheat, corn, and rice. It can become a slight problem if there are more than 3 major continents, but I try to alleviate that somewhat by finding islands to place them on, but this is by design to promote trade.

    EDIT: also, this rule is broken by the default starting plot normalization, so that's why you will sometimes see cows and pigs together on one continent on the stock maps. My normalizer respects this rule.
     
  4. dr_s

    dr_s Prince

    Joined:
    Dec 27, 2006
    Messages:
    536
    What happens if you end up with a pangea map, or near-pangea? Will the main landmass have only one of wheat/corn/rice or pigs/cows/sheep, with the rest banished to islands?
     
  5. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    When there's only one or two continents, multiple ones can exist together but what happens is that the one that is placed first will tend to dominate the others by taking up most of the real estate. You'll have like ten cows, 2 sheep, and maybe one pig. In my bonus placement I always have at least one of everything. There's a routine at the end that disregards the rules and places it somewhere.
     
  6. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    Can you add an option to allow elimination of land tiles at the poles? I don't like how you can reach the poles but can't travel through them.

    Also, can you let players choose the land, peak, hill, plain, etc. percentages?
     
  7. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    There are many adjustable variables at the beginning of the script. Most of them are fairly self explanatory, but the one you might be interested in is mc.northMargin or (self.northMargin as it is written). Set northMargin to 'True' and this will prevent land at the north pole. This will greatly limit the amount of tundra however, and if you increase the tundra by raising the tundra temperature, you might end up with an unacceptable amount of tundra on altitude peaks in the warmer climates.

    I like that the land touches the north pole because it mimicks the real world in a way. No northwest or northeast passage.
     
  8. TheLastOne36

    TheLastOne36 Deity

    Joined:
    Jan 17, 2007
    Messages:
    14,045
    well atleast make the option of Toroidal then. It bother's me as well how i can't go past the north poll.
     
  9. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    So I tried to modify your script by adding a third option, to allow the player to choose the land percentage. Now, while I have some programming experience, I have absolutely no knowledge of Python whatsoever. That said, I simply looked at your code and attempted to mimic your syntax.

    As far as I know, there are 5 places which need to be altered to add one option. I added code just a little bit below where the static defines were, and in 4 of the blocks beginning with something like "def getCustomMap..." near the bottom of the script.

    def getNumCustomMapOptions(): Had it return 3, since I added one more option.
    def getCustomMapOptionName(argsList): Named my new option Land Percentage.
    def getNumCustomMapOptionValues(argsList): Added the number of choices for Land Percentage.
    def getCustomMapOptionDescAt(argsList): Listed all choices for Land Percentage.

    Now, when I try to run this script, I get no special choices, and it seems that attempting to build a map by this script freezes the game. So obviously my alterations don't work. Do you think you can take a look at my changes and see if you can get this option working?

    http://www.fileden.com/files/2008/6/8/1950977/PerfectWorld3.zip
     
  10. Burned

    Burned Chieftain

    Joined:
    Feb 17, 2009
    Messages:
    26
    Why don't you use that ?
    Code:
    ##############################################################################
    ## GLOBAL TUNING VARIABLES: Change these to customize the map results
            
            #Percent of land vs. water
            self.landPercent = 0.30


    Cephalo, concerning the repartition of ressources on different continents, could you supress some terrain requirements that prevent pigs from appearing on plains and wheat from appearing on grassplains ?
    On factory maps these limits only add some difference between areas, but on your maps, since the separation between continents works, it is not necessary, and it can create particularily poor climate zones in certain continents. If one continent has pigs, rice and bananas, while the other one has sheep, cows and wheat, the first one's plains will be advantaged against other areas of the continent, and the second one's jungles will have the same kind of advantage against the rest of the continent.
    And maybe, as deer is the only food ressource for toundra areas, and can be found worldwide irl, it would be good also to create an exception for it.
     
  11. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    If I were you, I wouldn't worry about making it an option. Just tune the settings to your taste and use it that way. I really don't like putting alot of in-game options cluttering up the interface. There really is no limit to the various options people want in their maps. I could put 3, or 5, or 50, or 200 and people will still ask for more. It's much more efficient to just teach people to tune the map.

    I may add some more options, but they can't be matters of taste, it has to be something that people would want to change from game to game.
     
  12. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    Sounds to me like rather interesting differences between continents. :)

    These kinds of rules are supposed to be set in the XML. Different mods have differing resources and requirements and it's best if the map script doesn't make assumptions about specific resources. If you want to use tundra, it is very nice to have some deer there, but the XML rules say that it should be only on one continent. I would have set that differently myself. But that's the rules and in most cases it does add interest to the game. The flag in question is the bArea flag in the XML.

    EDIT: also, the code is supposed to pick the best continent for a resource, so deer should be on the continent with the most tundra for example.
     
  13. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    The problem I have with changing the values from the code directly is that it requires me to restart Civ IV every time to see the results. If there were some way, any way at all, to make the options available for change in-game, it would be a lot faster for me to do what I want to do.
     
  14. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    I think that you need, in addition to the functions you mentioned, something for getCustomMapOptionDefault and also isRandomCustomMapOption.
     
  15. GoodGame

    GoodGame Red, White, & Blue, baby!

    Joined:
    Dec 17, 2004
    Messages:
    13,725
    But even central Africa has/had/melting glaciers until this century. :)

    http://en.wikipedia.org/wiki/Mount_Kilimanjaro

    http://news.mongabay.com/2006/0515-agu.html


    It actually validates your code, Cephalo. :)

    EDIT: Maybe the ice hills could be explained as high plateus?
     
  16. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    Having tried 2 games with this script, I must say, it is very good :goodjob:

    Also the build times are greatly exagerated. My old clunker machine builds the map in a couple of minutes, it's a while, but nothing extreme.
     
  17. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,784
    Location:
    Where animals hop not run
    Thanks Cephalo for the hard work you have put into this :great job: The maps are really detailed and subtle. Brilliant. I've included it into RevolutionDCM below if that's ok.
    Cheers.
     
  18. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    no problem.
     
  19. CyberChrist

    CyberChrist You caught my attention

    Joined:
    Dec 6, 2001
    Messages:
    1,424
    Location:
    The Matrix
    Why doesn't this mapscript create any Snow/Ice land areas near the artic circles at all (not even with land touching the edge of map)?
     
  20. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    That doesn't sound right. Do you have a screenshot?
     

Share This Page