basic shape of map, rest is randomized?

cknwo

Chieftain
Joined
Dec 14, 2005
Messages
68
Location
California
anyone know how to create a basic idea of a map and the game fills in the rest? much like the maps we choose like Pangaea or continents? Instead I'd like an oval layout.
 
anyone know how to create a basic idea of a map and the game fills in the rest? much like the maps we choose like Pangaea or continents? Instead I'd like an oval layout.
not a simple question, but that would be done in the GeneratePlotTypes() function of a map script, in the
Code:
        for x = 0, g_iW - 1 do
            for y = 0, g_iH - 1 do
                local i = y * g_iW + x;
loop, manually setting plotTypes to g_PLOT_TYPE_OCEAN or g_PLOT_TYPE_LAND for your map basic shape, before applying the tectonic code as usual

Code:
    local args = {};
    args.world_age = world_age;
    args.iW = g_iW;
    args.iH = g_iH
    args.iFlags = g_iFlags;
    args.blendRidge = 10;
    args.blendFract = 1;
    args.extra_mountains = 5;
    mountainRatio = 8 + world_age * 3;
    plotTypes = ApplyTectonics(args, plotTypes);
    plotTypes = AddLonelyMountains(plotTypes, mountainRatio);

and leave the map generator do everything else
 
Thanks Gedemon! I have a feeling I have no clue here. I went into my saved file from worldbuilder. I was not able to locate 'GeneratePlotTypes()' in the text file.
Do you know of any links to maps that have been already created that have what I'm looking for? It could be circle, square, rectangle... you get the idea. I like Pangea style maps however we have a multiplayer crew that want some more predictability to the map 6-8 players.
 
there are 2 types of maps: map scripts (lua files, like Pangea and Continents) and worldbuilder maps (made in WB, saved as .civ6map file)

my example was for a map script, in that case you have to code a function to create your shape.

it's possible to link an additional lua script to a .civ6map file, like the game's TSL maps to add new DLC features like Leylines to existing maps, but I've not tested it (I've never used WB maps in fact), so I'm not sure it's loaded soon enough by the game's engine to alter terrain generation (if it's after the graphical engine is loaded, the terrain change would not take effect visually before saving/reloading)
 
yep, it uses map scripts, for example here is where it set the oval in the GeneratePlotTypes function (from HBOval.lua)
Code:
    -- Create an oval in the middle of the map

    local iW, iH = Map.GetGridSize();

    -- Fill all rows with water plots.
    plotTypes = table.fill(g_PLOT_TYPE_OCEAN, iW * iH);

    
    local fracFlags = {FRAC_POLAR = true};
    
    local axis_list = {0.87, 0.81, 0.75};
    local axis_multiplier = axis_list[sea_level];
    local cohesion_list = {0.60, 0.57, 0.54};
    local cohesion_multiplier = cohesion_list[sea_level];

    local centerX = iW / 2;
    local centerY = iH / 2;
    local majorAxis = centerX * axis_multiplier;
    local minorAxis = centerY * axis_multiplier;
    local majorAxisSquared = majorAxis * majorAxis;
    local minorAxisSquared = minorAxis * minorAxis;
    for x = 0, iW - 1 do
        for y = 0, iH - 1 do
            local deltaX = x - centerX;
            local deltaY = y - centerY;
            local deltaXSquared = deltaX * deltaX;
            local deltaYSquared = deltaY * deltaY;
            local d = deltaXSquared/majorAxisSquared + deltaYSquared/minorAxisSquared;
            if d <= 1 then
                local i = y * iW + x + 1;
                plotTypes[i] = g_PLOT_TYPE_LAND;
            end
        end
    end
 
yep, it uses map scripts, for example here is where it set the oval in the GeneratePlotTypes function (from HBOval.lua)
Code:
    -- Create an oval in the middle of the map

    local iW, iH = Map.GetGridSize();

    -- Fill all rows with water plots.
    plotTypes = table.fill(g_PLOT_TYPE_OCEAN, iW * iH);

   
    local fracFlags = {FRAC_POLAR = true};
   
    local axis_list = {0.87, 0.81, 0.75};
    local axis_multiplier = axis_list[sea_level];
    local cohesion_list = {0.60, 0.57, 0.54};
    local cohesion_multiplier = cohesion_list[sea_level];

    local centerX = iW / 2;
    local centerY = iH / 2;
    local majorAxis = centerX * axis_multiplier;
    local minorAxis = centerY * axis_multiplier;
    local majorAxisSquared = majorAxis * majorAxis;
    local minorAxisSquared = minorAxis * minorAxis;
    for x = 0, iW - 1 do
        for y = 0, iH - 1 do
            local deltaX = x - centerX;
            local deltaY = y - centerY;
            local deltaXSquared = deltaX * deltaX;
            local deltaYSquared = deltaY * deltaY;
            local d = deltaXSquared/majorAxisSquared + deltaYSquared/minorAxisSquared;
            if d <= 1 then
                local i = y * iW + x + 1;
                plotTypes[i] = g_PLOT_TYPE_LAND;
            end
        end
    end
can i just copy this and slap into a generic saved world builder file? :)
 
Back
Top Bottom