How to import a Civ5 map to Civ6 using Zobtzler's YnABMC and YnAMP

Gedemon

Modder
Super Moderator
Joined
Oct 4, 2004
Messages
11,586
Location
France
  • Prerequisite

  • 1/ Launch Civ5 and a game with the map you want to convert
Remember to set "EnableTuner = 1" and "LoggingEnabled = 1" in the "\Documents\My Games\Sid Meier's Civilization 5\config.ini" file first. To quickly switch between civ5 and the FireTuner, I'd suggest you set the game's graphic option in windowed mode.

Spoiler Set up game :
Clipboard-1.jpg


Make sure to really Enter the game after loading (the Firetuner Lua Console is locked until you pass the presentation screen)

  • 2/ Launch Civ5 Firetuner

Spoiler Firetuner :
Clipboard-2.jpg


If it's the first time you launch the Tuner, you may not have the same screen, just the "Lua Console" tab, but the others are not required for the current usage.

  • 3/ Click "New Panel"

Then find and check InGame (you can resize the "Panel Builder" windows), fill the "Name" (for example "Export Map" and click "OK"
Spoiler Panel Builder :
Clipboard-3.jpg


  • 4/ Click "New Control" drop down menu

Spoiler Action Builder :
Clipboard-4.jpg


Select "Action Control", set the name of the button (for example "Export to Lua"), then in the "Action" entry copy and paste the code below:

Code:
    local g_iW, g_iH = Map.GetGridSize()
    for iY = 0, g_iH - 1 do
        for iX = g_iW - 1, 0, -1  do
            local plot = Map.GetPlot(iX, iY)
            local NEOfRiver = 0
            local WOfRiver = 0
            local NWOfRiver = 0
            if plot:IsNEOfRiver() then NEOfRiver = 1 end -- GetRiverSWFlowDirection()
            if plot:IsWOfRiver() then WOfRiver = 1 end -- GetRiverEFlowDirection()
            if plot:IsNWOfRiver() then NWOfRiver = 1 end -- GetRiverSEFlowDirection()
            local endStr =""
            if plot:IsLake() then endStr = " -- Lake" end
            print("MapToConvert["..plot:GetX().."]["..plot:GetY().."]={"..plot:GetTerrainType()..","..plot:GetPlotType()..","..plot:GetFeatureType()..","..plot:GetContinentArtType()..",{{"..NEOfRiver..","..plot:GetRiverSWFlowDirection().. "},{"..WOfRiver..","..plot:GetRiverEFlowDirection().."},{"..NWOfRiver..","..plot:GetRiverSEFlowDirection().."}},{"..plot:GetResourceType(-1)..","..plot:GetNumResource().."}}"..endStr)
        end
    end

then press "OK" and press the "Export to Lua" button you've just created. The export process can take some time depending on your computer and software, you can follow it in the Lua Console tab.
Spoiler Lua Console tab :
Clipboard-6.jpg

When it's done the last line on the Lua console should show something like
Code:
[1259235.656] InGame: MapToConvert[0][79]={5,3,0,4,{{0,-1},{0,-1},{0,-1}},{-1,0}}
With the first value at [0] and the second value ([79] in this example) a number that should be the map height - 1 (the example map size was 128x80)

  • 5/Exit the game

That's an important step as the YnABMC tool will need to access civ5 Lua.log and that file is locked when civ5 is running.

  • 6/ Launch YnABMC.exe

Check the advanced box, then click "Select .log File"

Navigate to your civ5 logs folder (usually "..\Documents\my games\Sid Meier's Civilization 5\Logs\"), select the Lua.log file and click "Open"

Fill the "Project Name" and "Author", then input your Mod ID (or generate a new one for a new project)

Note that if you plan to update a project you've created, you have to use the same Mod ID as the previous export, else you won't be able to load your previously saved game with the old project.

Check the options you want to see on the map setup screen then press "Generate Map"

About the TSL option, the tool will create an empty Map.xml file in your project's Map folder if you've checked the "Map Support TSL" box, but you'll need to fill it manually following the instruction here.

YnABMC can generate cliffs automatically for your map (there is no cliffs on Civ5 maps), you just need to check the "Generated" option in front of "Cliffs"

Spoiler YnABMC :
Clipboard-7.jpg


  • 7/ Move your project to the Civilization 6 Mods folder

You'll find your project folder in the logs folder (usually "..\Documents\my games\Sid Meier's Civilization 5\Logs\"), you need to copy it in the Civ6 mods folder (usually "..\Documents\my games\Sid Meier's Civilization VI\Mods\")

  • 8/ Launch Civilization 6

Go to the "Additional Content" menu and check that your mod is listed there and enabled. YnAMP should be enabled to.

Spoiler Additional Content menu :
Clipboard-8.jpg


  • 9/ Play the map

Go back to the Main Menu, then Create a new game and select the converted map. Enjoy !

Spoiler Play ! :
Clipboard-9.jpg
 
Last edited:
You can open the maps with the civ 6 worldbuilder, make your changes, the export it from the ESC menu, use the YnABMC tool to import the civ 6 Lua.log file, and recreate the map!
 
Yea boi. Gonna give this a go and convert myself a huge Earth map.

Are you planning on making a tutorial on how to make tweaks to maps once they're converted?
I'm writing the same tutorial for putting civ6 maps in a mod from a running game or the World Builder.
 
Got my own conversion of Huge Earth working, however I've run into a problem where city states are relocated to other starting positions when they are unable to use their set one rather than automatically being removed from the game - how do I get this to work on my map?
 
Got my own conversion of Huge Earth working, however I've run into a problem where city states are relocated to other starting positions when they are unable to use their set one rather than automatically being removed from the game - how do I get this to work on my map?
It's the AlternatePlacement config parameter which control that, it shows as the "Allow random placement for civs without TSL" checkbox in the advanced setup screen.

I think you can change the default value to be "false" in an XML file in an <UpdateDatabase> in <FrontEndActions> with a <LoadOrder> above 1 using this code:
Code:
<GameInfo>
    <Parameters>
        <Update>
            <Where ParameterId="AlternatePlacement"/>
            <Set DefaultValue="0"/>
        </Update>
    </Parameters>
</GameInfo>
 
It's the AlternatePlacement config parameter which control that, it shows as the "Allow random placement for civs without TSL" checkbox in the advanced setup screen.

I think you can change the default value to be "false" in an XML file in an <UpdateDatabase> in <FrontEndActions> with a <LoadOrder> above 1 using this code:
Code:
<GameInfo>
    <Parameters>
        <Update>
            <Where ParameterId="AlternatePlacement"/>
            <Set DefaultValue="0"/>
        </Update>
    </Parameters>
</GameInfo>

Worked nicely! I'm doing a test game now to see how it plays. Might post it on here for others to use as well.
 
Top Bottom