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

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    Ok, I thought that I was as current as could be, guess I wasn't, back to the drawing board, I will let you know if I get any bugginess.
     
  2. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    By the way, I finally figured out what I was doing wrong. I put hyphens in my filename. Apparently Civ IV doesn't read files with hyphens in the name. :cringe:
     
  3. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    :lol: I would have never guessed that in a million years! How did you learn that?
     
  4. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    Through pain and suffering.
     
  5. Opera

    Opera Deity

    Joined:
    Sep 21, 2008
    Messages:
    4,643
    Hi cephalo :D

    I really like your work with PerfectWorld but as a Fall From Heaven player, I've encountered an issue: the Malakim civilization which is set to start in desert won't be placed on desert on start with PW2. I looked into the files and commented out the "remove jungle" part for another civilization but didn't find where the "no start on desert" is handled...
     
  6. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    In this script starts are placed purely for 'value'. Desert starts do happen occasionally when there are alot of floodplains concentrated in one area, but it's kinda rare. There really isn't any mechanism for 'fictional' starts of the kind I put in the Erebus map script. You might try Seven05's Erebus Continents map script which is based on PW2 but for FFH.
     
  7. dr_s

    dr_s Prince

    Joined:
    Dec 27, 2006
    Messages:
    536
    I've attached a couple screenshots of a recent start I got with PW 2.02. I just settled in place to make the screen shots. Seems like not a great spot to me.

    The one possibly relevant change I've made is to tweak the maps sizes:

    Code:
    		# WorldSizeTypes.WORLDSIZE_DUEL:	(12,8),
    		# WorldSizeTypes.WORLDSIZE_TINY:	(16,10),
    		# WorldSizeTypes.WORLDSIZE_SMALL:	(22,14),
    		# WorldSizeTypes.WORLDSIZE_STANDARD:	(26,16),
    		# WorldSizeTypes.WORLDSIZE_LARGE:	(32,20),
    		# WorldSizeTypes.WORLDSIZE_HUGE:	(36,24)
    		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 did this so that the maps would be the same size as the regular maps, e.g. Fractal, Terra, etc. Could that possibly affect this?
     

    Attached Files:

  8. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    The size should not effect it, and that is not the kind of start that I would expect at all. There are a couple more things that are different about this map from the default settings, that river corner that touches desert should have a spot of green to indicate a floodplain, and there seems to be many fewer trees. Have you made alot more tweaks than just map size?

    It's also good to see where everyone else is starting to see if there is a reason that someone lost the musical chairs of placement. A large but really bad continent might conceivably cause this to happen. Also, if the meteors destroyed too much of the world that might also effect things.

    That spot should normally have been thrown out early in the process. I would suspect that there was maybe an exception thrown during my starting plot finder, causing the default routine to happen, except I see you have a bunch of rocks as compensation for your bad start. If a crash happened you shouldn't have gotten those rocks, because I believe I disabled the default starting plot sweeteners.

    If you still have the game I wouldn't mind seeing the mini-map.
     
  9. dr_s

    dr_s Prince

    Joined:
    Dec 27, 2006
    Messages:
    536
    I don't have the original map, but I recreated it (as well as the script allows) using the same seed. See the attached picture, of the same area, including the entire minimap.

    I noticed a couple things. (1) In this run, I got the spot that Monty got in the original place, but without the fish. Why would that be? (All the other resources are the same, so I'm assuming that the fish in the first map were added to boost the start value of that spot.) (2) No stone where Moscow was in the first map. Was that also added to boost the start value?

    I have the PythonDbg.log files for both maps, if there's something of interest there. I could also generate more maps with these values to see what else comes up.

    You're right, I've modified the forest placement to reduce the forest. I've also made some other changes, but I don't think they should affect things, they're mostly adding in-game options or changing the defaults. I haven't done anything that should affect start placement, I don't think, or river/flood plains.
     

    Attached Files:

  10. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    Since the starts are different on this run, that would change the calculations regarding plot boost resources. That's probably why you didn't get fish. Also yes, those rocks were a vain attempt to improve your crappy start position.

    I'm looking at the minimap, and it looks like a large percentage of the world was destroyed in the meteor phase. My algorithm is better than it was, but sometimes it still ends up destroying the world. Are you breaking pangaeas and using a new world? That combined with the smaller map sizes would put an expected strain on the starting plot finder. Less good land and more players just makes fairness more difficult to achieve.
     
  11. dr_s

    dr_s Prince

    Joined:
    Dec 27, 2006
    Messages:
    536
    One of the changes I made was to have "Break Pangaeas" and "Allow New World" be set randomly. For that map they were both true.

    Does your boosting algorithm always add (perhaps multiple occurrences of) a single type of resource to the BFC to help balance starts? It's true that when I reduced the map size I started seeing more multi-stone and multi-marble starts. (Although that four-stone start was the most extreme I've seen.) Have you thought about tweaking the algorithm a bit to add more types of resources and perhaps scatter them further (but still nearby)?
     
  12. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    It's actually sortof random how it boosts the starts. It will randomly pick commerce, prod, or food and boost, stepping thorugh the different types, until it reaches the desired value. (I have a vague memory of changing that, I'm not sure exactly how it works now.) It works pretty well unless things get rediculous.
     
  13. Tholal

    Tholal Emperor

    Joined:
    May 19, 2009
    Messages:
    1,676
    Fall Further and Fall Further plus both have a 'Flavor Start' option that will start civilizations near their preferred terrain. I believe this was originally part of a separate mod called FlavorMod that can be downloaded separately and used with Fall from Heaven 2.
     
  14. glider1

    glider1 Deity

    Joined:
    May 29, 2006
    Messages:
    2,784
    Location:
    Where animals hop not run
    Yeah this perfect world thing is ridiculous.

    I'm shocked at the beauty of it on a small map size, allow pangaea and start in the old world and the Cephalo algorithms are how to say, spectacular :eek: straight out of the box no adjustments needed. In order to change the resource balance for corps, just plug in a couple of extra woc sea resources to displace the vanilla sea resources and off you go for a stupendous BTS experience.

    Sharing quality code like this is a wonderful thing.
    Cheers.
     
  15. harry_flashman

    harry_flashman Chieftain

    Joined:
    Apr 28, 2009
    Messages:
    99
    Location:
    horseguards, london
    cephalo
    many thanks for your superb map, it really is top banana! pretty much the only one i can play civ on nowadays, the other maps just seem wrong.
    I would be obliged if you could point me in the direction of what to adjust to shrink the deserts a bit. Im playing on a small map and the deserts often turn out to be a little too big for me. Im useless at coding and so every attempt Ive made had just led to an entire map of grassland which is no use to anyone.

    Ive played some very interesting games on this map. Just had one where I was hemmed in by desert on one side and the koreans on the other. I did a quick rush of the koreans, but it turned out their land was blocked off by a mountain range. (note: a proper range not just a little clump of peaks) Ho hum thinks I, and goes about building up my crappy little empire, until i finally built a galley and sailed past the mountain range. Lo and behold a lovely little lost world was up there! Straight out of Conan Doyle. Lush jungle, enough room for 4 cities, cavemen, dinosaurs! brilliant!

    are you a meteoroloist by the way? you seem to know a lot about weather systems.
     
  16. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    Everything I know about meteorology I learned from Wikipedia. :) I think that in Civ 5 once you research Wikipedia, it should make education obsolete. :lol:

    To lower the amount of desert, find the DesertPercent variable toward the beginning of the script, and set it to a lower number.

    Thanks for the compliments everyone! :)
     
  17. Ramesses

    Ramesses Ruler. Visionary. Pimp.

    Joined:
    Apr 15, 2008
    Messages:
    1,176
    I wouldn't do that. I was deathly afraid of squirrels for a while because Wikipedia said they were bloodthirsty carnivores.

    Spoiler :
    Okay, not really. :lol:
     
  18. phungus420

    phungus420 Deity

    Joined:
    Mar 1, 2003
    Messages:
    6,296
    Could you please bring the map size in line with the standards for the rest of the scripts. A small map using this script is as big as a standard. Large as huge, etc. It's annoying when you first use it, because if you know your computer can't handle large maps, and you pick standard, you get lagged out, and late game MAF crashes.

    Also why have you enlarged it? Are you unaware that some people's computers can't handle biggger maps, and enlarging it means everyone with earlier machines have to drop a map size, and not knowing this causes confusion, and can ruin games because the lag gets too bad in the late game when you're not expecting it, because you didn't realize you're playing on a large map when you know your computer can handle standard maps, but this script makes standar size maps large?
     
  19. cephalo

    cephalo Deity

    Joined:
    Jul 26, 2007
    Messages:
    2,058
    Location:
    Missouri, USA
    The maps are larger because the playing area is alot smaller in PW. There's alot more ocean and unusable terrain, plus by default nobody starts in the new world. If I made the maps the normal size I think you would run into your neighbors too early. I've really been happy with the pace of the games I've played with this map.

    If you need some help changing the size I can help with that, but I'm not going to make the default settings tuned for people with old computers...
     
  20. TheLadiesOgre

    TheLadiesOgre Aspiring Codesmith

    Joined:
    Jan 16, 2009
    Messages:
    505
    Will PW.py accept negative numbers?

    If I did added something like this:

    self.hmMinDeepOceanDepth = -0.15

    and then later on in CreateTerrainMap

    for i in range(0,mc.height*mc.width):
    self.terrainMap.append(mc.DEEPOCEAN)
    elif (self.heightmap = isBelowSeaLevel and >= self.hmMinDeepOceanDepth):
    self.terrainMap.append(mc.OCEAN)

    is that close to what I would need to do or am I horribly off?
     

Share This Page