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

    NwabudikeMorgan CEO

    Joined:
    Sep 8, 2007
    Messages:
    375
    Location:
    Canada
    As to the Goody huts The file is ArtDefines_Improvements.xml
    change:
    <fScale>1.0</fScale>
    to a larger number
     
  2. Bad Player

    Bad Player Deity

    Joined:
    Oct 31, 2005
    Messages:
    3,531
    Location:
    (Bris)Vegas!
    thx for the link! :)
     
  3. SlightlyMad

    SlightlyMad Prince

    Joined:
    Sep 26, 2007
    Messages:
    476
    Location:
    Baltimore, MD
    Didn't there used to be a tunable variable to reduce the floodplain threshold? I love the massive deserts, but they have a tendency to have huge rivers running through them, making for way too many floodplains.
     
  4. Jabarto

    Jabarto Emperor

    Joined:
    May 15, 2007
    Messages:
    1,025
    Location:
    Colorado, U.S.
    Hey, is it possible ot add new terrains to this script? I'm trying to make it work (fully; it wlaready works with no tweaking, just that some new terrains won't generate) with Rise of Mankind (which adds marshes and storms) but I have no idea where to start.

    Also, is there any way to disable the grouping of resources by continent?
     
  5. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    How are storms a terrain, exactly?
     
  6. Jabarto

    Jabarto Emperor

    Joined:
    May 15, 2007
    Messages:
    1,025
    Location:
    Colorado, U.S.
    Well, they're actually a terrain feature like forests.
     
  7. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    Well, I don't know about you, but I've never heard of any storm staying in a single place for 30 years (1 early game turn). How can you possibly make weather work with the way turns are set up?
     
  8. Blondel58

    Blondel58 Chieftain

    Joined:
    Jan 26, 2009
    Messages:
    72
    Location:
    Klosterneuburg
    Neither do earthquakes or volcanic eruptions. I guess, it might be an incident which happens once during these 30 years. Remember Katrina in New Orleans.
     
  9. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    Oh, right, right, I see how it works. Tiles from which disasters spawn and zones surrounding the tile in which everything is at risk.

    For hurricanes, you create tiles in the middle of the ocean from where full-fledged hurricanes tend to spawn, and any city within range of this ocean tile is at risk. Earthquakes would also appear around faults, and volcanoes could appear on mountains.

    But I think storm features should be invisible until a disaster occurs from one (the people of Pompeii didn't know they were near a volcano until it erupted). Maybe reveal all storm features when an appropriate tech is researched, which also allows reduced damage from disasters.
     
  10. achilleszero

    achilleszero Emperor

    Joined:
    Jun 19, 2006
    Messages:
    1,426
    Location:
    Biloxi, MS USA
    Cephalo: Perfect World has instantly become my favorite map script. Probably the best map script out there. It has elevated my enjoyment of civ several times over. It is really is just about perfect, except for one thing that almost negates my gained enjoyment(for me at least). The resource placement.

    I thought the way resources were split up was a great idea at first. New level of strategy, encouraging/demanding cunning trade from player and AI. However the more I played it the more I disliked it. Even playing on large maps there is never enough resources for 3/4 of the civs. Large islands will get say all the dye, maybe like 6, when there are 10 civs. Even the resources that are assigned to large continents, are too few in number. Without being available on multiple landmasses every resource gets shafted. This inturn severly stifles growth. It encourages trade but forces everyone to small cities and poor health. This feature is one of those things that is a great idea but in practice it makes the game unfun (kinda like how firaxis took out unfun but great concepts of pollution and dissappearing resources). Any civ not near or not one of the first to contact a landmass that holds a particular resource is just screwed. AI is stingy and even if they hate a civ they were trading the resource first to, they may never break the deal. Also AI cant plan like a human and realize it may never gain a certain resource so it needs to attack to do so. So it cripple's AI even more.

    Is there anyway I can disable this and go back to normal resource placement

    30 Years seems about right, especially if you live where I do. Katrina destroyed my city and 30 som odd years ago was destroyed by the other most powerful hurricane in human history, Camille. What are the odds?!?
     
  11. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    Well, keep in mind that my resource placement mostly tries to copy the normal code, so it is in fact normal placement in this regard. The reason you don't see it turn out that way on the factory maps is the wildly random fractal terrain generation that several factory maps are based on actually breaks this functionality.

    The fact that the AI is so stingy with trading is a valid argument for changing this behavior, but most of my efforts were based on preserving the intention of the original code. All I really wanted to change was to prevent forests from blocking resources. I played this map quite a few times and I do like the difficulty in obtaining self sufficiency, so I didn't see a need to change it. It's alot of work after all! Whether it slows growth, or what the growth speed ought to be is kinda subjective.

    As far as the amount of resources present, the default settings are supposed to place the amount specified in the XML along some random factors that are also in the XML. However, in the latest version of PW2, there is a variable called 'BonusBonus' that you can change to increase the amount of bonuses. Values higher than 1.0 will increase the amount that will try to be placed, so a value of 2.0 would about double the amount of resources, but it's not an exact process.
     
  12. dr_s

    dr_s Prince

    Joined:
    Dec 27, 2006
    Messages:
    536
    @achilleszero, cephalo can correct me on this, but there's a variable in the script called areasPerBonus that I think determines how many different areas a bonus can appear in. In the default PerfectWorld script this is set to 1. I changed it to:

    areasPerBonus = 1 + PRand.randint(0,1)

    which makes it either 1 or 2 with a 50% probability. My experience is that this makes the bonuses more widespread. You might try playing around with that value.
     
  13. achilleszero

    achilleszero Emperor

    Joined:
    Jun 19, 2006
    Messages:
    1,426
    Location:
    Biloxi, MS USA
    Yeah I was afraid it would require massive work to change and/or ruin aesthetics of the maps. Maybe also I have an older version of PW. The aspect of resources in PW that irks me is so many resources being assigned to only 1 continent (pangea maps are boring).

    Thanks for tip. Will try out your suggestion now.
     
  14. coffee junkie

    coffee junkie Tech Hippie

    Joined:
    Dec 16, 2006
    Messages:
    446
    Location:
    Europe
    Thank you for this Cephalo. Indeed :)
     
  15. ayronis

    ayronis Chieftain

    Joined:
    Aug 1, 2007
    Messages:
    9
    Location:
    San Jose, CA
    I would just like to reiterate what the above gentleman has said. This mapscript is fantastic, and it has significantly prolonged the enjoyment of my favorite game even further. It does everything I want in a mapscript. Every game is fresh. Every game is fun. Thank you Cephalo.
     
  16. wanderer07

    wanderer07 Chieftain

    Joined:
    Apr 26, 2009
    Messages:
    1
    This might be a dumb question, but is there any way for the script to guarantee 3 or 4 continents? I don't like how it always seems to create 2 gigantic ones instead. Otherwise I love it, I hate how the retail maps just randomly place deserts and hills everywhere.
     
  17. Romaq

    Romaq Chieftain

    Joined:
    Feb 4, 2009
    Messages:
    10
    Would it be feasible to add a variable into the code that simply doubles all map sizes? It looks like you are starting with the 'largest allowed' map, and then shrinking down the results to fit the actual map size requested. My notion for the change would be to add a 'Supersize' flag in the code, that if set 'true' will simply double all map sizes across the board. And, of course, the obligatory warning in the code, "Setting this 'true' may cause the game to behave erratic or to crash on PCs with insufficient memory, or may cause game play to be so slow as to be unplayable." With that warning out of the way, and buried in the code, people who just straight run the script will not see anything unusual.

    Based upon feedback and if this suggestion proves workable, perhaps the 'supersize' flag can be offered as a menu option at a later time.

    Is this a mod that can be done 'cheaply'?

    --Romaq
     
  18. Beornhard

    Beornhard Chieftain

    Joined:
    May 16, 2009
    Messages:
    55
    If I want to use this with TBS, I need to put the file in Civ4/Beyond the Sword/PublicMaps, right? Or it also works if I put it in Civ4/PMs?
     
  19. Romaq

    Romaq Chieftain

    Joined:
    Feb 4, 2009
    Messages:
    10
    I'm making the attempt by just doubling the map size factors in hmWidth=288, hmHeight=193, then doubling all of the grid_sizes values. The problem with doing things this way, of course, is that even a 'dual' has to calculate the entire "OH MY GOD IT'S SO HUGE" doubled map, then 'shrink' the result to suit what grid size is selected. Unless you have a big, fast machine, I think most people would find just creating the map somewhere between unlikely and impossible, even for the 'dual' size.

    But I'm willing to wait for results, you only calculate the map once. THEN the problem becomes the natural length between turns as you get way up in advanced. But that's a different issue that strikes no matter what. And it also comes down to finding the sweet spot between 'bigger than normal huge', but smaller than 'my computer just caught on fire'. And that's why I think such a 'feature' would have to be a toggle within the code for those bold and daring enough to see if software *can* cause a CPU to melt. :)

    EDIT: It works up to the point of loading the world in, dropping starters on the map and allowing me to go into World Builder. I'm going to hack a few other things together, then start a game to see how playable it is.

    EDIT2: On thinking about this, a better approach would be to make a value scale. The first part is to make the behavior of self.hmWidth and self.hmHeight consistent. That is, their values should be Width = 144 and Height = 96, according to the current script. The '+1' to self.hmHeight for wrapping should be added in the 'wrap options' code. This leaves us the following table of values:

    ------ Width x Height
    Overall 96 x 144
    Duel 12 x 8
    Tiny 16 x 10
    Small 22 x 14
    Standard 26 x 16
    Large 32 x 20
    Huge 36 x 24

    All I did was double all the numbers, which is great for *me*, but will punish anyone who wants a bigger map, but not THAT much larger. The smallest consistent value for 'Duel' is 6 x 4. We multiple * 2 to get the original values, so a 'standard factor' is the value 2. The factor I used is value 4. A factor of 3 will be just fine for someone who wants 'larger, but not that much larger', and a factor of 5 or higher is simple enough for those who can afford a Sun Blackbox to run Civ4 on. :)

    A total rework of the scripts might allow 'x' and 'y' to be arbitrarily set, and the python need only calculate based upon the requested map size and aspect ratio, rather than calculate the largest allowed map and then scaling it down to fit the requested alloted sizes. One of the problems with my hack to the code is that even if I do not want a 'huge' map, I only want one 'small' which is slightly larger than the standard 'huge', the full-size map has to be calculated anyway.

    I hope this helps, and I look forward to seeing the responses.
     
  20. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    It might be possible to do that, but it would be very difficult to preserve the natural looking coastlines. I don't currently know how that would be accomplished with this type of map. I think that Smart map can do this, but it uses a different genration method.
     

Share This Page