1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

[Map Script] LandMasses

Discussion in 'Civ4 - Map Scripts' started by Thedrin, Mar 24, 2007.

  1. Thedrin

    Thedrin Chieftain

    Joined:
    Jan 24, 2002
    Messages:
    2,649
    Location:
    London
    Thanks for the praise that the script is getting. I appreciate it.

    I might be misinterpreting you so feel free to ask again.

    All of CivIV's map scripts are python scripts so you don't need to install python to your machine to make use of this script. You can generate a LandMasses map in exactly the same way as you would generate a map from the custom game set up menu ... unless you're using BtS in which case there seems to be some as yet undetermined problem but there's a workaround documented in my previous post in this thread.

    Python is only neccessary if you want greater customisation over the placement of resources - see the notes on options 30-36 in the readme.
     
  2. jpinard

    jpinard Martian

    Joined:
    Jan 18, 2002
    Messages:
    760
    Location:
    Enceladus, Saturn
    Got it. I'd been confused intitisally as I'd just skimmed the thread. Thanks :)
     
  3. Maestro_Innit

    Maestro_Innit Chieftain

    Joined:
    Jan 6, 2006
    Messages:
    151
    Location:
    Derby, England
    Can't wait until the BTS version is fixed.... bleedin' Fractals for now :rolleyes:
     
  4. jpinard

    jpinard Martian

    Joined:
    Jan 18, 2002
    Messages:
    760
    Location:
    Enceladus, Saturn
    I'm starting to understand this a bit more. I have one more question. Based on my settings listed - what do I need to change to have 3 curvy landmasses instead of just 2 main continents? When I set it to 3 landmasses/1 continent per landmass - it just makes 3 triangels equidistant to each other.

    These settings make the below map.




     
  5. Thrasybulus

    Thrasybulus Chieftain

    Joined:
    Jul 20, 2007
    Messages:
    29
    Location:
    Delphi
    I would try 3 landmasses with a minimum of 9 continents and a max of 20 (or whatever is the largest it will allow). Changing to randomly distributed continents should allow for the possibility of some variation in the size and shape of your land masses. Personally I would put some variation in the land mass buffer and ocean percentage - say 6 to 10 for the first and 50% to 70% for the second.

    Beware that at this map size and ocean percentage you are going to get a huge amount of habitable land and hence a large number of cities, units, etc and your performance may suffer in the late game.
     
  6. Thedrin

    Thedrin Chieftain

    Joined:
    Jan 24, 2002
    Messages:
    2,649
    Location:
    London
    I'm not certain on the meaning of curvy so this is something of a guess. If you could post a screen shot of a 3 land mass map that you generated along with the settings and describe how you would prefer it to be different that might aloow me to be more helpful.

    I'd agree that to get greater variation in landmass shape you'll want to increase the number of continents to between 9 and 20. Alternatively you could try between 6 and 9 continents and set Continent Placement to more snaky land masses.

    If you are looking for a consistent level of coastal ruggedness, it'll probably take a few map generations before you can be certain that you have settings that will regularly produce maps that you like. I can only really give advice on how the different settings will affect the coasts but you'll have to experiment with it yourself.
     
  7. jpinard

    jpinard Martian

    Joined:
    Jan 18, 2002
    Messages:
    760
    Location:
    Enceladus, Saturn
    OK. Sorry for the huge filesize on these, but I wanted it the pics to be clear (and not fuzzy).

    Exciting because I've nearly got it to where I'd like. I've got 3 dissimilar landmasses, and the proportion of ocean is good. So the only things I"m trying to tweak are:


    * If you look at the red arrow. How do I get it so it's not like a giant straight canal... so the 3 landmasses look more like indepentant mega-islands?

    * There's still too much jungle (and a bit too much desert for my taste). Anything else I can change so there is less?

    These settings:




    Produce this map:



    Thanks! :)
     
  8. Thedrin

    Thedrin Chieftain

    Joined:
    Jan 24, 2002
    Messages:
    2,649
    Location:
    London
    1) Tricky. The best bet would be to increase the ocean percentage or decrease the seperation between land masses so that land masses are less constrained and not forced to get as close to each other as possible. I'm not sure that that would work since there seems to be a fairly large ocean (top left) which could have supported more growth. But I would be very confident that making the opposite changes - decreasing ocean percentage or increasing seperation between land masses would increase the affect you are trying to avoid.

    Increasing coastline ruggedness may make the situation worse depending on how you view things. The main bodies of both land masses would certainly run less parallel to each other but the fringe of islands along each coast may well become well defined enough that the canal effect is clearly visible.

    2) You can make an edit to the script to reduce the amount of desert and jungle further. Between lines 2447 and 2497 are the list of options for Terrain, Terrain Homogeneity, and Woodlands, and the values which LandMasses uses for each option.

    Terrain options:

    To determine the amount of desert in a map, LandMasses uses the second value in the selected vector. Less desert currently has a selected value of 16. Try setting that to a smaller figure.

    Woodlands options:

    Here you'll need to alter the first value of a vector. Note that the value increases while the selected amount of jungle decereases. Normal jungle is 80 while less jungle is 100.

    If you don't want to edit the script than you could try altering the Terrain Homogeneity option. Reducing the level of clumping will not decrease the amount of desert but it will reduce the size of each desert; each desert will be smaller but there will be fewer of them.

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

    A couple of points about trying to find the settings that will consistently provide you with a map that you like.

    1) Set map size to duel. This won't affect the size of the map, only factors of gameplay which you won't be making use of if you're just trying to see what each option does. It will alse reduce the number of civs to two. The map will then generate faster (but with less resources).

    2) Set Print Map Details to Yes. The selected options for each map generation should be sent to C:\Program Files\Firaxis Games. The file can be opened with WordPad. It'll tell you precisely what options were used to generate a map. Here you've selected between 3 and 9 tiles as the minimum seperation between land masses. The newly created file will tell you what value was selected to generate the map. It will also tell you not only the selected percentage of ocean (somewhere between 55% and 60% here) but the actual percentage of ocean that was generated.
     
  9. DragonTempest

    DragonTempest Chieftain

    Joined:
    Dec 1, 2002
    Messages:
    61
    Location:
    Lubbock, TX
    forgive me for asking but is it availible for BTS? Everytime I have tried it, it seems to crash at the settings... # of land masses, etc.
     
  10. Thedrin

    Thedrin Chieftain

    Joined:
    Jan 24, 2002
    Messages:
    2,649
    Location:
    London
    This script will generate scripts in BtS but it will crash in the game set up menu after a certain number of options have been selected. The following link is to an earlier post which details ways to greatly reduce the risk of a crash occuring.

    An earlier post in this thread.

    I've a rough idea with why the script isn't compatable with the game set up menu and how to fix it but unfortunately I'm not expecting to complete a working version for a couple of weeks.
     
  11. jpinard

    jpinard Martian

    Joined:
    Jan 18, 2002
    Messages:
    760
    Location:
    Enceladus, Saturn
    Thedrin, thanks for the help. I got some excellent workking maps from this :)
     
  12. jpinard

    jpinard Martian

    Joined:
    Jan 18, 2002
    Messages:
    760
    Location:
    Enceladus, Saturn
    Sorry Thedrin, another question. I think I know the answer already, but I'll ask despite.

    Is there a way I can get a width of 164 (wanted something in between 160 & 168). I looked through the python code and it looks like it uses a formula to come up with the available sizes in the dropdown menu. So I'm guessing I'd have to modify that? Or will that just mess things up too much?

    Or can I just add this ["164",41],

    to all your map size lines (under each entry for ["160",40],





    Also, do these values all have to be whole numbers, or can they be decimals too? I'm thinking 1.5 for the "fewer resource typpes"

    Code:
                    ["Few strategic resources", -1],
                    ["Normal strategic resources", -2],
                    ["Many strategic resources", -3],
                    ["Random", 0],
                    ["1 of each per civilization", -4],
                    ["Custom", -5],
                    ],
            [
                    ["Few health resources", -1],
                    ["Normal health resources", -2],
                    ["Many health resources", -3],
                    ["Random", 0],
                    ["1 of each per civilization", -4],
                    ["Custom", -5],
                    ],
            [
                    ["Few luxury resources", -1],
                    ["Normal luxury resources", -2],
                    ["Many luxury resources", -3],
                    ["Random", 0],
                    ["1 of each per civilization", -4],
                    ["Custom", -5],
                    ],
     
  13. Thedrin

    Thedrin Chieftain

    Joined:
    Jan 24, 2002
    Messages:
    2,649
    Location:
    London
    It shouldn't be too difficult to do. Width is one of the menu options whose range of choices can be altered simply be altering the list of choices. 'Coastlines' or 'Mountain Ranges' on the other hand would require altering various pieces of the code.

    Available choices for each option begin around line 2096. Just add in the following line to the first two sets of choices (which represent the available choices for min. width and max. width);

    To create a new width or height option all you need to do is assign it a name in quotation marks followed by a value four times smaller than the dimension size you want (CivIV maps dimensions are always multiples of 4).
     
  14. jpinard

    jpinard Martian

    Joined:
    Jan 18, 2002
    Messages:
    760
    Location:
    Enceladus, Saturn
    whoops, I edited after you posted. Can you look at the extra question right above you?
     
  15. Thedrin

    Thedrin Chieftain

    Joined:
    Jan 24, 2002
    Messages:
    2,649
    Location:
    London
    I'm afraid those values are just used to tell the script what equation to use to calculate the number of resources and aren't used by any universal equation to calculate the number of resources.

    If the resource quantity is set to few, normal, or many, then the 'normal' quantity will be calculated. Few halfs the value. Many doubles it. The 'normal' number of resources is:

    floor(('No. of players' + 1)/2) + int(floor(rand*('No. of players'/2))

    so that the number of resources is at least floor((No. of civs)/2) and at most (No of civs - 1).

    To alter the number of resources generated you'll need to find the following piece of code which begins around line 1914:

    Code:
    # Determine how much of the resource is to be placed.
    
            if Resource < 9:
                    if StrategicQuantity == -5:
                                    ResourceCount = ResourceQuantities[Resource]
                                    if ResourceCount <= -5:
                                            ResourceCount = -2
                                    elif ResourceCount == -4:
                                            ResourceCount == Players
                                    elif ResourceCount == -1:
                                            ResourceCount = (Players + 1)/2 + dice.get(Players/2, "How many of the resource?")
                                            ResourceCount = ResourceCount/2
                                    elif ResourceCount == -2:
                                            ResourceCount = (Players + 1)/2 + dice.get(Players/2, "How many of the resource?")
                                    elif ResourceCount == -3:
                                            ResourceCount = (Players + 1)/2 + dice.get(Players/2, "How many of the resource?")
                                            ResourceCount = ResourceCount*2
                            elif StrategicQuantity == -4:
                                    ResourceCount = Players
                            [b]elif StrategicQuantity > -4:
                                    ResourceCount = (Players + 1)/2 + dice.get(Players/2, "How many of the resource?")
                                    if StrategicQuantity == -1:
                                            ResourceCount = ResourceCount/2[/b]
                                    elif StrategicQuantity == -3:
                                            ResourceCount = ResourceCount*2
                    elif Resource < 20:
                            if HealthQuantity == -5:
                                    ResourceCount = ResourceQuantities[Resource]
                                    if ResourceCount <= -5:
                                            ResourceCount = -2
                                    elif ResourceCount == -4:
                                            ResourceCount == Players
                                    elif ResourceCount == -1:
                                            ResourceCount = (Players + 1)/2 + dice.get(Players/2, "How many of the resource?")
                                            ResourceCount = ResourceCount/2
                                    elif ResourceCount == -2:
                                            ResourceCount = (Players + 1)/2 + dice.get(Players/2, "How many of the resource?")
                                    elif ResourceCount == -3:
                                            ResourceCount = (Players + 1)/2 + dice.get(Players/2, "How many of the resource?")
                                            ResourceCount = ResourceCount*2
                            elif HealthQuantity == -4:
                                    ResourceCount = Players
                            [b]elif HealthQuantity > -4:
                                    ResourceCount = (Players + 1)/2 + dice.get(Players/2, "How many of the resource?")
                                    if HealthQuantity == -1:
                                            ResourceCount = ResourceCount/2[/b]
                                    elif HealthQuantity == -3:
                                            ResourceCount = ResourceCount*2
                    elif Resource < 32:
                            if LuxuryQuantity == -5:
                                    ResourceCount = ResourceQuantities[Resource]
                                    if ResourceCount <= -5:
                                            ResourceCount = -2
                                    elif ResourceCount == -4:
                                            ResourceCount == Players
                                    elif ResourceCount == -1:
                                            ResourceCount = (Players + 1)/2 + dice.get(Players/2, "How many of the resource?")
                                            ResourceCount = ResourceCount/2
                                    elif ResourceCount == -2:
                                            ResourceCount = (Players + 1)/2 + dice.get(Players/2, "How many of the resource?")
                                    elif ResourceCount == -3:
                                            ResourceCount = (Players + 1)/2 + dice.get(Players/2, "How many of the resource?")
                                            ResourceCount = ResourceCount*2
                            elif LuxuryQuantity == -4:
                                    ResourceCount = Players
                            [b]elif LuxuryQuantity > -4:
                                    ResourceCount = (Players + 1)/2 + dice.get(Players/2, "How many of the resource?")
                                    if LuxuryQuantity == -1:
                                            ResourceCount = ResourceCount/2[/b]
                                    elif LuxuryQuantity == -3:
                                            ResourceCount = ResourceCount*2
    For altering the affects of the few resources options, the important parts are bolded. I guess that if you want the affects of the 'few resources' options to be halved - that the number of resource generated is somewhere between normal and the current settings for few - that you'll want to replace 'ResourceCount/2' with '3*ResourceCount/4'
     
  16. DragonTempest

    DragonTempest Chieftain

    Joined:
    Dec 1, 2002
    Messages:
    61
    Location:
    Lubbock, TX
    Appreciate all your work and sorry for the pressure. This is the best version of the game IMHO ever but the Game still sux when it comes to realistic continents and landmasses. That is why I use your script, cause it is the only one that comes close. If I could help you I would but I hate coding and I wouldnt know were to start LOL. Please keep up the good work, it is very much appreciated.
     
  17. jpinard

    jpinard Martian

    Joined:
    Jan 18, 2002
    Messages:
    760
    Location:
    Enceladus, Saturn
    Thedrin - what about the lines I set in red? Wouldn't I want to change those for the 75% reduction in resources (instead of the half)?

     
  18. jpinard

    jpinard Martian

    Joined:
    Jan 18, 2002
    Messages:
    760
    Location:
    Enceladus, Saturn
    Oops one problem... If I wanted to edit the "fewer resources" code, don't I need to edit the -1 lines and not the -4 lines?
     
  19. Thedrin

    Thedrin Chieftain

    Joined:
    Jan 24, 2002
    Messages:
    2,649
    Location:
    London
    Thanks DragonTempest. Sorry that there won't be any script more suitable to BtS for a while. If you've any other issues with the script's generation at all, let me know.

    The edit would only be applied to the last line of each of the bolded sections (which is the only line I should have bolded);

    Code:
    ResourceCount = ResourceCount/2
    Overall, the bolded section goes;

    If few, normal, or many resources have been selected, calculate a normal amount of resources to be generated. If few resources have been selected, amend the amount of resources to be generated.

    If you select custom from any of the appropriate set up menu options then, yes, you'd want to edit the redded lines. If you don't use the custom options then you won't need to do so (though it wouldn't hurt for completeness).
     
  20. jpinard

    jpinard Martian

    Joined:
    Jan 18, 2002
    Messages:
    760
    Location:
    Enceladus, Saturn
    I'm getting some spectacular maps now. I'm concerned about shorting myself too much, so I just knocked the recource values down to 90%.

    The resources changes I made... that was for the total # of resources on the whole map.... right? I got a little confused when I re-read your relase notes on resources in the fat cross.
     

Share This Page