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

Communitu_79

Discussion in 'Civ5 - Map Scripts' started by tu_79, Aug 12, 2019.

  1. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    6,966
    Location:
    Malaga (Spain)
    "odds + mg.featureWetVariance" this part is not mine. It's in old Communitas. The logic is to increase forest around fresh water. I reduced this effect and allowed more forest without fresh water.
    Actually, what I added is this
    Code:
            if nearFeatureID ~= FeatureTypes.NO_FEATURE then
                odds = odds + 0.10
            elseif nearPlot:GetTerrainType() == TerrainTypes.PLOT_HILLS or nearPlot:IsMountain() then
                odds = odds - 0.02
            end
    It increases 10% the chance of placing a feature for each feature already present, and reduces it 2% for each hill or mountain, in a 2 tiles radious. The result is nice at low values of featurePercent. When this function is called, half the tiles aren't placed yet, so values are not that high as they seem. The proof is that in a normal map (featurePercent= 0.26, featureWetVariance = 0.05), there are patches of unforested grassland.

    There's another function that adds forests, using forestRandomPercent:
    Code:
    function IsGoodExtraForestTile(plot)   
        local x, y        = plot:GetX(), plot:GetY()   
        local odds        = mg.forestRandomPercent
        local terrainID = plot:GetTerrainType()
        local resID        = plot:GetResourceType()
        if not plot:CanHaveFeature(FeatureTypes.FEATURE_FOREST) then
            return false
        end
        
        if terrainID == TerrainTypes.TERRAIN_TUNDRA then
            if resID ~= -1 then
                return true
            end
            if plot:IsFreshWater() then
                odds = odds + mg.featureWetVariance
            end
        end
        
        -- Avoid filling flat holes of tropical areas, which are too dense already
        if not plot:IsHills() and Contains(mg.tropicalPlots, plot) then
            odds = odds - 0.30
        end
        
        for nearPlot in Plot_GetPlotsInCircle(plot, 1, 1) do
            local nearTerrainID = nearPlot:GetTerrainType()
            local nearFeatureID = nearPlot:GetFeatureType()
            
            if nearPlot:IsMountain() then
                -- do nothing
            elseif nearPlot:IsHills() then
                -- Region already has enough production and rough terrain
                odds = odds - 0.10
            elseif nearTerrainID == TerrainTypes.TERRAIN_SNOW then
                -- Help extreme polar regions
                odds = odds + 0.2
            elseif nearTerrainID == TerrainTypes.TERRAIN_TUNDRA then
                odds = odds + 0.1
            elseif terrainID == TerrainTypes.TERRAIN_TUNDRA and Plot_IsWater(nearPlot) then
                odds = odds + 0.1
            end   
            
            -- Avoid tropics
            if Contains(mg.tropicalPlots, nearPlot) then
                odds = odds - 0.10
            end
            
            -- Too dry
            if nearTerrainID == TerrainTypes.TERRAIN_DESERT then
                odds = odds - 0.20
            end
        end
        
        if 100 * mg.featurePercent * math.min(1, odds) >= Map.Rand(100, "Add Extra Forest - Lua") then
            --plot:SetFeatureType(FeatureTypes.FEATURE_FOREST, -1)
            return true
        end
        
        return false
    end
    Me neither. I saw it too, but I don't know if that's intented. Maybe the coder thought that once we chopp the jungle, we'd like it better like that. Remember that in vanilla, flat grassland was disappointing due to low production.
    Another thing that bothers me, and I don't know if it is intended either, it's forests on tundra having just 1 food. I'm used to see forest with minimum 2 food in other maps, but I don't know what is the actual standard value.
     
  2. azum4roll

    azum4roll King

    Joined:
    Jul 17, 2018
    Messages:
    710
    Gender:
    Male
    Forests just add 1P to the base terrain, ignoring hills.

    Btw, the rainfall option is also used for plains and desert percent, so you can't just remove that. I'll try to tweak all of the odds this weekend.
     
  3. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    6,966
    Location:
    Malaga (Spain)
    Ok, nice.
    If I make other changes meanwhile, how can we merge these?
     
  4. azum4roll

    azum4roll King

    Joined:
    Jul 17, 2018
    Messages:
    710
    Gender:
    Male
    I won't start working until weekend, so I guess you can upload the next version here first before that.
     
  5. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    6,966
    Location:
    Malaga (Spain)
    No worries. It looks like I'm not going to enjoy free time for a while, with the scholar course start.
     
  6. ryanmusante

    ryanmusante Regular Supporter

    Joined:
    Jan 4, 2018
    Messages:
    1,086
    Is it true that you can just places map scripts into "/Documents/My Games/Sid Meier's Civilization 5/Maps" regardless of what it is? It seems the modpack versions simply designate how many civs are on each map size which can be done manually. I see different responses to this in the forums.
     
  7. azum4roll

    azum4roll King

    Joined:
    Jul 17, 2018
    Messages:
    710
    Gender:
    Male
    Map mods can also make sure you're using mods the map depends on.

    New version sneak peek:

    Spoiler Temperature=Cool, otherwise default settings :

    Islands near the poles are much less likely to get blocked off by ice now. Ice also doesn't get randomly placed everywhere in the water. However, it's still possible to have some sea resources trapped by ice blocks. Still thinking of a way to unblock those inner seas surrounded by land and ice.

    Spoiler :

    Continents are still unbalanced. Sometimes 3 civs share a tiny continent (as above) and sometimes all 8 civs are in the same one.
     
  8. Mambo668

    Mambo668 Chieftain

    Joined:
    May 28, 2015
    Messages:
    71
    there is 8 lapis lazuli for Poland and only 3 amber near Byzantine
     
  9. azum4roll

    azum4roll King

    Joined:
    Jul 17, 2018
    Messages:
    710
    Gender:
    Male
    There are 5 ambers on the island, just enough for the monopoly. If they can get rid of Siam, that is.
     
  10. azum4roll

    azum4roll King

    Joined:
    Jul 17, 2018
    Messages:
    710
    Gender:
    Male
    Important question (that I just realized):

    Communitas (and Communitu_79) currently overwrites the resource placement logic from AssignStartingPlots.lua, that is already modded by VP. Since Communitas was not built for VP, its resource placement was tuned for the CEP mod, possibly resulting in the abundance of resource on the map.

    If we continue modding this part, we're stepping into modmod territory, which could cause balance issues for having too many/too few resources compared to playing on a vanilla map. The ideal way to handle this would be to separate the map building part (terrain etc.) from the resource replacement. Maybe @Gazebo can look into this and either incorporate our changes into VP (AssignStartingPlots.lua hasn't been modified for a looooong time according to GitHub history), or we can make this part a proper modmod.
     
    tu_79 and Kim Dong Un like this.
  11. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    6,966
    Location:
    Malaga (Spain)
    I knew there were resources spawning that the script didn't put there.
     
  12. azum4roll

    azum4roll King

    Joined:
    Jul 17, 2018
    Messages:
    710
    Gender:
    Male
    Version 1.12 release! Test it out this weekend while we continue modding.

    Changes:
    - Smoother thresholds and percentages for map settings and feature generation
    - Grassland jungles now exist on flat terrain and they have normal yields (3:c5food:)
    - To balance dense jungle starts, some flat grassland jungles are converted into plains to add some production
    - More rivers than last version. Note that rainfall option affects river generation
    - No more ice floating near the equator in wet maps
    - Slightly lowered atoll amount
    - Amount of strategic resources at major deposits can now vary slightly (3 or 5 horses can appear instead of always 4)
    - Major uranium amounts further lowered to 2 (from 3). There are slightly more deposits to balance
    - Strategic placement rebalanced (again). As a result, full VP mod is required for the mapscript to work correctly. Custom resource placement will become optional in future versions
    - Removed major coal spawns from desert hills and tundra hills. They're only on grassland and plains, more often on hills
    - Fish rate depends on nearby land fertility more than before
    - Wheat and horses can appear next to oasis without river
    - Stone cannot spawn on fresh water plains and grassland, to leave some more room for farm triangles

    Spoiler Temperature=Hot, otherwise default settings :

    Hot map pushes ice towards the poles, but tundra and snow still exist in small amounts.

    Spoiler Rainfall=Wet, otherwise default settings :

    Still a lot of trees near the equator, but much less elsewhere. Expect fewer horses if you pick a wet map, though.
     

    Attached Files:

  13. Mambo668

    Mambo668 Chieftain

    Joined:
    May 28, 2015
    Messages:
    71
    pls don't reduce atols, we like atols!. I don't think there was too much of them.
    If I reduce starting number of city states the map will have reduced land tiles or it will be more room for normal civs?
     
  14. azum4roll

    azum4roll King

    Joined:
    Jul 17, 2018
    Messages:
    710
    Gender:
    Male
    Version 1.13 release! I've changed everything I wanted to change. Next versions will probably be bugfixes and number tweaks.

    Changes:
    - "Resource Placement" map setting added. Pick "As base mod" to use resource placement script of whatever mods you're using (vanilla if none). The "Communitu_79a (rebalanced)" option requires full VP to work properly.
    - Most polar seas are now connected to the main ocean by water (not ice).
    - Strategics now consistently appear on the correct terrain. You shouldn't be seeing oil on hills now.
    - Overall there are fewer minor strategic resource deposits. Tuned major horse deposit amount up to compensate.
    - Reworked civ assignment code to reduce chance of starting isolated or very crowded.

    Spoiler Polar seas connecting to main ocean :



     

    Attached Files:

    saamohod and ChickenFighter like this.
  15. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    6,966
    Location:
    Malaga (Spain)
    Nice pics!
    How did you break the ice?
     
  16. azum4roll

    azum4roll King

    Joined:
    Jul 17, 2018
    Messages:
    710
    Gender:
    Male
    Check ConnectPolarSeasToOceans.
     
  17. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    6,966
    Location:
    Malaga (Spain)
    Good!
    Same code as ConnectSeasToOcean(), but with differently defined areas. I wonder why you made the path first with coast tiles, then turn them into ocean if there's no nearby land. Is it not working well in the same pass?

    And I'm wondering too, would it be possible to combine ConnectSeasToOcean() and ConnectPolarSeasToOceans() into the same fuction? Sending both functions to AddFeatures(), after ice placement, using 'oceanButNotIceMatch' area and allowing the path to pass by land.
     
  18. tu_79

    tu_79 Deity

    Joined:
    Feb 11, 2016
    Messages:
    6,966
    Location:
    Malaga (Spain)
    Hotfix!
    Fixed vertical rifts excessive slope (it was bugged).

    Note:
    Atlantic oceans create Greenland type islands and are harder to cross.
    Pacific oceans are wider and create more spread out islands.
     

    Attached Files:

    Last edited: Sep 29, 2019
  19. azum4roll

    azum4roll King

    Joined:
    Jul 17, 2018
    Messages:
    710
    Gender:
    Male
    Since the path can remove land we shouldn't turn them into ocean tiles before the whole path is done (could make fewer ocean tiles than intended (but maybe not since it's a shortest path? (now I'm not sure anymore))).

    Note that you can tweak the hardcoded cost of ice tiles (10) in the GetPathBetween... function to have different shortest paths.

    There's probably a reason they did ConnectSeasToOcean using the elevation map instead of terrain. Better not change that.
     
    tu_79 likes this.
  20. Gampela

    Gampela Chieftain

    Joined:
    Jan 11, 2019
    Messages:
    8
    So do you guys recommend the normal 8 players for the standard size for this script? Maybe I misremember but was there some talk about excess land area in the original communitas?
     

Share This Page