1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. Photobucket has changed its policy concerning hotlinking images and now requires an account with a $399.00 annual fee to allow hotlink. More information is available at: this link.
    Dismiss Notice
  3. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  4. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  5. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  6. Dismiss Notice
  7. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

[Map Script] PerfectWorld2.py

Discussion in 'Civ4 - Map Scripts' started by cephalo, Feb 17, 2009.

  1. Fuyu

    Fuyu Chieftain

    Joined:
    Nov 5, 2009
    Messages:
    1,220
    Location:
    Austria
    I tried, I failed. The Mod I use doesn't even have a \XML\Terrain\ folder; Civilization4\Beyond the Sword\Assets\XML\Terrain\ exists but no CIV4BonusInfos.xml file there, so I went and changed those bNormalize values to 0 in Civilization4\Assets\XML\Terrain\CIV4BonusInfos.xml . If that xml file is even read or if your map script simply ignores that flag I don't know, I can only observe that it doesn't help.
    (minhills 4 and maxpeaks 2, no other changes to the mapscript)


    click for full picture

    3 times stone - which I don't like so much; directly next to it 1 marble, completely ignoring the iUnique values from Civ4BonusClassInfos. But the best is still the Hills/Flood Plains tile to the right of the stone row.

    edit: changing the file from warlords seems to have the desired effect though :)
     
  2. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,919
    Location:
    Missouri, USA
    Yeah, Warlords is the latest version of that file. I had forgotten about that.

    Dang. Floodplains on a hill. That's a bug. The part I don't get though, is that you have well over the minimum amount of hills (4 you said?) in that screenshot, so when was that hill added and why? I'll have to look into that.
     
  3. A_Hamster

    A_Hamster Small Furry Animal

    Joined:
    Dec 20, 2007
    Messages:
    627
    @cephalo: self.BonusBonus will adjust bonus frequency of both land and sea resources. Is it possible to increase ocean bonuses only?

    The reason I ask is that in Fall from Heaven, pearls are one of the sea resources ,but only the Lanun can see and use them. However, the mapscript does not know that, so the invisible pearls are counted against the total resources in your starting position. I figured if one could increase overall sea resource frequency, it would balance the pearls, and the seas wouldn't be so barren for the other civs. (Incidentally, I've copied perfectworld2 into the FfH public maps folder since I've decided different script settings are required in FfH than in basic BtS. More land for starters.)

    @Ulysses81: I've been tinkering with the variables as you suggested on page 25 of the thread. However, I can't reset noise or plate number as high as you did owing to computer limitations, so the coastal mountain ranges are only reduced, though not vanished. Still, increasing the plate number is making for interesting shaped continents. Thanks for your help.
     
  4. Fuyu

    Fuyu Chieftain

    Joined:
    Nov 5, 2009
    Messages:
    1,220
    Location:
    Austria
    Yes it's a bug probably unrelated to minhills and maxpeaks but it only happens when a dessert hill next to a river is inside a starting FC, and unlike the wonder resources craziness this is rare enough.



    edit: I just hope this is not related to BetterAI :p
     
  5. Ulysses81

    Ulysses81 Chieftain

    Joined:
    Feb 18, 2007
    Messages:
    36
    In my opinion there are too many resources in almost every starting spot, be they stones/marble or food.

    I think the underlying problem here is that the script assigns starting locations first and then, if the resulting FC and surroundings aren't good enough on their own, changes the location (by adding resources, hills, etc) instead of discarding it in favor of the next on the list.
    For the alternative to work there must of course be enough potential locations to choose from. And this would probably be complicated by the maximum-distance algorithm discussed before.

    So my proposals are:

    -Get rid of the maximum-distance thing in favor of a minimum-distance rule that makes sure that at least FCs don't overlap. The
    min-distance could be adjustable. This will give some early competition.

    -Get rid of all starting spot sweetening. Just examine locations as they are and take the best. I don't think it'll be more unfair than the
    current starts where you have to compensate for bad surroundings with tons of food boni, just because the
    maximum-distance rule decided that one civ should be stuck on the shady side of the continent.

    -and i still would like to see a rule that makes starting locations be either on the coast or at least 3 tiles away. Everything else usually
    screws the AI.

    greets
    Ulysses
     
  6. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,919
    Location:
    Missouri, USA
    Man, those are some serious cans o' worms! I think those pros would come with some heavy cons, but I don't really have time for the required experimentation. This is all work after work for me.

    I worked on the starting code for months, and it really is about the best I can do. If you can do better, I think everyone would like to see it. I have no objections to modmods of my map scripts. I say make a new thread with your own starting code and get some feedback.

    Map scripts get old hat. Everyone likes a new spin on things. I say go for it if you have the time!
     
  7. Ulysses81

    Ulysses81 Chieftain

    Joined:
    Feb 18, 2007
    Messages:
    36
    Unfortunately i don't really know python, otherwise i'd be at it already. But i imagine that the main element of the starting code, the evaluation process, would stay the same. I'll see if i can figure out how to make the script do what i want, but that may take a long time...

    greets
    Ulysses
     
  8. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,919
    Location:
    Missouri, USA
    I didn't know any Python when I started this map. ;) It's actually a pretty fun way to learn.

    Actually, the things that you propose are very similar to how the default placement works. For a quick experiment you can simply comment out the starting code altogether and let the default routines happen. There are some difficulties that you will face however if you really want to make better starts.

    This map often has large areas of really good and really bad land. If you have a minimum distance algorithm, the guy who gets the best starting plot is also likely to have prime land to expand into, probably the best region in the world. So he will have not only the best starting city, but the best first 3 or 4 cities as well. The factory maps tend to scatter the terrain much more randomly, which means that the map is more homogenous in terms of quality. Starting plots matter less on the factory maps. In PW you can have a great local start but be hemmed in by a massive desert or tundra wasteland and have no chance. This situation needs to be recognized and accounted for in some way, and plot sweetening usually works pretty well.

    Another issue is that the quality of a starting plot very much depends on where your neighbors are. You can get into this circular feedback loop where civ A's quality depends on where civ B is, and civ B's quality depends on where civ A is! It can get pretty nightmarish with the chicken and egg thing. Quality really can't be determined until all civs are placed.
     
  9. Ulysses81

    Ulysses81 Chieftain

    Joined:
    Feb 18, 2007
    Messages:
    36
    Hmm... i don't see how a maximum distance rule prevents this. What i propose would level the field in such a situation by placing not one but several starts into the best area of the map. The not-so-good starts would get more room to expand as a compensation.

    If you move more starts into the better areas there wont be so many of the surrounded-by-wasteland type. But before i assume too much about what the script does, can you tell me to what extent and distance the surroundings are actually analyzed?

    Thats tricky... but actually what i propose should at least statistically balance the good land with close neighbours, without actually analyzing the positions relative to each other.

    well ill see what i can do...
    Ulysses
     
  10. GatlingGun

    GatlingGun Chieftain

    Joined:
    Feb 3, 2008
    Messages:
    273
    Location:
    Northwest USA
    Cephalo mentioned plot sweetening above.... Speaking of plot sweetening, this is probably the best start I ever had in Civ4... using the latest version of perfect world...

    4 crabs, 1 corn, 1 clam, 1 cow and spices thrown in there to make it taste great!

    Incredibly, I wound up loosing this game to constant AI dogpile behavior... It's hard to tech when you are fighting so much... I did fine holding my own until ragnar showed up with grenadiers vs my longbows... at that point, it was gameover.
     

    Attached Files:

  11. GatlingGun

    GatlingGun Chieftain

    Joined:
    Feb 3, 2008
    Messages:
    273
    Location:
    Northwest USA
    There really is no reason why you can't learn it, if you're willing to put the time in. One of the best python books available is online for free...

    http://www.diveintopython.org/
     
  12. cheesemijit

    cheesemijit Chieftain

    Joined:
    May 5, 2009
    Messages:
    362
    Location:
    Eastleigh, Hampshire, England
    Would you consider making a version of this mapscript that could add the marsh terrain and peat bog feature for RoM? and possible one that allows production materials to appear on peaks for Affores modmod?
     
  13. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,919
    Location:
    Missouri, USA
    I'm guessing that you are playing on one of the higher difficulties? I have a new feature that adds extra bonuses past Noble difficulty. You can adjust this in the map script variables.
     
  14. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,919
    Location:
    Missouri, USA
    I thought someone else had done this already. Anyway, I probably won't have time for a good long while.
     
  15. GatlingGun

    GatlingGun Chieftain

    Joined:
    Feb 3, 2008
    Messages:
    273
    Location:
    Northwest USA
    Indeed, this was prince / bbai. In this case, I think the plot sweetening was justified given the small room I had to expand in... although I'm not sure if you even consider expansion when you bump starting bfc values. I'll have to look at the source sometime.

    I've had PW starting plots in other prince games that quite frankly were bad, and seemed to need more help. I can remember one as india with no metal, no food, no luxuries and only one grass horse.
     
  16. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,919
    Location:
    Missouri, USA
    Yes, expansion room and it's value are the main criteria for boosting. If you get a ton of sweetening like this it's because you are tucked into an isolated corner. Conversely, if your expansion area (likely city locations that are closer to you than anyone else on the same continent) is highly valuable you would get nothing, even if your starting location has no resources. However, I have found that lots of resources tends to signal a more difficult game.

    However, you would always get a bonus for your difficulty level. On Prince that defaults to 1 resource. This is a new feature starting with 2.04.
     
  17. Elenhil

    Elenhil Chieftain

    Joined:
    Jan 19, 2008
    Messages:
    254
    BTW, Cephalo, I constantly hear people suggesting some mid/late game bonuses for the AI elsewhere, just to counter human players' pattern of getting far too strong mid-game due to effective micromanagement, specialized economy and BRAINS ;) How about an option to supply AI capitol spots with delayed technology resources that would kick in mid/late-game?
     
  18. WaKonabi21772

    WaKonabi21772 Chieftain

    Joined:
    Jul 16, 2009
    Messages:
    42
    Location:
    Washington
    I honestly do not know how to make the file work...

    It says "To use this map, put it in your Civilization 4\PublicMaps folder, not in your My Documents\My Games\Civilization 4\PublicMaps folder."

    but the only way to get to the publicmaps folder is through the my games part of my hard drive...?
     
  19. WaKonabi21772

    WaKonabi21772 Chieftain

    Joined:
    Jul 16, 2009
    Messages:
    42
    Location:
    Washington
    nevermind I think i got it working...

    I think lol
     
  20. cephalo

    cephalo Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    1,919
    Location:
    Missouri, USA
    When the game asks you what map script to use, PerfectWorld should be in the list of choices.

    That warning I gave is actually kindof outdated, it will work in your mygames/etc.
     

Share This Page