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. [to_xp]Gekko

    [to_xp]Gekko QCT junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,943
    Location:
    Seyda Neen, Vvardenfell
    something that would be nice imho is making sure that the northern and southern borders of the map are all ice ( the water, impassable one ) , since seeing land end up in a black "invisible wall" kinda breaks immersion ;) also, it might be nice to make sure that there's some water between the end of the continent and the ice, so that ships can sail there instead of having to take a loooooong detour across half the planet :D
     
  2. CyberChrist

    CyberChrist You caught my attention

    Joined:
    Dec 6, 2001
    Messages:
    1,424
    Location:
    The Matrix
    I fiddled a bit with the various variables (and forcible added a new variable of my own) and I almost go what I want (decent amount of snow/tundra land 'wearing' a small 'Ice on Ocean' hat at northpole), but now I got Ice/Tundra reaching a little too far up from the south. Any suggestion as to which variable I should modify to reduce that (without changing the reach from the north)?
     
  3. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    You can set mc.northMargin to 'True' and it will prevent this behavior. You will have less tundra however. Keep in mind there is no northwest passage in the real world! So you could just look at the problem in a fun way!
     
  4. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    You might be able to play with the lattitude variables and get what you want. Unfortunately, when you do that you might get strange results, I'm not sure that code is doing exactly what I think it does right now.
     
  5. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    I think if you set southWaterBand and southCrop to some positive value x, the extreme south will be simulated beyond the south border, essentially warming up the climate towards the south border by some small amount. I would recommend x=10.

    Code:
    self.northWaterBand = 0
    self.southWaterBand = x
    self.eastWaterBand = 0
    self.westWaterBand = 0
    
    self.northCrop = 0
    self.southCrop = x
    self.eastCrop = 0
    self.westCrop = 0
     
  6. Valynor

    Valynor Chieftain

    Joined:
    Nov 29, 2008
    Messages:
    62
    I played a few games with your script and I liked it a lot.
    Very good work and a nice addiction to a great game.
    Now the issue.

    Since I installed bug 3.6 (I don't know if it's related, but the 2-3 games I played with BUG 3.5 did not have any problems) often the created map is all grassland with only scattered resources; no hills, no forests, no sea. If I regenerate the map, resources change but nothing else do. I have to shutdown CIV and restart it.

    Any idea?
     
  7. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    That's a map crash. If you turn on Python popups in your ini file, you can see what's going on. That's usually a good idea anyway when you use alot of mods. If you have logging turned on, you can also see these errors in PythonErr.log in your logs folder.
     
  8. Valynor

    Valynor Chieftain

    Joined:
    Nov 29, 2008
    Messages:
    62
    Thank you, I enabled python popups and logging.
    Now I wait for another map crush :)
     
  9. TheLastOne36

    TheLastOne36 Deity

    Joined:
    Jan 17, 2007
    Messages:
    14,045
    Agreed. The map needs Torodial. :)
     
  10. [to_xp]Gekko

    [to_xp]Gekko QCT junkie

    Joined:
    Dec 16, 2005
    Messages:
    7,943
    Location:
    Seyda Neen, Vvardenfell
    would there be a way to set mc.northMargin and mc.southMargin to be random instead of true? even better would be to have it random for each continent. :D
     
  11. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    As soon as I have some free time for this I will make a toroidal, cylindrical, and flat option. To do it properly takes a little bit of work.
     
  12. rspeer

    rspeer Spearman

    Joined:
    Apr 5, 2006
    Messages:
    101
    Does anyone else find themselves putting more civs than usual on PerfectWorld maps, to compensate for the sparsity of these maps?

    For example, if I play with 7 civs on a Standard size map, it pretty much ensures that I will not meet anyone for a very long time (except scouts and boats that have traveled a long way). There will be no possibility of early war. So to compensate, I put 7 civs on a Small map, 10 civs on Standard, etc.

    It seems that PerfectWorld's world sizes are generally larger than other maps. Is this true or is there just something about the starting locations that makes it seem that way?
     
  13. Mknn

    Mknn Prince

    Joined:
    Dec 17, 2007
    Messages:
    337
    Location:
    Houston
    First game with PF2. FFH game. Large Map.

    Python Exception, Traceback:

    line 5085, in addBonuses
    line 3179, in addBonuses
    line 3352 in AssignBonusAreas
    line 3575 in CalculateAreaSuitability
    line 3568 in GetSameClassTypeCountInArea

    TypeError: unsopported operand type(s) for *: 'int' and 'instancemethod'

    Exited, regenerated, same error.
     
  14. Woody1

    Woody1 Prince

    Joined:
    Feb 19, 2002
    Messages:
    468
    Location:
    Texas

    Yeah, PerfectWorld sets the map sizes to quite a bit larger than the standard sizes. If you want to keep the maps at standard sizes, look for the grid_sizes setting and change it back to the following:


    def getGridSize(argsList):
    grid_sizes = {
    WorldSizeTypes.WORLDSIZE_DUEL: (10,6),
    WorldSizeTypes.WORLDSIZE_TINY: (13,8),
    WorldSizeTypes.WORLDSIZE_SMALL: (16,10),
    WorldSizeTypes.WORLDSIZE_STANDARD: (21,13),
    WorldSizeTypes.WORLDSIZE_LARGE: (26,16),
    WorldSizeTypes.WORLDSIZE_HUGE: (32,20)
    }


    I think if you remove the grid_sizes list altogether, it uses the standard sizes too.

    Each of the above coordinates represent 4 tiles. For instance, the setting above for small maps will set the map to 64x40, which is what you get in "normal" maps. PerfectWorld makes small maps 96x44. The author seems to prefer making the maps quite a bit "longer" in the longitudinal direction.
     
  15. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    The reason I made these maps larger, is because I like having alot of land that is not useful like deserts, tundra and ocean. However, PW2 actually has alot more useful land than PW1 did. So I do wonder if these maps are a bit too large.

    Changing the size of the map is a bit complicated for those who would like to. You have to change the size of the original heightmap to match the aspect ratio of the results you want. See the comments for the mc.hmWidth and mc.hmHeight variables. You can set the values in getGridSize to anything smaller than those variables, but if the aspect doesn't match you'll stretch the map! Although on a randomly generated map that may not be noticable.
     
  16. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    Ok this is something I was a little worried about. Are you using vanilla Civ4 by chance? There's a version difference that I was hoping to handle, but maybe it's not water tight.
     
  17. Mknn

    Mknn Prince

    Joined:
    Dec 17, 2007
    Messages:
    337
    Location:
    Houston
    Nope, BTS, latest patch, and version Y of FFH.
     
  18. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    If you use it with normal BtS, does it work? The problem may be that I'm testing the directory structure for BtS, and if that fails, it assumes vanilla or warlords. Did you install to a non-normal directory? I may end up having to make separate versions for vanilla and BtS.
     
  19. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,869
    Location:
    Where animals hop not run
    Attached is a version for you that does the former not the latter. Agree that's it nice to not know in advance which pole offers passage.

    Also in the attachment there is a custom variable I've put in that initialises Cephalo's code to produce gorgeous new world maps the best I've ever played on but only if you select "Allow Pangaeas" and "Start in Old World"

    self.RevolutionDCMWorld = True (set to False for original behaviour but retaining random passage)

    The changes I have made are merely personal cosmetic changes to Cephalo's most excellent code. All are commented as #RevolutionDCM and distinguisable from Cephalo's own code.

    Cheers.
     
  20. Quklis

    Quklis Chieftain

    Joined:
    Mar 7, 2009
    Messages:
    54
    Location:
    Finnish Socialist Workers' Republic
    Thanks for this great map script, best I've ever seen. Even Duel sized maps are good, original scripts seem to mess them up too much :mischief:.

    :goodjob:
     

Share This Page