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

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    Generally, the numbers should be between 0.0 and 1.0. If not, they will usually be normalized, so that your -0.15 will become the new 0.0. Your minimums and maximums will be expanded or clamped to 0 and 1.
     
  2. Opera

    Opera Deity

    Joined:
    Sep 21, 2008
    Messages:
    4,643
    Hmm... I'm using FlavourMod and it still won't let me start in deserts. Could I just remove PW2's function that assign starting plots and just rely on FlavourMod? I think it would fix the issue, wouldn't it?

    And, btw, is there a way to get rid of the normalization of the starts? Well, I guess if I remove PW2 starting plots assignment, it will remove that too.
     
  3. dr_s

    dr_s Prince

    Joined:
    Dec 27, 2006
    Messages:
    536
    It's pretty easy to change it for yourself, just make the changes shown is posts 307 or 308 of this thread.
     
  4. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    I think FlavourMod only swaps starts that are already selected. It won't actually place it's own. Since PW usually doesn't place anyone in the desert, there will not be an available place for the Malakim.

    You can redo the starting plot selection, but be aware that finding somewhat fair starts was the very most difficult task in the PW script. The default routine will give rediculously unfair results on this map. If you just want to get rid of the normalization, I think theres a function called boostStartingPlotValue that you can comment out, but again that's where alot of the fairness comes from as well.
     
  5. [to_xp]Gekko

    [to_xp]Gekko QCT junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,942
    Location:
    Seyda Neen, Vvardenfell
    aside from swapping starts, Flavourmod will also "hijack" the normalization routine ( for example, it deactivates RemoveBadTerrain, RemoveBadFeature, AddGoodTerrain... you get the picture ) . it does so with the VANILLA normalization routine though, so I'm not sure how it will behave with perfectworld's...
     
  6. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    Yeah in PW all of those are disabled and I use my own routines. I would be surprised though if Seven05 didn't handle these issue in Erebus Continent. He puts Malakim in the desert right?
     
  7. [to_xp]Gekko

    [to_xp]Gekko QCT junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,942
    Location:
    Seyda Neen, Vvardenfell
    he definitely does.

    Opera, you could try asking Seven05 in his Erebus Continent thread in the FFH modmods and maps subforum. a FFH-optimized version of PW would be pretty sweet :D
     
  8. Pindrus

    Pindrus Warlord

    Joined:
    Nov 18, 2008
    Messages:
    224
    Location:
    Midwest, USA
    I just want to throw my hat in the ring of praise for PerfectWorld. I just discovered it and it adds great variety and flavor to the game.

    :hatsoff:

    After reading this thread I will probably go back and try tweaking the BonusBonus variable. There are definitely more food-poor city sites than most standard map scripts, though I'm not convinced this is necessarily a bad thing. I sort of imagine small bands of people merely surviving in mediocre terrains until technology unlocks the secrets of nature (+1:food: from farms, windmills, watermills, +1:food: from watermills/workshops, corporations...) and then their small villages can explode in productivity!

    The disparity in resources does result in "interesting" balance issues, but what would the point of the game be if you didn't have obstacles to overcome?

    This one got me in trouble at work! :lol:
     
  9. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    First, thanks for the compliments!

    Second, pay attention to the food bonuses. If you start with no food bonuses, that means you have a very good starting position relative to other players. If you have alot of food bonuses, that is when you are in for a challenge. There's a system in place here; give it a chance and see how the game develops.
     
  10. Ulysses81

    Ulysses81 Chieftain

    Joined:
    Feb 18, 2007
    Messages:
    36
    First of all thanks for this great Mapscript! I don't use any others any more...

    But there is one thing that really bugs me:
    It seems to be almost impossible to get non-coastal starting locations.
    I tried setting CoastalCityValueBonus down to 1 but then you get lots of AI capitals settled one tile away from the coast, unable to use the seafood that's usually in their BFC.
    Is there any possibility to get land far away from the coast that's not predictably uninhabitable in the beginning of the game? It would be great to have some landlocked civs now and then if the map/continent in question is big enough (i usually play standard/start anywhere/~13 civs).

    Some questions/ideas on how to achieve this:
    -Is there a variable that can be tuned so that the water is carried further inland if the wind goes in the right direction and there are no mountains in the way?
    -Is rainfall only dependent on amount of water in the air or also on terrain height and thus temperature? A part of the water should keep going until it hits a montain range far away from the coast.
    -Do inland lakes participate in climate generation? They could generate a little green zone in the middle of the desert...
    -Is there any way to code the starting locations to be either coastal or at least x tiles inland?

    thanks and hoping for insightful answers
    Ulysses
     
  11. harry_flashman

    harry_flashman Chieftain

    Joined:
    Apr 28, 2009
    Messages:
    99
    Location:
    horseguards, london
    tried this - got a map with all grassland - no ocean no nothing. well other than grassland. weirdly two of the options on the create custom game screen are gone too, the cydrical/torodal one and something else i think.

    I've just copied the perfect world pw file, made one change (0.9 to 0.6 i think) saved, then copied it into my civ4/public maps folder. Am i doing something wrong? tweaked the map sizes a bit earlier in this way and it worked fine.

    anyway ive got bigger problems at the minute. my latest game jsut stopped and froze when hitting enter in the early 1800's. I think i might have buggered it up by trying to run betterai and bug with the new patch. i should stop messing with things i dont understand:cry:
     
  12. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    This should work. Make sure you don't have two copies of perfectworld in directories that civ4 can see.

    Also, in your Civilization4.ini file, set HidePythonExceptions to zero. That way you can see stuff go wrong and get a reason why. Any small typo will cause a map crash, especially in Python. Another thing you can do is check the PythonErr.log file, that should contain the reason for a map crash also.
     
  13. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    It just so happens that coastal terrain also tends to have the most fertile land. I would set that variable to be just over 1, so that in case of a value tie the coast will win.

    As far as the other stuff goes. There may be some obscure variables that can help with that stuff but it's been a long time since I looked at that code and it's very complicated. Terrain height cools the air and pulls moisture from it to the ground. This makes the air dryer, so when it moves it will contribute less rain.

    Inland lakes do not currently effect the climate. They have to be calculated after rivers, which depend on the climate, so there would have to be a second pass to determine the climate changes, which would change the rivers and then... Uh oh! :D
     
  14. Pindrus

    Pindrus Warlord

    Joined:
    Nov 18, 2008
    Messages:
    224
    Location:
    Midwest, USA
    In my most recent game my own start was fine (Settler was originally 1W of the corn), but those of the Russians and Germans were very poor, allowing the Dutch, who are between them, to grow quite large.

    I hear what you say about grassland as a base terrain compensating, but it puts the game on a fairly different pace than the whip-heavy course most standard games take. Usually when I'm dot-mapping my initial expansion phase most cities have 1-2+ food resources accessible with ancient-era technology.

    Pic's in the spoiler. This map was generated with your "stock" script, the most updated version.

    Spoiler :

    My Ottoman Empire. Food is a bit scarce, with at most 1 food resource in all non-capitol cities. I don't think spices count, and plains cow barely does.




    The Germans have only 1 corn and a couple cows in some outlying cities, and without even much grassland nearby.




    The Russians are pretty screwed here. Moscow is on some nice river-grasslands, but has no resources in its BFC. In their entire empire there are only 2.5 pre-calendar food resources.


     
  15. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    I'm thinking that these are the rules from the XML. There are some changes to how I implemented this from the default routines, but my priority was to respect the spirit of the rules. Grain bonuses are supposed to be a minimum of 5 tiles away from any other grain bonus. Same for livestock.

    Bonus placement is the only starting plot fairness balancer on this map, because I don't like to just place terrain without regard the climate system. One reason that some capitals don't have bonuses is because if they did, it would be that much harder to balance the starting locations. Your Moscow example is really a great starting location on PW. Another pretty big difference is that some bonuses are supposed to be on only one continent, and my starting plot sweetener respects that rule, while the default one does not! So on this map you won't see cows and pigs in the same continent and you probably see that alot on the factory maps.

    After all that said however, I may have to reexamine my bonus placer. I'm a little surprised there were no food resource for Berlin. I wonder if my start plot sweetener respects the spacing rules, which really it should not.
     
  16. [to_xp]Gekko

    [to_xp]Gekko QCT junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,942
    Location:
    Seyda Neen, Vvardenfell
    look at this little tile of tundra in the middle of a huge desert. looks pretty ugly :D I had not seen any cold terrain in the middle of deserts in a while, since 2.01 I guess. weird how this could happen with the new rules to handle tundra/ice next to deserts ... :confused:
     
  17. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    That looks more like Creation(Erebus). Is this really PW2? You are correct, there is a routine that should change the surrounding tiles to plains.
     
  18. [to_xp]Gekko

    [to_xp]Gekko QCT junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,942
    Location:
    Seyda Neen, Vvardenfell
    yeah, it's FFH but the mapscript is definitely PW 2.03, I hardly ever play on any other mapscript now tbh. :D it's just that there's a VERY long vertical mountain chain just left of that huge desert, which blocks all the wind and rain from coming in I guess.
     
  19. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    One possibility is that this tundra was once a peak that was removed for some reason. PW doesn't always pay close attention to the terrain under peaks. I wonder if FfH has some reason to remove troublesome peaks.
     
  20. [to_xp]Gekko

    [to_xp]Gekko QCT junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,942
    Location:
    Seyda Neen, Vvardenfell
    I don't think so, since I'm not using flavourmod or anything that could modify the map after it is created, and that peak doesn't look troublesome anyway... would attaching a savegame be useful?
     

Share This Page