I see many ppl struggling with trying to make a new civ (or alter something in an existent one). I was in same situation 2 years ago. It sums to copy & paste but you must know where to put the code (or where to get it in first place), so I throw this basic tutorial.
SEARCH
You need some handy tools for search (I use them all, and sorry I am a windows user, for mac/linux I believe there´s plenty of similar search engines):
I see many ppl struggling with trying to make a new civ (or alter something in an existent one). I was in the same situation 2 years ago. It sums to copy & paste but you must know where to put the code (or where to get it in the first place), so I throw this basic tutorial.
<TOOLS>
You need some handy tools for search (I use them all, and sorry I am a windows user, for mac/linux I believe there´s plenty of similar search/coding platforms):
Visual Studio Community (here you get the place of the game core folder as an existent website) or VSCODE (here you open a folder but save as workspace) – especially useful for direct copy & paste, having your mod in another side project in same solution/workspace
IMPORTANT NOTE: Visual Code is the most recommended since works in all systems, and I think a portable version can be found also. Nevertheless, use your preferred text editor.
AstroGrep (to find a needle in a haystack) - especially useful to find errors in logs.
My handy tool for search (to search in the database) – especially useful to know all props (columns) possible to use in your coding and to make a “macro” search by a value. Good for searching modifiers.
ModBuddy - It's the official tool for modding available with the game. With this tutorial I don't use Modbuddy!
In the end, I write only some considerations and in the future, I will add modbuddy migration section.
Paint.Net (for 2D art) - Foi making icons and leader screens. You can use Gimp for other platforms.
Here you have the references to Game, Logging and Mod files
<YOUR MOD> (different from MOD IN USE)
So for making your mod, you can have an empty folder and import it to visual studio*. See my solution with all the folders I want:
Spoiler:
* First create an empty solution and then right click in solution -> add existent web site. In VSCODE you simply open the folder and then save as workspace.
<CORE FILES>
So with our mod folder, let’s get the folders of the original game core files:
Spoiler:
The main data
<Steam Library>\steamapps\common\Sid Meier's Civilization VI\Base\Assets\Gameplay\Data
The main text
<Steam Library>\steamapps\common\Sid Meier's Civilization VI\Base\Assets\Text
So lets finally start the mod. It's like lego, you can use only a part of it if you want.
Before starting, a "little thing", I suggest XML instead of SQL because is better to read and is similar to what you find in the original files. SQL is good for more advanced stuff and I will not focus on that.
You will need to add some DATA files, XML files with the name you want, but I suggest to have some type in the end, for example, Portugal_Traits.xml
The TEXT file usually has _text added in the end and I suggest two text files, one for in-game and the other for civilopedia history.
Usually, in a xml file, any DATA file starts with <GameInfo>, and TEXT file with <GameData>.
<DATA>
You could write all your data in one file but I suggest you use a similar structure as in-game.
In a DATA folder:
Spoiler:
MyNewCiv_Civs.xml (all civs and leaders related)
MyNewCiv_Buildings.xml (districts or improvements also, depending on what you have as unique)
MyNewCiv_Traits.xml
MyNewCiv_Units.xml (not mandatory, but usually people add a new unique unit)
MyNewCiv_UnitAbilities.xml (you may need this or not, has some advanced unit abilities)
<CIVS DATA>
The types like CivilizationType and LeaderType, use to start with CIVILIZATION and LEADER respectively.
In here you define all main unique traits of civ or leader, that can also have unique units or buildings.
Spoiler:
Code:
<GameInfo>
<Types>
<Row Type="TRAIT_CIVILIZATION_YOURUNIQUECIVABILITY" Kind="KIND_TRAIT"/>
<Row Type="TRAIT_CIVILIZATION_BUILDING_YOURUNIQUEBUILDINGABILITY" Kind="KIND_TRAIT" />
<Row Type="TRAIT_CIVILIZATION_UNIT_YOURUNIQUEUNITABILITY" Kind="KIND_TRAIT"/>
<Row Type="TRAIT_LEADER_YOURUNIQUELEADERABILITY" Kind="KIND_TRAIT"/>
<!-- add more at need -->
</Types>
<CivilizationTraits>
<Row CivilizationType="CIVILIZATION_MYNEWCIV" TraitType="TRAIT_CIVILIZATION_YOURUNIQUECIVABILITY"/>
<Row CivilizationType="CIVILIZATION_MYNEWCIV" TraitType="TRAIT_CIVILIZATION_BUILDING_YOURUNIQUEBUILDINGABILITY"/>
<Row CivilizationType="CIVILIZATION_MYNEWCIV" TraitType="TRAIT_CIVILIZATION_UNIT_YOURUNIQUEUNITABILITY"/>
</CivilizationTraits>
<LeaderTraits>
<Row LeaderType="LEADER_MYNEWLEADER" TraitType="TRAIT_LEADER_YOURUNIQUELEADERABILITY"/>
</LeaderTraits>
<Traits>
<Row TraitType="TRAIT_CIVILIZATION_YOURUNIQUECIVABILITY" Name="LOC_TRAIT_CIVILIZATION_YOURUNIQUECIVABILITY_NAME" Description="LOC_TRAIT_CIVILIZATION_YOURUNIQUECIVABILITY_DESCRIPTION"/>
<Row TraitType="TRAIT_CIVILIZATION_BUILDING_YOURUNIQUEBUILDINGABILITY" Name="LOC_TRAIT_CIVILIZATION_BUILDING_YOURUNIQUEBUILDINGABILITY_NAME" Description="LOC_TRAIT_CIVILIZATION_BUILDING_YOURUNIQUEBUILDINGABILITY_DESCRIPTION"/>
<Row TraitType="TRAIT_CIVILIZATION_UNIT_YOURUNIQUEUNITABILITY" Name="LOC_TRAIT_CIVILIZATION_UNIT_YOURUNIQUEUNITABILITY_NAME" Description="LOC_TRAIT_CIVILIZATION_UNIT_YOURUNIQUEUNITABILITY_DESCRIPTION"/>
<Row TraitType="TRAIT_LEADER_YOURUNIQUELEADERABILITY" Name="LOC_TRAIT_LEADER_YOURUNIQUELEADERABILITY_NAME" Description="LOC_TRAIT_LEADER_YOURUNIQUELEADERABILITY_DESCRIPTION"/>
</Traits>
<!-- for basic and right a way mod working you dont need this -->
<!-- Advanced part where all types of search in post of tools comes handy -->
<!-- this part is to edit traits functionality, usually about civ and leader abilities because is used to put modifiers of units and buildings in their one file -->
<TraitModifiers>
</TraitModifiers>
<Modifiers>
</Modifiers>
<RequirementSets>
</RequirementSets>
<Requirements>
</Requirements>
<RequirementSetRequirements>
</RequirementSetRequirements>
<RequirementArguments>
</RequirementArguments>
<ModifierArguments>
</ModifierArguments>
<ModifierStrings>
</ModifierStrings>
</GameInfo>
<BUILDINGS DATA>
Here you define your building, keeping to attention that to make it your civ building you add the trait type at the definition of it (in this samples is TRAIT_CIVILIZATION_BUILDING_YOURUNIQUEBUILDINGABILITY)
Spoiler:
Code:
<GameInfo>
<Types>
<Row Type="BUILDING_YOURUNIQUEBUILDING" Kind="KIND_BUILDING"/>
</Types>
<Buildings>
<Row BuildingType="BUILDING_YOURUNIQUEBUILDING" Name="LOC_BUILDING_YOURUNIQUEBUILDING_NAME" PrereqDistrict="DISTRICT_CITY_CENTER" PurchaseYield="YIELD_GOLD" Cost="1" AdvisorType="ADVISOR_GENERIC" PrereqCivic="CIVIC_CONSERVATION" TraitType="TRAIT_CIVILIZATION_BUILDING_YOURUNIQUEBUILDINGABILITY" />
</Buildings>
<BuildingReplaces>
<Row CivUniqueBuildingType="BUILDING_YOURUNIQUEBUILDING" ReplacesBuildingType="BUILDING_MONUMENT"/>
</BuildingReplaces>
<BuildingPrereqs>
</BuildingPrereqs>
<Building_ValidTerrains>
</Building_ValidTerrains>
<Building_YieldChanges>
<Row BuildingType="BUILDING_YOURUNIQUEBUILDING" YieldType="YIELD_CULTURE" YieldChange="1"/>
<Row BuildingType="BUILDING_YOURUNIQUEBUILDING" YieldType="YIELD_FAITH" YieldChange="1"/>
</Building_YieldChanges>
<Building_GreatPersonPoints>
<Row BuildingType="BUILDING_YOURUNIQUEBUILDING" GreatPersonClassType="GREAT_PERSON_CLASS_PROPHET" PointsPerTurn="1"/>
</Building_GreatPersonPoints>
<!-- for basic and right a way mod working you dont need this -->
<!-- Advanced part where all types of search in post of tools comes handy -->
<!-- this part is to edit abilities functionality of buildings only -->
<Modifiers>
</Modifiers>
<ModifierArguments>
</ModifierArguments>
<BuildingModifiers>
</BuildingModifiers>
<RequirementSets>
</RequirementSets>
<RequirementSetRequirements>
</RequirementSetRequirements>
<RequirementArguments>
</RequirementArguments>
<Requirements>
</Requirements>
</GameInfo>
Districts and improvements are pretty similar.
<UNITS DATA>
Here you define your unit, keeping to attention that to make it your civ/leader unit you add the trait type at the definition of it (in this sample is TRAIT_CIVILIZATION_UNIT_YOURUNIQUEUNITABILITY).
Advanced unit abilities are usually defined on unitabilities.xml with the definition of an ability class (see tags).
Usually, there´s two types of text, the text of our DATA and Civilopedia Text (usually for history purposes).
One note, I´m not covering different languages, that can easily be added later on.
<TEXT of DATA>
Here we define LOC_ arguments present in DATA files.
You can define the text in the DATA file directly but if later you want to add another language you have to change to LOC_ to work out.
Spoiler:
Code:
<GameData>
<BaseGameText>
<Row Tag="LOC_TRAIT_CIVILIZATION_YOURUNIQUECIVABILITY_NAME">
<Text>My Ability name</Text>
</Row>
<Row Tag="LOC_TRAIT_CIVILIZATION_YOURUNIQUECIVABILITY_DESCRIPTION">
<Text>My Ability does... things in game...</Text>
</Row>
<Row Tag="LOC_UNIT_YOURUNIQUEUNIT_NAME">
<Text>My unique unit name</Text>
</Row>
<Row Tag="LOC_UNIT_YOURUNIQUEUNIT_DESCRIPTION">
<Text>My unique unit does ...things in game...</Text>
</Row>
<!-- define more text.... -->
</BaseGameText>
</GameData>
<CIVILOPEDIA TEXT>
The civilopedia text has a tricky part, you have to start with the right parameter, for instance, LOC_PEDIA_UNITS_PAGE (if buildings change to BUILDINGS, etc), then concatenate with you unit type (building type, etc), and finally define chapter number (defines the order, and you can add whatever paragraphs you want) => LOC_PEDIA_UNITS_PAGE_UNIT_YOURUNIQUEUNIT_CHAPTER_HISTORY_PARA_1
Spoiler:
Code:
<GameData>
<BaseGameText>
<Row Tag="LOC_PEDIA_UNITS_PAGE_UNIT_YOURUNIQUEUNIT_CHAPTER_HISTORY_PARA_1">
<Text>
MY unique unit paragraph 1
</Text>
</Row>
<Row Tag="LOC_PEDIA_UNITS_PAGE_UNIT_YOURUNIQUEUNIT_CHAPTER_HISTORY_PARA_2">
<Text>
MY unique unit paragraph 2
</Text>
</Row>
<!-- define more text.... -->
</BaseGameText>
</GameData>
The mod look and feel can be hard to achieve, that´s why I leave the art to the end, but at first glance, you can reuse game contents, with similar stuff you want. You can look into my Portugal mod Version 16.4 beta (This mod version is my latest version where I don't use modbuddy) for Art and artdefs examples, along with icons definition part, and finally the trickier part about Leader screens.
<ART>
Here I talk about making your own 2D icons and leader screens. Icons have many sizes I can't spell all dimensions needed, but bellow all of them thanks to @ChimpanG´s Quick Reference for Icon Sizing:
I advise you to use other mods or templates, like mine above, and open each DDS file in paint.net:
- Copy and paste your own icon or image there,
- Save as, Renaming the file to your own, saving DDS as B8G8R8A8 format.
<ICONS>
You can reuse icons or you can make your own as explained in the above section. In the last case, you have to add your custom DDS into IconTextureAtlases.
Icon type has a tricky part, you have always to start with ICON and then concatenate with your unit type name => "ICON_UNIT_YOURUNIQUEUNIT
For starting you don't need to define your own icons just reuse existent ones (copied from game core icons file, Atlas argument). If you define your Atlas just add above IconTextureAtlases and link to your Atlas (example: ICON_ATLAS_CIVILIZATION_PORTUGAL. you can see more examples in UI folder of my mod above). Unless you have multiple images in your DDS file index is always equal to "0".
Spoiler:
Code:
<GameInfo>
<IconTextureAtlases>
<!-- to define your own icon atlas -->
</IconTextureAtlases>
<IconDefinitions>
<Row Name="ICON_UNIT_YOURUNIQUEUNIT" Atlas="ICON_ATLAS_UNITS" Index="19"/>
<!-- define more as necessary -->
</IconDefinitions>
</GameInfo>
<ARTDEFS>
Artdefs are about animations in-game, so it is not that easy to make your own. Once more you reuse existent ones.
There is a catch, for instance, if you want to use a building as an improvement no can do; or a Wonder like a building also cant be done, besides all belonging to buildings table in this last case.
Important note: In the case of artdef files you must maintain the original names (including its folder: ArtDefs), for example, units.artdef, and in case of a new civ you always need at least civilizations.artdef. Civilization. To make an artdef you copy easily from any mod.
You copy all elements and rename to yours at the end (with your type name), I show an example of the units.artdef (you can see examples of improvements and districts in my mod above), I copy UNIT_SCOUT and modify in the and to UNIT_YOURUNIQUEUNIT.
Since I don't use modbuddy to make this mod, this is the trickier part, because leader screens being associated with two main artdefs (that I did not mention above yet) Leaders.artdef and FallbackLeaders.artdef.
For these screens to work, I found a solution at Sikh Civilization mod where we reuse these two files making modifications to have our Leader(s).
I don't remember if I did some modification or not of the above mod files, but you can see my mentioned version of the mod that also to replicate these files.
But at the time there were two limitations without using modbuddy:
- At the start screen choosing your leader, you may see question marks instead. At the time I implemented this tool to copy icon configuration files to system game core folder, needed to show up your leader face and other icons. But if you run your mod, exit to the main menu, and enter again, icons there also. Don't know if works yet, have to retest it
- Diplomacy screen had Cleopatra in there, so I implemented a workaround, I added my leader image to the background, more to the middle, Cleopatra seemed to be telling the story of that leader, like a scholar. Don't know if still occurs, have to retest it.
It is not required to use but can come handy to make some functionality from coding script LUA instead of modifiers and such, you can choose your best option. I usually use modifiers, but when something can't be done past various iterations I part to LUA Coding.
<LUA>
Seems complex, but if you follow a script and with the help of community you can do somethings happen
The Lua script is a file like any other that is to contain Lua scripts and watching many mods out there I noticed a good pattern:
- First include the Lua systems, that for starters are almost everytime the same.
- Then some vars you need, like the ID for your unique stuff
- Write your functionality in any functions you want
- Launch an Event with your main function
Spoiler:
Code:
--===================================================================================================================================================
-- MY MOD LuA Scripts
--==================================================================================================================================================
-- INCLUDES
--==========================================================================================================================
include("Civ6Common.lua")
include("AdjacencyBonusSupport.lua")
print("Entering lua for mod events")
--==========================================================================================================================
-- Variables
--==========================================================================================================================
local MyBuilding = GameInfo.Buildings["BUILDING_YOURUNIQUEBUILDING"].Index;
local t1 = GameInfo.Terrains["TERRAIN_GRASS"].Index
local t2 = GameInfo.Terrains["TERRAIN_PLAINS"].Index
local t3 = GameInfo.Terrains["TERRAIN_DESERT"].Index
local t4 = GameInfo.Terrains["TERRAIN_TUNDRA"].Index
local t5 = GameInfo.Terrains["TERRAIN_SNOW"].Index
--==========================================================================================================================
-- Actual Function
--==========================================================================================================================
--Placebuilding from LEEs Building Subsystem
function PlaceBuildingInCityCenter(pCity, iBuilding)
local iCityPlotIndex = Map.GetPlot(pCity:GetX(), pCity:GetY()):GetIndex()
if not pCity:GetBuildings():HasBuilding(iBuilding) then
pCity:GetBuildQueue():CreateIncompleteBuilding(iBuilding, iCityPlotIndex, 100);
else
if pCity:GetBuildings():IsPillaged(iBuilding) then
pCity:GetBuildings():SetPillaged(iBuilding, false)
end
end
end
-- Place my new building on city when is constructed, for my new civ leader
function OnCityInit(iPlayer, iCity, iX, iY)
dPlayer = Players[iPlayer]
dCity = dPlayer:GetCities():FindID(iCity)
local playerConfig:table = PlayerConfigurations[iPlayer]
local sLeaderName = playerConfig:GetLeaderTypeName()
if (sLeaderName == "LEADER_MYNEWLEADER") then PlaceBuildingInCityCenter(dCity, MyBuilding) end
end
--LAUNCH HERE
Events.CityInitialized.Add(OnCityInit);
--==============================================================================================================================
--==============================================================================================================================
<EVENTS>
When you have some functionality to add in LUA, you have to choose the right event, on available ones! You can find these events in LUA game original files but also see references made available by the community, for instance: https://forums.civfanatics.com/threads/lua-objects.601146/
If you noticed event has only a main function, its a function as any other but with a specific event you have "automatic arguments" that you can use to fetch information, in the code above (iPlayer, iCity, iX, iY) arguments are available in CityInitialized event. The function can have the name you want, like any other function but you inherit the event´s arguments.
Some Examples. Two events I am working on to add to my Portugal mod
Spoiler:
Code:
--LAUNCH HERE
Events.CityInitialized.Add(OnCityInit);
Events.UnitMoved.Add(OnPortugueseShipMoved);
For config, you will need to set players for your leader to be chosen from the start screen, and modinfo to install your stuff to make mod run.
<PLAYERS>
This XML file is usually added in the <DATA> folder.
In <Players> you add your leader and all the arguments necessary, the civ trait, leader trait, and so on. In <PlayerItems> you post the unique items detail and match to the leader, along with the order on the screen.
If you notice the line is replicated, to your mod to be compatible with R&F expansion you replicate all in this file, and in the duplicated row add Domain="Players:Expansion1_Players", this way is available in vanilla and expansion as well.
The modinfo is a very important part since you have to write it properly to your mod to work.
You gather the location of your files and post there in <Files> (all files, independent of their location, but not artdefs) but for the game to work with your unique stuff you have to add FrontendActions and InGameActions
If you notice you don't put artdefs in modinfo file because they are present in your DEP file. Dep File must have your mod ID also, like modinfo above, and must have all artdefs you are customizing in your mod.
You can replicate a dep file of other mod if this mod for instance uses unique buildings or units like you (my Portugal mod as examples of units, districts, improvements, and wonders), but you have to alter the ID to yours generated above. Usually, you don't change this file too often, only when you add a different kind of animation, for example, wonders.
<MODBUDDY>
Im not focusing on ModBuddy but some considerations and how to config your mod this way (you may want to do it if you want to add the art properly in future, or for other reasons)
Modbuddy generates Modinfo automatically, but you have to add FrontendActions and IngameActions in Properties of the Modbuddy project. Also in project properties, you define expansions compatibility.
if you want to migrate to Modbuddy, create an empty mod in modbuddy, and add all the files you had done already, I suggest starting a blank project, then put your files in the new project file location, and finally in Modbuddy add existent files. For further steps of ModBuddy migration see here.
"
(...)
3) Drop your mod folder into your mods directory. This is typically located in
.../Documents/My Games/Sid Meier's Civilization VI/
The final file path should be something like .../Documents/My Games/Sid Meier's Civilization VI/Mods/MyFirstMod/MyFirstMod.modinfo
Do not replace the game files in the steam folder with a mod
4) Launch the game. Go to additional content and click to enable the mods you want if they are not already enabled.
(...)
"
Note: Modbuddy "build project" does step 3 automatically.
Finally, when you run the game, some errors can occur or items could not appear, refer to <LOGS> in this page to know how to find errors.
I reinforce that this is a Basic tutorial when you want to start a new civ and don´t know-how, this is the place. Also, a place to clarify some doubts in one file or thematic.
It is also a live tutorial, post your questions and doubts, and I will clarify and modify the tutorial as necessary.
I have Civ V and BE-RT. When you try to load to SDK for either, you the message "Visual Studio 2010 Isolated Shell Redistributable is required to run this application". 2010 is no longer available and I do not have Civ VI. There are over 50 Visual Studio apps, and I don't know which I need.
I dont know any app for civ 6 unless is modbuddy along sdk, that comes with game. If you dont have the game you have to edit manually, thats what this tutorial is about.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.