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

Caps Lock 0.9.4

Starting plot improvements

  1. BWS

    BWS Big Bradd Wolfe

    Joined:
    Jan 4, 2009
    Messages:
    375
    Location:
    San Jose, CA
  2. BWS

    BWS Big Bradd Wolfe

    Joined:
    Jan 4, 2009
    Messages:
    375
    Location:
    San Jose, CA
  3. BWS

    BWS Big Bradd Wolfe

    Joined:
    Jan 4, 2009
    Messages:
    375
    Location:
    San Jose, CA
  4. BWS

    BWS Big Bradd Wolfe

    Joined:
    Jan 4, 2009
    Messages:
    375
    Location:
    San Jose, CA
  5. UglyBoy

    UglyBoy Pseudo Impossible

    Joined:
    Mar 8, 2002
    Messages:
    191
    Location:
    In the fluff drawer in the dryer.
    Finally got a chance to try this. It worked out fairly well. It appeared to be an improvement on the base script. What is the thinking behind the crunch? How well do you think you will need to balance the weightings of the fall back to account for it? If I have suggestions or ideas where would you like me to post - here, steam, git?
     
  6. BWS

    BWS Big Bradd Wolfe

    Joined:
    Jan 4, 2009
    Messages:
    375
    Location:
    San Jose, CA
    Here is good for general discussion, git for concrete bug reports & enhancement requests, please!
     
  7. BWS

    BWS Big Bradd Wolfe

    Joined:
    Jan 4, 2009
    Messages:
    375
    Location:
    San Jose, CA
    So, the “crunch” score addresses one of the major problems with the official code: everything is all-or-nothing. If there isn’t a spot that satisfies the buffer rules, the check is just false and every plot is equally bad, with respect to those rules. The algorithm doesn’t care if you’re 9 squares away or just 1. It doesn’t care how many other civs you’re crowded up against. So I resolved that by calculating a score instead of a boolean. The first version calculated the distance to the closest civ within the buffer, but the current version counts every tile of encroachment instead. That penalizes a plot more heavily if more than one civ is too close.

    The other major difference in the Caps Lock algorithm is that it counts every violation of the placement rules, instead of prioritizing them from best to worst. That way, if two tiles are tied for civ distance, it still matters whether you are too close to a national wonder, or missing a water supply. Version 0.9.0 gave every check a weight of 1, except for the “crunch” (discussed above), and the water check (which has a weight of 2).

    I quickly noticed that version 0.9.0 still had problems with polar snow starts. I dug into the “valid adjacent” check which covers both adjacent terrain and polar locations. After some analysis, I decided that it had three major sub-checks, which should each contribute to the score: distance from poles, blocking tiles (mountains & water), and barren tiles (desert & snow). For 0.9.2, I gave the polar check a distance-based score like the civ buffer, and I scored the other two subchecks 1 point each. I might tune that one further, in particular to detect mountain traps and give them a +10 score like other “impossible” starts.

    Along the way, I changed my mind a few times about what to call various scores & whether to count up or down, so the code is a bit chaotic this way. I plan to clean that up before making a 1.0.0 release. I might also try to incorporate YnAMP compatibility if I can do it without creating a separate “patch” mod like is common on Steam Workshop.
     
  8. BWS

    BWS Big Bradd Wolfe

    Joined:
    Jan 4, 2009
    Messages:
    375
    Location:
    San Jose, CA
    Something that just occurred to me: It seems like the whole reason behind the fallback system is to keep from running out of regions to put civs. I wonder if everything would work better if you only used the fallback when you run out of regions that satisfy all of the rules? The main drawback of that approach is that you might skip over a fertile region with a minor defect, and instead choose a crappy region that can satisfy all of the validity rules. Perhaps the best approach is to score your best position in every remaining region and choose the best one overall?
     
  9. BWS

    BWS Big Bradd Wolfe

    Joined:
    Jan 4, 2009
    Messages:
    375
    Location:
    San Jose, CA
    I found a bug caused by changing the AssignStartingPlots method interfaces from boolean to number. Some map scripts like Got Lakes override the methods, which makes them return a boolean that the scoring system does not expect, and everything crashes. I will try to fix this by adding an extra parameter to select whether the method returns boolean checks or numeric weights, and make the scoring algorithm tolerant of either.
     
  10. BWS

    BWS Big Bradd Wolfe

    Joined:
    Jan 4, 2009
    Messages:
    375
    Location:
    San Jose, CA
  11. BWS

    BWS Big Bradd Wolfe

    Joined:
    Jan 4, 2009
    Messages:
    375
    Location:
    San Jose, CA
    I had some trouble uploading version 0.9.4 to Steam. It looks like the new Windows 10 update (version 1709) might break the Steam Workshop Uploader. Luckily, I was able to get the uploader working again by rolling back Windows.
     
  12. Old

    Old Chieftain

    Joined:
    Mar 24, 2016
    Messages:
    11
    Someone needs to tip about this mod to Ed Beach and Firaxis devs, they sure could use your mod and learn how to fix the start positions !
     
  13. UglyBoy

    UglyBoy Pseudo Impossible

    Joined:
    Mar 8, 2002
    Messages:
    191
    Location:
    In the fluff drawer in the dryer.
    I have not had much time to mess with this. The little spare time I had I have played some Civ. However, I did get a chance to mess with something the other day. I tried removing the " + iBonusMajor" and " + iBonusMinor" from the StartPositioner.DivideMapIntoMajorRegions call. This was in the base file rather than in your mod. Regardless, it worked quite well. I got a slightly nicer distribution of civs in the limited runs I did. I put this down to the world being split in to less regions. I assume because there is less chance of a total failure since the fallback was added then less regions is not as big of an issue. However, I did run in to an issue when I ran high sea level, extra mountains and more tundra. Only about half of the city states got placed.

    I wonder if it would be possible to attempt placing all civs and city states and then if you run out of regions then rerun with one extra region. This could be iterated up to a sensible value. Without knowing more precisely how StartPositioner functions it is hard to devise how to optimise for it.
     
  14. blackbutterfly

    blackbutterfly Chieftain

    Joined:
    May 9, 2016
    Messages:
    280
    Gender:
    Male
    Location:
    Leeds, UK
    Ed is well aware of this bug. In the last livestream (of 2017) he said they're re-writing it to make civs even further apart with CSs in between.

    @BWS I'm testing a new map, Scrambled South Pacific, an extreme islands map, which is very impacted by the current start locations. Civs spawn 1-2 tiles away, on the same island :cringe:

    Keep an eye out for it cos you may wanna test Caps Lock on it. It'll be done by tomorrow or day after. (I'm cooking Christmas dinner again this year so I'll finish it when I have the time and energy). Merry X'mas! :D
     

Share This Page