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

[BtS] World Piece Mapscript Only

Discussion in 'Civ4 - Map Scripts' started by Seven05, Jan 31, 2008.

  1. Seven05

    Seven05 Warmonger

    Joined:
    Dec 5, 2005
    Messages:
    2,056
    Gender:
    Male
    Location:
    USA
    Ok, that may not make a whole lot of sense for a subject :)

    This is the map script used in my World Piece mod without the custom terrains so it will work for standard BtS games or with other mods, it should also work with Warlords but I'm not sure whether or not it will work with vanila Civ4.

    The majority of the code used to create this script is from cephalo's PerfectWorld.py map script, so he deserves the majority of the credit, I just tweaked it to work better with my mod and then I had some requests to post a version that would work without my custom terrains. Additionally, full credit for the 'Earth Like' continents option goes to GRM7584's Earth2.py map script.

    How it works:
    The biggest difference, thanks to the PerfectWorld script is that the world is created as a heightmap first, the heightmap is then modified by plate tectonics to build the continents and mountains and finally used to generate the appropriat plot types. The climate is simulated using rainfall and wind data appropriate for the surface of the world and then used to place the terrain types and features.

    My changes focus on a few specific aspects of the map generator making it produce substantially different results than you will see with PerfectWorld.py. Once the heightmap is generated I apply an overlay using standard fractal layers to encourage continent distribution. In the case of the earth-like option the layering has a very strong effect to ensure that the continents are recognizable, in all other instances the layers is much more subtle. This means that while specific continents are encouraged they aren't forced, this can result in some extremely random worlds. After the layers have been applied, if new worlds are allowed and pangaea type continents are suppressed the map script will generate two random oceanic trenches that will start evenly spaced. This will almost always ensure that there is enough separation between continents to prevent travel by land or galley. Additionally, there will be no land in direct contact with the top or bottom map edges (but it may be very close), land in the polar regions will have a tendancy to be more broken up and arid regions will have a tendancy to contain fewer hills and peaks.

    The intention is to generate interesting continent shapes that are far less predictable (except in the case of earth-like continents) than they are on standard maps and to make various 'new world' areas (if enabled) without forcing specific new world rules by hemisphere like the terra script does. I also really like the presense of 'tactical' mountain ranges instead of scattered peaks as well as the realistic island chains and find the pangaea's created with this script to be much more interesting than those generate by the standard script.

    This mapscript will not be updated specifically however I will keep it up to date with any changes implemented in the 'official' World Piece map script used in my mod. I will keep an eye on this thread though so feel free to post comments, requests or bug reports (Kudos are best sent to cephalo as I really didn't do that much to his script all things considered). Unfortunately, the biggest advantage of this mapscript is the custom terrains which will not be enjoyed without using the full mod, however the worlds created can still be quite good.

    There are two files available:

    World_Piece_Vanila.zip is the map script, put it in your PublicMaps folder (mod or custom assets).

    World_Piece_OptionText.zip is the xml containing the text for the option pull-downs in the map script, it isn't required but its quite annoying without it. Extract this single xml file into your assets/xml/text folder (mod or custom assets), it will not overwrite any other files and contains only the text data so it's harmless.
     

    Attached Files:

  2. Seven05

    Seven05 Warmonger

    Joined:
    Dec 5, 2005
    Messages:
    2,056
    Gender:
    Male
    Location:
    USA
    Screenshots:
    Here's three quick screenshots. The first two are using the natural continents and suppressed pangaeas (second is using the tropical setting) and the third is using the pangaea continent preference.
     

    Attached Files:

  3. avain

    avain (key)

    Joined:
    Jul 29, 2006
    Messages:
    2,770
    Location:
    Budapest, EU
    Hi Seven05,
    I like this script very much.

    One question though:
    What do you think about the amount of desert on default setting (i.e. not tropical)?
    It might be realistic, but just a bit much for my taste(?)
    I confess I didn't play around with it too much, so I'd like to hear your opinion!
    Thanks!
     
  4. Seven05

    Seven05 Warmonger

    Joined:
    Dec 5, 2005
    Messages:
    2,056
    Gender:
    Male
    Location:
    USA
    It tends to be a bit heavy on the deserts :)

    My mod compensates for that by using the various desert terrain types for important resources and by giving civs that start in deserts a small bonus to make deserts feel like less of a hinderance. Since I didn't change any of the values it's probably a bit excessive for standard games. The good news is that it can be adjusted to your heart's content... here's how:

    Open the map script with your favorit text editor, notepad/wordpad work fine. Near the top you'll see several tuning variables, the important ones are:
    Code:
    #How many map squares will be below desert rainfall threshold. In this case,
    #rain levels close to zero are very likely to be desert, while rain levels close
    #to the desert threshold will more likely be plains.
    DesertPercent = 0.075
    
    #How many map squares will be below plains rainfall threshold. Rain levels close
    #to the desert threshold are likely to be plains, while those close to the plains
    #threshold are likely to be grassland. Any rain above plains threshold will be
    #grassland.
    PlainsPercent = 0.13
    Changing the DesertPercent to something like 0.05 will have a significant impact. I recommend leaving the PlainsPercent at least at 2-3x the DesertPercent value.

    Also, a bit further down you have JungleTemp, if you decrease the DesertPercent you may want to increase the JungleTemp to something closer to 0.70 (or even slightly higher) so the entire world doesn't turn into a massive jungle.

    Cephalo did a good job commenting on what the variables do so there is quite a bit you can do to adjust the output more to your liking just by playing around with those variables near the begining of the script.
     
  5. avain

    avain (key)

    Joined:
    Jul 29, 2006
    Messages:
    2,770
    Location:
    Budapest, EU
    Excellent, thank you! I'm off to experiment! ;)
     
  6. Harrier

    Harrier Chieftain

    Joined:
    Feb 19, 2002
    Messages:
    2,345
    Location:
    UK
    Thanks for the info - I also do not like to much desert.

    Tried the above settings on a standard map size and generated four new maps. None had Oasis or Flood Plains in Desert areas. The original unaltered script does produce them. Any ideas on what other values need tweeking.

    Greatfull for any advice. :)
     
  7. Seven05

    Seven05 Warmonger

    Joined:
    Dec 5, 2005
    Messages:
    2,056
    Gender:
    Male
    Location:
    USA
    You know... that may be a side effect of my climate based terrains. I have a warm and temperate version of deserts and don't allow oasis to be created on temperate deserts, floodplains should always be allowed though are you sure you didn't change the floodplain threshold? :)
     
  8. Harrier

    Harrier Chieftain

    Joined:
    Feb 19, 2002
    Messages:
    2,345
    Location:
    UK
    I just changed the three variables you mentioned.

    Desert percent, Plains percent and Jungle temp.

    It was because I started next to a desert I noticed the missing oasis and floodplains, I must admit it was a long way into the game. (also I forgot to mention in first post: no rivers in desert areas - sorry:eek: ).

    I built a city near a lot of desert resources (spices) - but due to low food output, I could not put citizens on them to aid the city growth.

    I then looked in WB and checked the entire map, no oasis or floodplains (or rivers).

    Generated a couple more maps - with same effect.

    I reset the three variables back to the original settings, tried again and they were back again.
     
  9. Harrier

    Harrier Chieftain

    Joined:
    Feb 19, 2002
    Messages:
    2,345
    Location:
    UK
    Not being a geoligist based person my self, what parts of the map would you consider to be warm or temperate?

    I can check if you want me to, but from memory (I have not played for a couple of days) - the desert I am refering to, is in the bottom half of the map. Probably about where the Sahara would be if it was an earth map, or lower. (looking at it North to South.) It is of course a randomly generated map, not an earth map.
     
  10. Chuggi

    Chuggi Espada

    Joined:
    Jan 2, 2007
    Messages:
    2,369
    Location:
    Australia
    Very cool! :) I'm going to include this in the graphical only version of Cultural Diversity... are the original mapscripts still playable with this installed? Also I haven't forgotten about the terrains and features I still have to make for this script. ;)
     
  11. Seven05

    Seven05 Warmonger

    Joined:
    Dec 5, 2005
    Messages:
    2,056
    Gender:
    Male
    Location:
    USA
    Ah, no floodplains because there were no rivers, now that makes sense :)

    This can happen frequently when you reduce the amount of desert because the rivers are generated from a rainfall map. Lowering the threshold is like saying, "ok we'll only have desers in areas that have less than 1" of rain per year" and that means that the desert areas that normally have rivers are no longer deserts, the reamining deserts ore the really, really, really dry areas.

    From the script's perspective anything at or above the jungle temp is 'warm' and anything below the 'forest' temp is cool. Everything that's left is temperate. Since the temperature of a tile is based on latitude, altitude and the wind & rain data for the area it's a little harder to predict exactly which areas will be temperate. As a general rule, closer to the equater will normally be a higher temperature, jungles will never be temperate and you can see the temperat->cool transition since the trees switch to evergreens.

    You can try to force in some extra oasis, there's a variable for that near the begining of the script as well. It makes sense to increase the chance if you decrease the amount of desert, but it depends on what you want as an effect from the deserts, I like the fact that they are generally useless except for resources so a bunch of rivers, floodplains and oasis in them defeat their purpose (for me).

    This one can just drop right into the public maps folder and run it. I've used it for vanilla games and Fall From Heaven without any issues. The only thing to watch for is a python issue, if you have a map script named 'random.py' you have to delete it or rename it since it interferes with the python libraries that Perfect World (and thus my script) rely on.
     
  12. modifieda4

    modifieda4 Chief Time Waster

    Joined:
    Sep 3, 2006
    Messages:
    385
    Location:
    Gold Coast
    just an fyi, for whatever reason the original Perfect World script seems to generate 'better' maps. I've tried all the types/variables in the world piece script. It seems the rivers are too short, the hill areas too massive and as well the desert areas. I usually try to play standard or large size, no pangeas, no new world. I even altered your script to use some of the default variables values in PW. No dice, lol, it made it worse :)

    Its really odd, I just cant seem to get this script to work right.:(
     
  13. Elenhil

    Elenhil Chieftain

    Joined:
    Jan 19, 2008
    Messages:
    254
    Is there a way of tweaking this script to produce "fatter" or more "solid" continents with less (or shorter and fatter) "tentacles" (I mean various fjords, gulfs, bays and thin peninsulas that make shorelines really crazy)? Because I mostly get maps like thumbnail #2, which is not quite what I want. Thumbnail #1 is much better, but I actually fail to reproduce that kind of "solidness" with the settings mentioned.
     

Share This Page