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

Communitas map script

Discussion in 'Communitas Expansion Pack' started by Thalassicus, Jul 12, 2013.

  1. Tomice

    Tomice Passionate Smart-Ass

    Joined:
    Oct 5, 2009
    Messages:
    2,320
    Location:
    Austria, EU, no kangaroos ;)
    I play his mods since the very beginning (shortly after vanilla release) and I can assure you there never was any problem with his forum activity - he usually posts daily. He just tends to get a little quieter when he's working on big changes and needs to focus.

    Here's a thread about jungles in CEP where Thal shares some design plans.
     
  2. DeepSoul

    DeepSoul Warlord

    Joined:
    Dec 30, 2011
    Messages:
    128
    Is it possible to remove the gold bonus from lakes so I can fill them in with an editor? As it is now they keep the gold bonus even if you set another type of terrain in their place.
     
  3. stackpointer

    stackpointer King

    Joined:
    Mar 3, 2013
    Messages:
    809
    See line 7714:

    PHP:
                if not Cep and plot:IsLake() then
                    
    --Game.SetPlotExtraYieldxyYieldTypes.YIELD_FOOD, -1)
                    
    Game.SetPlotExtraYieldxyYieldTypes.YIELD_GOLD1)
                
    end
    Did you not have any luck with the lakeSize constant in the script?
     
  4. DeepSoul

    DeepSoul Warlord

    Joined:
    Dec 30, 2011
    Messages:
    128
    Thanks. The lakeSize constant did nothing. I think 10 means a lake of one tile so setting it to less won't have any effect.
     
  5. DonQuiche

    DonQuiche Emperor

    Joined:
    May 23, 2011
    Messages:
    1,122
    Nope: every water area of ten tiles or less is a lake. Otherwise it is an ocean. This is a hard-coded rule in civ5. Hence the "lakeSize" constant defined in Communitas.lua to reflect this ; you should not change it.

    Now I don't think that other map scripts add such an extra yield to lakes, I wonder if it was a mistake caused by a misunderstanding.
     
  6. heinous_hat

    heinous_hat Prince

    Joined:
    Sep 28, 2010
    Messages:
    592
    Location:
    under the weather
    I'm glad this came up because I wasn't aware he was using game.SetPlotExtraYield to get desired yields for special case tiles during map generation. That's actually really useful and, for whatever reason, the method doesn't appear in any of the Firaxis scripts (or Perfectworld).

    In the case of extra gold for lakes, it only applies when using the Communitas map script standalone. Maybe Thal is attempting to balance the abundance of lakes generated by this script (in absence of the full Cep mod). Larger lakes give you a lot of contiguous low value tiles where the opportunity for trade routes is lower.

    The other usage of game.SetPlotExtraYield is to nerf food on jungle hills after the same function converts the terrain to grass . The net gameplay effect is that chopping the jungle exchanges 2:c5food: for 2:c5production: while farming it won't improve the tile without one of the conditional farm bonuses. Interesting approach when combined with leaving flat jungle tiles as plains.
     
  7. DonQuiche

    DonQuiche Emperor

    Joined:
    May 23, 2011
    Messages:
    1,122
    It usually does not appear because there is usually no reason to do so. Here it is used to adjust all lakes' yields. Imho it looks like the wrong way to do it where the proper way would be to change the "FEATURE_LAKE" feature's yield. Unless of course if this yield is actually hard-coded and Thal had to use that trick to circumvent that problem (I put my bucks on this one).

    Now I am not aware of a single script generating "special" tiles. And even if there was, creating a new resource/terrain/feature would be a better choice than SetPlotextraYield.

    All of that being said, it made me realize that I never added the ability to edit bonus yields into IGE. I guess I will have to.
     
  8. heinous_hat

    heinous_hat Prince

    Joined:
    Sep 28, 2010
    Messages:
    592
    Location:
    under the weather
    I think it seems convenient to use setPlotExtraYield with a conditional expression, like with jungle&grassland. That way, you can target only grass tiles that once had the jungle feature to yield less food once they've been cleared (special case). It's one solution anyway, custom terrain for jungle area would no doubt be more desirable (if not trickier to implement). Something tells me that sort of thing hasn't been attempted yet due to wonky behavior with feature/terrain graphics modification.

    But yeah, with the lakes case, the only condition is that Cep isn't active (whereas it's otherwise handled by the mod).
     
  9. DeepSoul

    DeepSoul Warlord

    Joined:
    Dec 30, 2011
    Messages:
    128
    PHP:
                if not Cep and plot:IsLake() then
                    
    --Game.SetPlotExtraYieldxyYieldTypes.YIELD_FOOD, -1)
                    
    Game.SetPlotExtraYieldxyYieldTypes.YIELD_GOLD1)
                
    end
    Strange. I disabled that code but I don't get any gold bonus with CEP installed(I like it that way), so I don't understand why he put it there. It can't be to balance the lakes.

    Speaking of lakes. My knowledge and interest of geography might be deeper then the average person's but I noticed something that isn't realistic. This script can generate many large lakes close to each other, with a river running through them, in desert areas where the evaporation is too high to support such a lake system. A lake in a desert usually doesn't have an outflow to the sea because the water level isn't high enough. See the Caspian Sea or Lake Aral. If the elevation is constant however you would get a river like the Nile or Tigris and Euphrates. Lake systems connected by rivers only appear in temperate regions with a lot of rain, like northern USA and Sweden.

    I also made another interesting observation. Why does the desert favour the hills in this case? They should have grassland in the south and plains along the desert's border. I have edited the script a bit but I don't think I edited it enough to cause this issue.

    Spoiler :


     
  10. stackpointer

    stackpointer King

    Joined:
    Mar 3, 2013
    Messages:
    809
    Are you saying that commenting out the code doesn't work? Or just that there isn't a bonus with CEP enabled but there is with it disabled? Either way, modifying the lake yields was a way of balancing lakes that Thal was trying out (was +1 food in earlier versions) and any differences in the map with or without CEP enabled can be attributed to legacy code that may need to be removed.

    What map size and other map setting? Has anybody else noticed this too? Since DeepSoul has modified his script we'll have to confirm that this is actually an issue.
     
  11. DeepSoul

    DeepSoul Warlord

    Joined:
    Dec 30, 2011
    Messages:
    128
    Commenting out the code works but the code affects CEP too in contrast to what heinous hat wrote. So if I disable the code the gold bonus will be disabled for CEP too.

    Regarding the desert on hills issue I started with a Huge map. I have these settings in my script:

    Spoiler :

    --Important latitude markers used for generating climate.
    mglobal.tropicLatitudes = 15 -- tropicLatitudes to 0 : grass, jungle
    mglobal.horseLatitudes = 28 -- polarFrontLatitude to horseLatitudes : grass, plains, desert
    mglobal.iceLatitude = 65 -- bottomLatitude to iceLatitude : ice
    mglobal.polarFrontLatitude = 60 -- bottomLatitude to polarFrontLatitude : snow, tundra


    --Adjusting these will generate larger or smaller landmasses and features.
    mglobal.landMinScatter = 0.00022 --Recommended range:[0.02 to 0.1]
    mglobal.landMaxScatter = 0.03 --Recommended range:[0.03 to 0.3]
    --Higher values makes continental divisions and stringy features more likely,
    --and very high values result in a lot of stringy continents and islands.

    mglobal.coastScatter = 0.075 --Recommended range:[0.01 to 0.3]
    --Higher values result in more islands and variance on landmasses and coastlines.

    mglobal.mountainScatter = 0.12 --Recommended range:[0.1 to 0.8]
    --Lower values make large, long, mountain ranges. Higher values make sporadic mountainous features.


    -- Terrain
    mglobal.mountainWeight = 0.8 --Weight of the mountain elevation map versus the coastline elevation map.
    mglobal.belowMountainPercent = 0.95 -- Percent of non-mountain land
    -- flatPercent to belowMountainPercent : hills
    mglobal.flatPercent = 0.72 -- Percent of flat land
    mglobal.hillsBlendPercent = 0.33 -- Chance for flat land to become hills per near mountain. Requires at least 2 near mountains.
    mglobal.terrainBlendRange = 2 -- range to smooth terrain (desert surrounded by plains turns to plains, etc)
    mglobal.terrainBlendRandom = 1 -- random modifier for terrain smoothing


    -- Features
    mglobal.featurePercent = 0.70 -- Percent of potential feature tiles that actually create a feature (marsh/jungle/forest)
    mglobal.featureWetVariance = 0.10 -- Percent chance increase if freshwater, decrease if dry (groups features near rivers)
    mglobal.islePercent = 0.05 -- Percent of coast tiles with an isle
    mglobal.numNaturalWonders = 2 + GameInfo.Worlds[Map.GetWorldSize()].NumNaturalWonders


    -- Rain
    mglobal.marshPercent = 0.08 -- Percent chance increase for marsh from each nearby watery tile
    -- junglePercent to 1 : marsh
    mglobal.junglePercent = 0.80 -- junglePercent to 1 : jungle
    mglobal.zeroTreesPercent = 0.25 -- zeroTreesPercent to 1 : forest
    -- plainsPercent to 1 : grass
    mglobal.plainsPercent = 0.48 -- desertPercent to plainsPercent : plains
    mglobal.desertPercent = 0.25 -- 0 to desertPercent : desert


    -- Temperature
    mglobal.jungleMinTemperature = 0.70 -- jungle: jungleMinTemperature to 1
    mglobal.desertMinTemperature = 0.46 -- desert: desertMinTemperature to 1
    -- grass: tundraTemperature to 1
    -- plains: tundraTemperature to 1
    mglobal.tundraTemperature = 0.22 -- tundra: snowTemperature to tundraTemperature
    mglobal.snowTemperature = 0.15 -- snow: 0 to snowTemperature
    mglobal.treesMinTemperature = 0.17 -- trees: treesMinTemperature to 1
    mglobal.forestRandomPercent = 0.05 -- Percent of barren flatland which randomly create a forest


    Anyone who can tell me what this does? "mglobal.terrainBlendRandom = 1 -- random modifier for terrain smoothing"
     
  12. stackpointer

    stackpointer King

    Joined:
    Mar 3, 2013
    Messages:
    809
    I might have encountered a weird edge case with the ocean rift code. I'm using the 1.4 map; small size, low sea levels, narrow rifts and encounter a 1 tile wide coastal connection through the ocean. I've attached a screenshot and my logs but I haven't been able to duplicate this behavior either.
     

    Attached Files:

  13. macheteman

    macheteman Chieftain

    Joined:
    Jul 20, 2013
    Messages:
    44
    Just noticed that the Terra option for Communitas stopped working. There are no AssignStartingPlots.lua in my MOD folder, so I'm not sure what would be making Communitas map start Civs on ALL continents when "Terra" is selected.

    edit: nvm dont know what happened. its fine.
     
  14. macheteman

    macheteman Chieftain

    Joined:
    Jul 20, 2013
    Messages:
    44
    Tundra starts all over for Spain.

    Reloaded at least 10 times on a standard Terra communitas map and there is Tundra within 4 tiles on 7/10 starts.

    Anyway to fix this? Spain's coastal bias works just fine, but its always near a tundra....
     
  15. mitsho

    mitsho Deity

    Joined:
    Nov 3, 2003
    Messages:
    7,297
    Location:
    Europe, more or less
    Easiest way? Download the Really Advanced Setup Mod and chose your own start bias in the start screen.

    But this may just be by chance that it gives you coastal bias (why exactly still?) which just also happens to be near tundra (because other civs take precedence and "need" their desert or whatever).
     
  16. stackpointer

    stackpointer King

    Joined:
    Mar 3, 2013
    Messages:
    809
    Spain doesn't have a coastal bias. The only civilizations that have a coast bias is:

    CIVILIZATION_ENGLAND 1
    CIVILIZATION_OTTOMAN 1
    CIVILIZATION_JAPAN 1
    CIVILIZATION_POLYNESIA 1
    CIVILIZATION_DENMARK 1
    CIVILIZATION_CARTHAGE 1
    CIVILIZATION_BYZANTIUM 1
    CIVILIZATION_INDONESIA 1
    CIVILIZATION_PORTUGAL 1
    CIVILIZATION_VENICE 1
    CIVILIZATION_NETHERLANDS 1
    CIVILIZATION_ROME 1
     
  17. Thalassicus

    Thalassicus Bytes and Nibblers

    Joined:
    Nov 9, 2005
    Messages:
    11,057
    Location:
    Texas
    I think Spain has no terrain bias. I believe map scripts can't change this. Starting near tundra probably happens because so many other civilizations have non-tundra preferences like desert, plains, grass, etc. They take up the lower latitudes and leave civilizations like Spain with nowhere to spawn but the tundra. It's one of the problems with the vanilla start placement system. I often considered replacing that system with a new one... but it would be so much work I never really got around to doing it.
     
  18. macheteman

    macheteman Chieftain

    Joined:
    Jul 20, 2013
    Messages:
    44
    Makes sense! I didn't think of it this way, but I see why Spain gets the short end haha.
     
  19. qadams

    qadams Bohemian

    Joined:
    Jan 2, 2014
    Messages:
    707
    Location:
    Ruritania
    Communitas Map is my favorite map to use, EXCEPT for one thing -- I often prefer to play on a single large continent, i.e., Pangea. Why is that option not included with this mod?
     
  20. Spheniscine

    Spheniscine Chieftain

    Joined:
    Mar 30, 2011
    Messages:
    83
    Probably because the landmasses are generated with Perlin noise, so controlling the number of continents might be difficult; you can get Pangaea-like gameplay by having only one ocean rift, but you may sometimes get landmasses separated by channels (coastal tiles).
     

Share This Page