Civ6 modding. What is possible...

It seems that Alternative Leaders are currently restricted to just Gorgo:

Code:
for i,row in ipairs(info_results) do -- This is a hack! We need to find a better way to handle multiple civs with different leaders if (row.LeaderIcon == "ICON_LEADER_GORGO") then info.CivilizationIcon= "ICON_CIVILIZATION_GREECE_GORGO"; else info.CivilizationIcon= row.CivilizationIcon; end

This is in the civ selection file.

Also:

Code:
<Row Name="ICON_ATLAS_JADWIGA" IconSize="32" IconsPerRow="1" IconsPerColumn="1" Filename="Jadwiga32"/> <Row Name="ICON_ATLAS_JADWIGA" IconSize="45" IconsPerRow="1" IconsPerColumn="1" Filename="Jadwiga45"/> <Row Name="ICON_ATLAS_JADWIGA" IconSize="50" IconsPerRow="1" IconsPerColumn="1" Filename="Jadwiga50"/> <Row Name="ICON_ATLAS_JADWIGA" IconSize="55" IconsPerRow="1" IconsPerColumn="1" Filename="Jadwiga55"/> <Row Name="ICON_ATLAS_JADWIGA" IconSize="64" IconsPerRow="1" IconsPerColumn="1" Filename="Jadwiga64"/> <Row Name="ICON_ATLAS_JADWIGA" IconSize="80" IconsPerRow="1" IconsPerColumn="1" Filename="Jadwiga80"/> <Row Name="ICON_ATLAS_JADWIGA" IconSize="256" IconsPerRow="1" IconsPerColumn="1" Filename="Jadwiga256"/>
 
Last edited:
Just to point out that the winged hussars in the intro were probably a major wink to the fans that Poland is happening...otherwise its just plain cruel invoking images of things that can't be done in the game :(
 
This made me lol:
Code:
    <AgendaPreferredLeaders>
        <Row AgendaType="AGENDA_NUKE_LOVER" LeaderType="LEADER_GANDHI"/>
        <Row AgendaType="AGENDA_ENVIRONMENTALIST" LeaderType="LEADER_T_ROOSEVELT"/>
    </AgendaPreferredLeaders>

How exactly does the AI work in Civ 6? Are there 'flavours' for each leader as there were in Civ 5?
 
Any idea yet if it will be possible to change the max camera zoom setting? My gf found the combination of camera distance + animation style to be too busy for her, to the point of giving her a headache, and I had a bit of a poke around but my brain isn't working well enough to take it the whole way. WorldInput.lua has functions for touchpad two-finger scroll, mouse wheel and keyboard shortcut zoom which call UI.SetMapZoom after obtaining the current setting from UI.GetMapZoom. There are 3 parameters for SetMapZoom, but only the first seems to vary with any of these functions and doesn't have any check for a max zoom setting - that appears to happen in the UI.SetMapZoom function which has me feeling pessimistic.

Ok and I now got Firetuner up while typing the post to test the function, UI.SetMapZoom happily accepts commands and adjusts within values between 4.7683715820313e-07 and 0.99999952316284 (with those being max zoom in and max zoom out respectively), numbers outside this range don't generate an error, but are capped to these values. Doesn't look promising at all.
 
Seems there's very little in terms of AI stuff in the xml at least. There's some stuff in decisiontrees that looks like it would allow some kind of xml-based programming, but it almost completely incomprehensible as it lacks a lot of information for its entries. There's values, but no clue given as to what they may mean. There also doesn't seem to be nearly enough stuff in there to make me think this is actually a large part of the AI. Seems to regulate some small side things

Can't find any flavor related things on buildings/units/techs/etc, I think the AI is directly affected by yields now. Perhaps kind of like the old religion picked AI worked. This appears to indicate it'll be hard to change preferences for certain objects.

However, leaders do have their preferred buildings/techs/etc directly set. This is probably the main way we can change AI.
On top of direct preferences for single objects, I found a very hopeful item:
<Row ListType="GilgameshSciencePreference" Item="YIELD_SCIENCE" Value="10"/>
We could possibly attach these kind of things to all leaders to kind of mimic the old flavor system. And if say all leaders are undervaluing science, we could just add a bit of a preference to all of them.

Next to normal yields, they apparently use 'pseudoyields' that seem to help the AI determine what to build, which may kind of have the same effect as flavors. The values in yields.xml might be okay targets for experimentation. They seem to indicate preferences for these pseudoyields (but nothing for normal yields). They're used mostly for 'special' objects, like settlers, great people and nukes.

Yields and pseudoyields are also used in victories.xml (increases desire for certain (pseudo)yields if you're trying for a certain victory). Pseudoyields can at least be placed on units, perhaps also on buildings/techs etc, but there's no examples in the xml.
On units, there may not be a way to select the amount of the pseudoyield, it has it or it doesn't. With some luck we could use that to trick the AI into building some things more often (make the AI think a granary is a nuke, profit), but I have serious doubts on that.

Can't find much on say aggression values and how the ai determines how many and which units to produce (besides the pseudoyields)

Agendas are AI related of course and can be altered a little, mostly doesn't seem too interesting, but there's a <AiFavoredItems> table, which includes settle preferences, more yield preferences and preferences for certain diplomatic actions and some other things.

There's possibly a little more possible through sql, but from some small glances it doesn't appear there's much more in there.

So a few options here and there, it's probably possible to improve the AI somewhat once we get a grasp of proper strategy etc. But so far I do feel it's kind of limited. Especially when it comes to adding preferences for certain units/ buildings and such, and seeming lack of strategies etc.

I think we're going to have to wait until they release more tools before anything serious relating to AI can be done. They did say we could tweak AI behavior with them, so here's hoping there's something cool in there. Perhaps something with the decisiontrees?
 
Last edited:
I did some experimenting with changing colours, and changing it in the XML seems to update every case of it, in the icons and on the dawn of man screen.


This leads me to believe there are no special civ icons in civ 6, and all icons are just created in-game from the alpha and colour scheme. Perhaps not hugely groundbreaking, but it's certainly convenient and I'm proud that I made some form of discovery :p
 
That was also the case in Civilization IV, and presumably V.
 
So if I understand everything correctly there's currently no way to extract the images and textures for use outside of the game?
 
I did some experimenting with changing colours, and changing it in the XML seems to update every case of it, in the icons and on the dawn of man screen.

(snip)

This leads me to believe there are no special civ icons in civ 6, and all icons are just created in-game from the alpha and colour scheme. Perhaps not hugely groundbreaking, but it's certainly convenient and I'm proud that I made some form of discovery :p
That's actually great news. In Civ5 (and CivBE) the alpha and colour were only partially used in that they dynamically generated the city name tags and unit icons, but you still had to manually create the civ icons in various sizes and configurations.

I think Civ4 had fully dynamic generation, but then I don't recall it had civ icons per se. Only banners of sorts with the emblem of the civ on the fabric.
 
Is there a way to change unit strength? I have found the xml file with the strength values in it but it seems that whatever you put it does not work in-game. The value stays the same in-game whatever you have done to the file...
 
I'm guessing you're editing the right values but just haven't loaded the changes in correctly. Did you manage to make any change you did visible?
 
I'm guessing you're editing the right values but just haven't loaded the changes in correctly. Did you manage to make any change you did visible?
No, that's the thing :(. For some reason the changes I make in the xml file do not appear in game.
 
Sorry for the newbie question, but what about new civs? Is it possible to create custom civs at his point?
 
Alright, so further findings on AI modding possibilities.
Most of the decision making stuff we'll be able to change is found in <AiFavoredItems>. These are connected to other items through <AiLists> and <AiListTypes>

These regulate so called 'systems' (buildings/techs/yields/tactics/etc). It seems every system represents a choice that needs to be made and that these all essentially work the same way structure-wise. The entry for AiFavoredItem will tell the AI how much to favor the particular choice it is linked to.
Some of these items have an attribute called 'values' attached to them, which presumably are weights. Besides that, they can have either nothing selected or have a 'favored' boolean attached. I'm assuming this boolean just means whether the value should be positive or negative, but that could be wrong since some favoreditems have a negative value. The default here is 1.
According to the schema, if no value is attached for 'value', then the default '0' will be chosen, which happens frequently.
The point of a 0 value favor appears to just indicate to some algorithms that this particular item is a possible option in whatever context were in.
On a couple of these items, an extra string is added to further specify what's what, like indicating a certain resource type.
On a rare few, a MinDifficulty and/or MaxDifficulty have been set.
Examples:
<Row ListType="QinWonders" Item="BUILDING_GREAT_LIBRARY"/>
<Row ListType="StandardSettlePlot" Item="Coastal" Favored="false" Value="10"/>
<Row ListType="GilgameshSciencePreference" Item="YIELD_SCIENCE" Value="10"/>
<Row ListType="DefaultCitySpecialization" Item="BUILD_CITY_DEFENSES" Value="-1"/>
<Row ListType="GreatPersonObsessedGreatPeople" Item="PSEUDOYIELD_GPP_GENERAL" Value="25"/>
<Row ListType="DefaultTechBoostSupportList" Item="DEFAULT_HANDLER_OWN_TWO_UNIT_TYPES"/>
<Row ListType="PhilipForeignSettlement" Item="Foreign Continent" Favored="false" Value="20"/>

The systems I've found so far are: Buildings, Civics, Technologies, Units, Yields, Districts, PseudoYields, DiplomaticActions, PlotEvaluations, AiBuildSpecializations, TechBoosts, TriggeredTrees,
CityEvents, SavingTypes, SettlementPreferences, UnitPromotionClasses, Strategies, AiOperationTypes, Tactics, Homeland

Religion appears to have a separate but similar system.

It's rather unclear whether the weights actually do anything for every system. In a couple of systems, no weights have been added whatsoever, and in some of these, weights make little intuitive sense. Additionally, it's still unclear to me whether the weights are additive (which seems the most logical), or whether they override each other somehow. Unfortunately my game won't launch,so can't experiment much. Which happens to also be why I'm even sitting here looking through the files...

These items, can through the <AiLists> be connected to <Types> which can be attached to Agendas or Leaders. Through these we can impact build priorities etc throughout the game, but with no apparant ability to control when these appear. (This could possibly be manipulated through lua though)
The preferences can also be attached to <Strategy_Priorities>, where strategies are 'smart' objects that activate under a combination of certain conditions. The conditions are all based on the return values of dll functions. Unfortunately, looking at the cluster of functions in the dll containing these, there's not many, so this is likely to be rather limited unless some other dll functions outside of this cluster magically work as well.
Finally they can be attached to <AiOperationTypes>, which also appear to be 'smart' objects relating to unit movements. These can be attached to decision trees too. However, this approach may well be limited to unit movements only.
I don't think these latter ones will get us very far. The most reasonable approach for 'smart' behavior until we get access to the dll, is probably to use lua + sql to change the weights on favoreditems attached by default to all civs at the start of every turn. I think that would allow us to force certain decisions on a turn by turn basis. Then it would just be a matter of which dll api calls we can use.
 
Ok! Now it worked! I found out my mistake. I kept a backup of the original file in the same folder and for some reason the game took info from that file (even thought it was renamed to: units - copy.xml).

So, anyone who wants to keep a backup of the original file, just put that file to another folder entirely (even if you rename it to something different).
 
Has anyone managed to get lua files to load and run using a .modinfo? I've gathered as much that you need an xml file with a LuaContext tag, and I got that xml file to load, but haven't really gotten any further from there. Either it's not loading/running or it's not running at the right time. I can't seem to make anything visible at least. I've confirmed my code works by altering base files but can't seem to get it done with new ones
 
Last edited:
Top Bottom