[BNW] Adding a map size

Iconian

Chieftain
Joined
May 16, 2021
Messages
73
I recently created a couple mods that changed the attributes of the "Huge" map size via the "Worlds" file in GameInfo. However, what I actually want is to create an entirely new map size. So I attempted to do so, but discovered that the on the Setup screen, when I went to choose map size, my new map size didn't show up. The display box for the map size isn't large enough to show anything beyond the default sizes . . . so I figured I would try to increase the size of the "Choose Map Size" box.

That led me to using Agent Ransack to look through the files for stuff related to the maps, and I found what I believed to be the pertinent files in Assets>UI>FrontEnd>GameSetup, in the two SelectMapSize files.

So I added the two files to my mod and activated them on the Actions and Content tabs.

I then changed this line in the xml file:

<Container Size="1024,700" Anchor="c,c" >

to

<Container Size="1400,700" Anchor="c,c" >


And this one in the lua file:

Controls.ScrollPanel:SetScrollValue( 0 );

to

Controls.ScrollPanel:SetScrollValue( 1 );


As so much of interaction with the game's files has been, this was just guesswork on my part.


Suffice to say that it didn't work. When I loaded up the game and started my mod, the "Choose Map Size" box was unchanged as far as I could tell.


So I'm really not sure where to go from here. Has anyone else attempted to add new map sizes? Does anyone know what settings I might need to change?
 
Hi Iconian
I didn't make new size type for Civ V, but I did that for Beyond Earth in Anchor Ceti and can share some experience.
Oh, and I watched your Fantastic Ancients logo till the end. :egypt: Impressive

Firstly about containers.
I then changed this line in the xml file:

<Container Size="1024,700" Anchor="c,c" >

to

<Container Size="1400,700" Anchor="c,c" >


And this one in the lua file:

Controls.ScrollPanel:SetScrollValue( 0 );

to

Controls.ScrollPanel:SetScrollValue( 1 );
Usually they are autoscalled in lua scripts. In that case changing size in XML will do nothing.

To make new map size type there is few "simple" steps.
1. To make new size type it needs to be declared in database
Code:
<GameData>
    <Worlds>
        <Row>
            <Type>WORLDSIZE_HUGE</Type>
            <Description>TXT_KEY_WORLD_HUGE</Description>
            <Help>TXT_KEY_WORLD_HUGE_AC_HELP</Help>
            <GridWidth>128</GridWidth>
            <GridHeight>80</GridHeight>
            <DefaultPlayers>12</DefaultPlayers>
            <TargetNumCities>8</TargetNumCities>
            <EstimatedNumCities>120</EstimatedNumCities>
            <NumCitiesUnhealthPercent>70</NumCitiesUnhealthPercent>
            <NumCitiesPolicyCostMod>7.5</NumCitiesPolicyCostMod>
            <NumCitiesTechCostMod>3.75</NumCitiesTechCostMod>
            <TerrainGrainChange>1</TerrainGrainChange>
            <FeatureGrainChange>1</FeatureGrainChange>
        </Row>
    </Worlds>
</GameData>

2. Then, to work properly with new map size type, MapGenerator script system should be prepared.
For BE that is the list of files where WORLDSIZE type associations should be extended for new one.
RiverGenerator.lua
MultilayeredFractal.lua
FractalWorld.lua
FeatureGenerator.lua
AssignStartingPlots.lua
PangaeaWorld.lua
FourContinentsWorld.lua
ContinentsWorld.lua

3. And last goes map file itself. It needs to be prepared for condition when user choose new map size type option variant.
Changes may vary depends on code style of map script.
 
Top Bottom