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. BobTheTerrible

    BobTheTerrible Just Another Bob

    Joined:
    Jan 5, 2003
    Messages:
    927
    Location:
    Middle of Nowhere
    Wow glider, I generated 1 map so far and I'm already impressed (but perhaps I just got really lucky). What exactly did you add? It looks like you gave it a half and half chance to get either 28% or 38% land, but that can't be it.
     
  2. Mknn

    Mknn Prince

    Joined:
    Dec 17, 2007
    Messages:
    337
    Location:
    Houston
    I'll test with BTS and get back to you. The dir is normal, but it is Steam normal, not normal normal. :) The cIV files are buried in Program Files (x86)/Steam/Steamapps/Common/Sid Meir's ...
     
  3. GoodGame

    GoodGame Red, White, & Blue, baby!

    Joined:
    Dec 17, 2004
    Messages:
    13,725
    Just a thought, if there are massive flood plains, shouldn't they have a risk of turning into a swamp/marsh? I realize that'd be a mod, just a realism thought. Seems like I get Northern Africa-like deserts with heavy riverification and very large flood plains betwen the rivers, and if not a lake/oasis, I'd think they'd be at risk for become a marsh, like the Nile Delta region.

    Is there any code in the script for large groupings of floodplains causing underwater reservoirs (forming an oasis, I suspect)?
     
  4. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,855
    Location:
    Where animals hop not run
    Cephalo has done the best job. Love the feel of entering and exiting different "climatic regions". Just needs a little bit of "tweaking" for personal player preferences. If you allow pangaea you have to cut it down the middle for two distinct continents so that "start in the old world" works properly. Since then did a little bit more tweaking for the "allow pangaea" option to get the different regions more to liking (see attached):
    lesson forests creeping all the way to the polar cap for genuine pole,
    decrease a little, the desert in the continent interiors,
    increase a little, the size of the world's big rainforest areas.
    Allow a little bit more for high snowed "mountain" regions to form.

    It's now producing a really nice map virtually every time I think. The one thing I could not do yet is to successfully manipulate the tree factor. It's defaulted at 1.5 but taking it right down doesn't lesson the amount of trees in the globe by anything that I can notice. It's not an issue, because personally I don't mind the heavy tree factor with the maps, but it might not be best for game balance just not sure on that.

    Thanks again Cephalo, what a map script it is.
    Cheers. :goodjob:
     
  5. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    You have to increase the number to lower the amount of trees on the map.
     
  6. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,855
    Location:
    Where animals hop not run
    @Ramesses
    Thanks! What tree factor is good in your humble opinion?
    Cheers.
     
  7. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    I haven't really played with it yet, but I would think 1.6 would be a good number.
     
  8. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,855
    Location:
    Where animals hop not run
    Thanks Ramesses will give it a go. The interesting aspect to this great map script are the trees. At a guess, the amount of trees are probably no different to any other map, it's just that they are more concentrated in the coastal regions it seems. Just got to find a tree factor that doesn't force me to have to get to bronze working tech and chopping, every game. It's early days yet for working this out and am not sure how it plays out over a number of games.
    Cheers.
     
  9. dr_s

    dr_s Prince

    Joined:
    Dec 27, 2006
    Messages:
    536
    I modded the script to add three forest levels to the in-game options, "Heavy" (the current amount), "Moderate" and "Light." I could post it here if you're interested. I did a little bit more that modify the tree factor (I think I used 2.0 and 2.25 for moderate and light). I also added a second factor to set a floor for rainfall below which there would never be trees. I haven't played much using the "Light" setting, but I like the "Moderate" one.
     
  10. BobTheTerrible

    BobTheTerrible Just Another Bob

    Joined:
    Jan 5, 2003
    Messages:
    927
    Location:
    Middle of Nowhere
    Is there anywhere in the map script to modify the amount of resources placed on the map? I'd like to increase it.
     
  11. [to_xp]Gekko

    [to_xp]Gekko QCT junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,943
    Location:
    Seyda Neen, Vvardenfell
    wow glider, thanx for your tweaked version. I'll definitely try it :goodjob:

    I'm just not really sure what you're saying about allow pangeas and start in old world though... I always play PerfectWorld with "Break Pangeas" and "Start Anywhere" : would that cause issues with your tweaked version?
     
  12. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,855
    Location:
    Where animals hop not run
    @Dr S
    Well done on doing the tree mod Dr S.
    That would be great, if nothing more than the chance to experiment around with different tree amounts for the future.

    @Gekko
    I haven't done much at all except to split pangaea down the middle with a supplied variable from Cephalo. A bit of a tweak here and there to other variables, and perfect world makes just the best maps if you keep it on allow pangaea. Actually, Cephalo is scaring me. This type of really coherant map style is probably what will happen with future releases of civ.

    @Bob
    Kinda know what you mean about the apparent drop in resources. Not sure how to tweak it but not sure I want to. It'll depend what happens in the modern age and corporations. Normally maps spread sea resources so abundantly that it throws the corps out late game. However in perfect world I've noticed a more concentrated and localised distribution of resources even fish. Don't know if it's accidental or not, but clustered distribution like this makes for a fun map I think.

    Cheers.
     
  13. [to_xp]Gekko

    [to_xp]Gekko QCT junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,943
    Location:
    Seyda Neen, Vvardenfell
    ok then, I'll keep allow pangea enabled. any issue with setting starting positions to "start anywhere" ? :D
     
  14. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,855
    Location:
    Where animals hop not run
    @Gekko
    No doesn't matter about that. Start anywhere is fine. That option is good too. Will be interested on any thoughts about the density of the coastal forests and any compulsion to have to get to bronze working at double haste.
    Cheers.
     
  15. [to_xp]Gekko

    [to_xp]Gekko QCT junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,943
    Location:
    Seyda Neen, Vvardenfell
    thanx for the fast reply :D I tried generating a couple maps with your version and they look awesome. I do agree that forests and jungles could use some "softening" though, since they make those lands unimprovable for a while. if manipulating the tree factor doesn't give you what you need, you might want to take a look at Seven05's code in his ErebusContinent mapscript ( based on Cephalo's FaireWeather ) , which softens forest/jungle heavy areas and should be basically what you're looking for ;) : http://forums.civfanatics.com/showthread.php?t=308590 trees will spread even in unforested tiles if given enough time though, so you might want to tweak the chance of a new forest or jungle appearing.
     
  16. dr_s

    dr_s Prince

    Joined:
    Dec 27, 2006
    Messages:
    536
    I've attached my modded version. Cephalo, if you don't want this distributed, let me know and I'll take it down.

    The original forest planting code works like this: the amount of rain on each tile is compared to a constant called TreeFactor (really it's compared to another constant multiplied by TreeFactor, but that doesn't matter). If the amount of rain is greater than TreeFactor, then the tile will have jungle or forest depending on the temperature. If the amount of rain is less than TreeFactor, then the tile might have forest (but not jungle), with the chance of forest being proportional to the amount of rain.

    I added two additional constants, ForestModifier and ForestFloor. In my modification, the amount of rain is first compared to ForestModifier * TreeFactor. If the amount of rain is greater than this, then you get jungle or forest just like before. If the amount of rain is less than ForestFloor * ForestModifier * TreeFactor, then you will not get forest or jungle. If the amount of rain is between these two values, then you have a chance of getting forest (but not jungle) just like before.

    There's an in-game option with three levels of forest: Heavy, Moderate, Light. Moderate is the default. The values for these new factors are 1.0 and 0.0 for Heavy (so that Heavy is the same as the current amount of forest), 1.3 and 0.25 for Moderate, and 1.7 and 0.35 for Light.

    If you want to modify things further, TreeFactor is still there; increasing it will decrease forest for all options. Or you can modify the values for ForestModifier and ForestFloor.
     

    Attached Files:

  17. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    Awesome job.
     
  18. sampo

    sampo Chieftain

    Joined:
    May 14, 2008
    Messages:
    23
    Location:
    Finland
    Wow a great script. Congrats! But I am having troubles when I play hotseat multiplayer games with my friends. All grasslands with some rivers. Singleplayer works perfectly.
     
  19. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,855
    Location:
    Where animals hop not run
    @Dr S
    Thanks Doctor S. You have commented your code to distinguish it from Cephalo's that's the most important thing. For the future, a better defacto convention is:
    Dr_S start Forest Level
    your code.....
    Dr_S end
    That way people know where the code slab has started and ended and what it does and signifies the author. Sometimes, instead of the author a mod name is used which can be refered back to the author. Good stuff.
    Cheers.
     
  20. [to_xp]Gekko

    [to_xp]Gekko QCT junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,943
    Location:
    Seyda Neen, Vvardenfell
    dr_s , does your version also include glider's tweaks? it would be great to have a file with both yours and his work in :D
     

Share This Page