1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

NV's Snowflake Map Script [ALPHA] 0.0

A randomly-generated map script intended for balanced multiplayer gameplay.

  1. NycholusV

    NycholusV Chieftain

    Joined:
    Jun 25, 2016
    Messages:
    85
    Gender:
    Male
    Location:
    Sydney, Australia
    https://nycholusv.com/map-scripts/

    Installation:
    • Copy the folder "NV_Balance_Maps" to your Mods for Civilization 6, usually: Documents » My Games » Sid Meier's Civilization VI » Mods.
    • Open Civilization 6.
    • Click "Additional Content" in the Main Menu.
    • Ensure the checkbox beside "NycholusV's Snowflake Map" is marked.

    For the past few weeks, I have been spending hours per day working on a custom map script for Civ 6. There is still a lot that needs to be done, but I've decided to release what I've done anyway just to get some feedback.

    The first patch that came out for Civ 6 included the 'Six-Arm Snowflake' map, which sounded promising, but we were disappointed to discover that it is actually a predefined map, not a map script. So I decided to take it upon myself to create an actual map script that randomly generates a balanced map with a 'snowflake' template.

    This map, once completely, I hope will see some use in the multiplayer community. It aims to address several issues in multiplayer:
    • Naval warfare sees very little use in multiplayer due to the fact that Pangaea maps are almost exclusively used. A snowflake map increases the coastline-to-area ratio, encouraging naval warfare, and also separates players in such a way that naval warfare will often be preferable in terms of efficiently conquering an opponent.
    • It is often the case in multiplayer games that a player will be isolated, making them more likely to win a 'runaway' victory where no other players can feasibly intervene. Likewise, it is often the case that a player will be in the corner of a map and proximal to other players, diminishing that player's chance of remaining competitive throughout the game from turn zero. The snowflake map ensures that players are all on even footing in terms of their proximity to other players.
    • Once I implement a resource balancing algorithm (I already have a method in mind), the map will address the issue of players having unbalanced starting locations. Although this is partly addressed by using the 'Balanced' parameter for base game map scripts, I intend to make it so that players' entire starting regions are balanced, not just their capital.
    • Also once I implement the resource balancing algorithm, I intend that the center of the map will be far more fertile than the rest of the map, encouraging players to expand towards the center and compete for it.
    • You may have noticed that there are some natural wonders that appear almost every game, and some that almost never appear. This is due to the variations in restrictions applied to natural wonder spawning. Some natural wonders have very specific requirements, such that it is quite often that there will be no plot anywhere on a map that is a suitable location for that wonder. This map script does the natural wonder placement process in reverse - it selects the natural wonders to begin with, and then 'forces' a certain location to be appropriate for it.
    • The game has several game mechanics (mostly traits) that relate to continents. The continental dividing lines on Pangaea maps are effectively arbitrary, bearing no relation to any tangible aspect of the map. This snowflake map is divided into seven continents, where each 'wing' of the snowflake is its own continent and the center region is also its own continent. Consequently, continents are actually meaningful and relevant to the anatomy of the map, opening up the possibility of strategies around continent-based game mechanics, which are usually considered a matter of pure chance.
    I will outline how the map is generated:
    1. The map script takes the plot in the center of the map and assigns all plots within 10 tiles to be part of the center continent, which I refer to as the 'Promised Land'. All of these plots are set to land.
    2. Plots between 11 and 17 tiles from the center are then assigned to their respective 'wing' continent and set to land. There are six wing continents, one on each edge of the Promised Land. The plots that form the boundaries between each wing continent are excluded, and remain sea plots.
    3. Plots between the center of the map and the center of each wing continent are assigned to what I refer to as the 'Red Carpet', which prohibits these plots from becoming sea, lakes, or mountains. This ensures that the wing continents are properly connected to the promised land and that there isn't too much of a choke point between them.
    4. Natural wonders are assigned to the Promised Land. One is at the center, and the other three are six tiles from the center northwest, east, and southwest. The natural wonder at the center cannot be coastal or marine, but the others can.
    5. Appropriate measures are taken to ensure that the plots where the natural wonders are assigned will be appropriate for them. This includes mandating that certain plots become sea for coastal and marine wonders, and other protections similar to the Red Carpet.
    6. Each continent has its coastline 'eroded'. All coastal tiles go into a lottery-like draw, where each plot is added to the draw for every adjacent coastal tile it has. The map script then randomly selects a plot from the draw and converts it to a sea tile. Note that this process always checks if the selected plot is an isthmus, and will not convert such tiles to sea (without this precaution, islands can form). On standard sea level, 40% of a wing continent's plots are eroded. The Promised Land is also eroded, but the proportion is always one-third that of the wing continents. If a marine or coastal natural wonder has been mandated, this process will also accommodate for that. Plots within two tiles of the Red Carpet are protected from erosion.
    7. Each plot is assigned a 'height' value using the base game's fractal generator. For each continent, a list of land plots in that continent is created and sorted by height. On standard world age, the highest 5% of eligible plots are converted to mountains. The eligibility criteria are: a) the plot is more than one tile from the Red Carpet, b) the plot is not coastal, c) the plot has not been marked as ineligible for mountains due to a natural wonder, d) placing a mountain at that plot will not encircle a portion of land.
    8. On standard world age, the next highest 40% of plots (including those that were ineligible for mountains) are converted to hills.
    9. The terrain (i.e. grasslands, plains, deserts, etc.) is generated using the base game algorithm. I have been considering writing my own script to do this, but I am unsure of if I should and what I would be aiming to achieve in doing so. I would like to hear your thoughts on this.
    10. Natural wonders are added. The plots near the natural wonders have their terrain 'assimilated' so as to be valid for the natural wonder but remain as similar as possible to nearby terrain. (This does become a bit awkward when Eyjafjallajokull spawns.)
    11. Rivers are added using the base game algorithm. I have made a very minor tweak in the RiversLakes.lua file to ensure that rivers do not run through natural wonders. (In the base game map scripts, this is not a consideration because natural wonders are placed after rivers.)
    12. Using the height rankings generated earlier, the lowest eligible 3% of plots on each continent are converted to lakes. The eligibility criteria are: a) The plot is more than one tiles away from the Red Carpet, b) the plot is not coastal, c) the plot is not a natural wonder or adjacent to a natural wonder, d) the plot is not along a river, e) placing a lake at that plot will not encircle a portion of land.
    13. The seven continents are formally 'stamped', with continent names randomly chosen. Only plots that are land or a lake are stamped, as is the case in the base game map scripts.
    14. The rest of the map is generated as per usual with base game scripts. This includes cliffs, features, resources, start locations, and tribal villages. As with terrain types, I have been considering writing my own script for features but am unsure.
    On the 'to-do' list:
    • Rewrite the map script to be object-oriented.
    • Implement a resource distribution algorithm.
    • Assign major civ spawn locations to the center of each wing continent. (I haven't done this yet mostly due to resource distribution not being balanced.)
    • Assign city-state spawn locations such that there is one city-state on each wing continent and three on the Promised Land.
    Other ideas I might include:
    • Implement a terrain and feature generation algorithm. I've had the idea of having the map be a sort of 'tilted axis', where the climatic gradients (for temperature and rainfall) are radial instead of linear.
    I'll briefly discuss my ideas for resource distribution:
    • Each continent is assigned a Food and Production quota, which is the same for all wing continents but substantially higher for the Promised Land.
    • Each plot is assigned a fertility quota. The fertility of a plot is the geometric mean of the arithmetic means of Food and Production from workable plots within three tiles (I am considering reducing this to two) of that plot. By workable, I mean plots that are within three tiles from a land plot.
    • The plot fertility quota decreases on wing continents as distance from the center of the map increases. Plots near starting locations however, receive a boost to their fertility quota. Plot fertility quotas near the Promised Land are substantially higher.
    • For each continent, a linked list of the continent's plots is created, sorted by the plot's fertility quota minus the present fertility of the plot. As resources are added, nearby plots are updated and resorted.
    • Each continent is assigned luxury resources. Each wing continent will have two unique luxuries, one luxury shared with the wing continent immediately clockwise, and one luxury shared with the wing continent immediately counterclockwise. The Promised Land is assigned six unique luxuries.
    • Strategic resources are placed such that all wing continents have the same quantity of each strategic resource (will likely be a fixed value). All major civs are guaranteed one source of each strategic resource within a certain radius of their starting location.
    • For each continent, two different luxury resources assigned to that continent are placed in range of the major civ's starting location.
    • The linked lists of plots also store what resources a plot is eligible for, which takes into consideration the assignment of luxuries to each continent.
    • The 'algorithm-proper': For each continent, the most below-quota plot (i.e. the plot ranked lowest in the linked list) without a resource is identified. An appropriate resource for that plot is identified, and is placed. This process is used to place luxury resources, and then for bonus resources until the continent's Food and Production quotas are reached.
    • I am considering changing the fertility measurements to be separated into Food and Production, and for the two to be handled separately. I am also wondering if the values of resources should be adjusted according to the yields from their improvements. But that might be a bit excessive. Also, should yields other than Food and Production be considered? And how would this fit in with the fertility indices?
    Let me know your thoughts. I'll be honest; I've come pretty close to just giving up on this, and that's kind of how I feel now. Not too sure where to go from here. I really need to just rewrite the whole thing to make the code cleaner (it's very messy at the moment) and make it more object-oriented, and then focus on the resource generator. But of course that takes a lot of time. I tried rewriting it as object-oriented today, and I didn't like the way it was going. I'll admit, this is kind of the first time I've used Lua.
     
  2. KevSkegRed

    KevSkegRed Chieftain

    Joined:
    Jun 21, 2015
    Messages:
    52
    Location:
    Skegness, Lincolnshire, England
    Sounds very promising, I've enjoyed the Firaxis one but you can only take the centre and rule the continent so many times before it gets predictable and boring. Hopefully this will help, I'll give it a try and let you know if I find anything.
     
  3. KevSkegRed

    KevSkegRed Chieftain

    Joined:
    Jun 21, 2015
    Messages:
    52
    Location:
    Skegness, Lincolnshire, England
    Hmmm, tried it several times but it crashes to desktop while loading. I don't know which of my mods it conflicts with, the only mods I've got that use map scripts are Detailed Worlds and Larger Worlds and I would've thought they all work independently of each other. Is there any other type of mod that it might not play well with?? I also use TCS Omnibus Mod v1.2.3 (Complete Rules) as well as 22 other mods. If you want a full list let me know.
     
  4. NycholusV

    NycholusV Chieftain

    Joined:
    Jun 25, 2016
    Messages:
    85
    Gender:
    Male
    Location:
    Sydney, Australia
    Could you tell me what Lua files are included in Detailed Worlds and Larger Worlds? If there's any files in any of your mods that replace the base game map utilities, then that's likely causing the problem. This mod only replaces the RiversLakes.lua file for now, and I intend that it will replace none of them in the future.
     
  5. KevSkegRed

    KevSkegRed Chieftain

    Joined:
    Jun 21, 2015
    Messages:
    52
    Location:
    Skegness, Lincolnshire, England
    Detailed Worlds has RiversLakes.lua it also has FeatureGenerator, MapUtilities, MountainsCliffs, ResourceGenerator & TerrainGenerator. Larger Worlds just has AssignStartingPlots.
     

Share This Page