Custom Civilization - ModBuddy template

Custom Civilization - ModBuddy template 2.4

Also, when I build the solution (without changing the template), I get two errors:

EXEC(0,0): error asset: (UIErrorTexture)
EXEC(0,0): error asset: (UIErrorTexture)

what is going on here?

I believe the OlmecAtlas.xlp needs the forward slash added between the 'UI and Texture':
<m_ClassName text="UI/Texture"/>

Maybe this creates another issue, but it seems to fix the build.
 
Add me to the list that it anxious to see an update that includes custom (2d) art and explains XLPs, compiling options, etc. I did some modding in Civ4 and then used ModBuddy to make a couple of Civ6 vanilla mods (using Josh Atkins' template/instructions) early on, but I'm revisiting after a big break and wanted to follow an updated template that used sql like yours. I've been trying to piece together elements from Josh's, raen's, and yours, but I'm basically stuck at this point with no build errors but not seeing my mod in the game (regardless of standard or R&F rules). I did piece together a more xml-dependent mod that shows up (but crashes the game after the leader load screen is displayed), but I'd rather stick with the sql template here.

Duly noted! I am going to re-engage with my Civ VI activities in the coming days/weeks. I will definitely sink some of that time into getting a new version of this template uploaded - which I anticipate will cover 2D art, too. I am no artist, though - but I'll ensure it goes as far as I can make it go.

the_jp said:
1. When I "rebuilt" my custom images using the Asset Editor to produce the tex files, I noticed the resulting tex files referenced the original image's height/width (though the actual image sizes were correct); I assumed this was an issue and went through the process again using the 'ResizeToTarget' option to correct. Was this necessary, or will this actually create problems...or were there other options I should have selected before saving?

I have never had to use any ResizeToTarget option - I have always ensured the image (DDS) is the size I want it to be in-game, so that the TEX file produced captures the right dimensions. To clarify - the size in the TEX file matches the size of the source DDS image used to produce that TEX file. In my workflow, that is correct and what I would want. I have not experimented with using TEX files to dynamically resize an image to save having different-sized versions of the same artwork - I just create a DDS for each size (if that is what you were aiming to do). I'm not sure I understand what the 'original image' is in the context of your query - apologies!

the_jp said:
2. I followed the instructions in this thread to remove the unique unit abilities, as I want to use my mod with both standard and R&F rules. I also attempted to add a custom building to replace the new civ's monument with a newly-named monument with modifiers, but I'm not sure I did that quite right. I think when using xml, this requires adding a Buildings.xml and then a Buildings.artdef file that includes the element code with the updated building name reference at the end, but I assume using a Civilization_UB.sql file can accomplish the same thing. If so, would the template closely resemble the Civilization_UU.sql file? (If someone wants to share an example, great.)

Did the instructions work to get the template working with vanilla? If so, great. If not, please let me know - and share your code - and I can advise further.

Regarding a custom building - the principle is the same as for any kind of Unique Infrastructure. Of course, the data tables and attributes you'll use will vary depending on what the 'thing' is (Building vs. Improvement, for example). One thing to note, file names are not important. It's what is inside them that counts. This is true for both SQL and XML. I will share with you - this evening - an example file that contains a custom (replacement) building I have from another of my works. I will be writing in to the template an example building - though this template intends to teach the principles rather than provide every conceivable example. In lieu of me sharing a file, the steps I take are:

1. Find a base-game 'thing' that is the same structurally (in your case, you're looking for a civilization-specific unique building that replaces a common building - plenty of those).

2. Find it in the base-game Buildings.xml and note the element name (e.g. BUILDING_FILM_STUDIO). Work backwards to find the first place it is defined in the base-game code (from memory, probably an entry in a Types table, or similar).

3. If you then do searches (across all game-files) on every element that is referenced in each bit of code you find, you eventually reach the end - and what you have extracted is all of the code related to that 'thing'.

4. To recreate that thing, you'd put all of that code into a file in your mod. Of course, you may need to adjust to ensure correct syntax - or re-write into SQL if that's what you're going to use.

It's the process I went through and is essentially how I built my template - originally, I wrote the notes for myself as I didn't want to have to go through that every time! As mentioned, I will definitely share but it's just in case you - or others - want to beat me to it for your own needs.

the_jp said:
3. Is there a good breakdown somewhere of frontend and in-game mod property options?

I think LeeS' Modding Guide probably has this all defined - if anywhere does, it'll be there. https://forums.civfanatics.com/threads/lees-civilization-6-modding-guide.644687/

Even if it isn't in there, that document is worth reading if you're interested in modding. I see @LeeS as the authority on this stuff.

the_jp said:
And am I missing something about how to select multiples file for the import option? (I did that manually for the frontend side and then did a copy/paste for the in-game portion to save myself some time.)

You're not missing anything. It's a painful, one-file-at-a-time process within ModBuddy. I hate it.

the_jp said:
One suggestion: maybe list out each exact find/replace-all text string with definitions. I don't know about other modders, but I find myself second-guessing these at times, so if there was a list somewhere, that would be ideal...

You know, I considered this. But, actually, from my experience with other templates - find-and-replace causes more problems than it solves. It also doesn't teach - so my advice for someone using my template to build their own civilization is very much not to find-and-replace, but rather to step-through-and-learn.

I do, however, take the point that defining the various element strings makes sense. However, I feel like the template does that through the notes - it just doesn't put them all in one place - mainly to discourage find-replace modding. I note your feedback, but at this time I think I will respectfully disagree and maintain the definitions as they are - part of the 'help notes'.

As per my description in the resource posting - which perhaps I should include in the project - the definitions come with more hefty notes in the 'first files' you work through; the idea being that as you step through the other files you become naturally familiar with what everything is.

the_jp said:
I'm not sure why civs and leaders have the author's initials but units, abilities, etc. do not, and I would also think the texture files (dds/tex) would follow the same naming conventions, but maybe there are good reasons for this. I've been out of the modding game a good while, so I'm speaking out of ignorance.

Inconsistency with including my initials versus not is entirely on me. I think I followed the 'general conventions', but perhaps not very well. Indeed, I don't even work like that any more - I know append my initials into every newly-defined thing - so I will definitely revisit this. This way, I can support a simple 'search for _MC to find every thing this template adds to the base-game' instruction.

Finally, from your follow-up post:

the_jp said:
I believe the OlmecAtlas.xlp needs the forward slash added between the 'UI and Texture':
<m_ClassName text="UI/Texture"/>

Correct. An oversight in my initial template - the new version will correct this. I don't even know how I managed to publish with it, to be honest. Schoolboy error.
 
I have never had to use any ResizeToTarget option - I have always ensured the image (DDS) is the size I want it to be in-game, so that the TEX file produced captures the right dimensions. To clarify - the size in the TEX file matches the size of the source DDS image used to produce that TEX file. In my workflow, that is correct and what I would want. I have not experimented with using TEX files to dynamically resize an image to save having different-sized versions of the same artwork - I just create a DDS for each size (if that is what you were aiming to do). I'm not sure I understand what the 'original image' is in the context of your query - apologies!

Thanks for clarifying on the Asset Editor; I think that proves I must have made a mistake somewhere along the way with my art files; I was using some of my old work, so I think I just need to re-create my dds files. (I was pretty certain the dds files were correct in size before I imported them into AE, but maybe I only checked a couple that happened to be correct.)

Did the instructions work to get the template working with vanilla? If so, great. If not, please let me know - and share your code - and I can advise further.

I can't report on this just yet. I reverted back to a previous copy of my mod where I had not made these changes; I'm now leaning toward having a unique unit but not granting it dlc-dependent functionality.

Regarding a custom building - the principle is the same as for any kind of Unique Infrastructure. Of course, the data tables and attributes you'll use will vary depending on what the 'thing' is (Building vs. Improvement, for example). One thing to note, file names are not important. It's what is inside them that counts. This is true for both SQL and XML. I will share with you - this evening - an example file that contains a custom (replacement) building I have from another of my works. I will be writing in to the template an example building - though this template intends to teach the principles rather than provide every conceivable example. In lieu of me sharing a file, the steps I take are:

1. Find a base-game 'thing' that is the same structurally (in your case, you're looking for a civilization-specific unique building that replaces a common building - plenty of those).

2. Find it in the base-game Buildings.xml and note the element name (e.g. BUILDING_FILM_STUDIO). Work backwards to find the first place it is defined in the base-game code (from memory, probably an entry in a Types table, or similar).

3. If you then do searches (across all game-files) on every element that is referenced in each bit of code you find, you eventually reach the end - and what you have extracted is all of the code related to that 'thing'.

4. To recreate that thing, you'd put all of that code into a file in your mod. Of course, you may need to adjust to ensure correct syntax - or re-write into SQL if that's what you're going to use.

It's the process I went through and is essentially how I built my template - originally, I wrote the notes for myself as I didn't want to have to go through that every time! As mentioned, I will definitely share but it's just in case you - or others - want to beat me to it for your own needs.

Below is what I have currently (though with my actual civ and building names replacing "EXAMPLECIV" and "UNIQUE_MONUMENT"), and I have a few issues so far:
  1. EDIT: FIXED Both the regular monument and this unique monument can be built, but my intention was for the unique monument to replace the regular one for my custom civ
  2. EDIT: FIXED Both the regular monument and this unique monument can be built by other civilizations, which I did not intend; I randomly tested with two other built-in civs, with Alexander able to build the unique monument but Trajan not. (Incidentally, the yield cost and the yield changes applied to both my unique civ and for Alexander, but the barb damage modifier only applied to my custom civ. EDIT: I was originally inserting into the TraitModifiers table instead of the BuildingModifiers table, so this is partly fixed. I don't know that I'll keep this modifier; I'd like to figure out how to make the modifier only apply once instead of compounding it each time a new city builds it, but I'm not sure if that's possible.)
  3. EDIT: FIXED The leader selection screen does not display the unique building, but the loading screen does. I think my localisation file/reference/text is correct; to clarify, the leader-selection screen shows nothing about the unique building.
  4. EDIT: FIXED The icon for the unique building is not being displayed. I created a Buildings.artdef, thinking that would be needed, and I'll post that below my Civilization_UB.sql code. Was that needed, and if so, when I add a artdef file, does the UpdateArt actions (which just point to the Mod Art Dependency File) pick those up automatically so that the next build includes them?
I worked through my various code issues across several files. I can add back my updated code and associate files if anyone else runs into similar issues. The LeeS guide helped me fill in some gaps, and I referenced raen's Portugal mod to compare and adjust too.


I think LeeS' Modding Guide probably has this all defined - if anywhere does, it'll be there. https://forums.civfanatics.com/threads/lees-civilization-6-modding-guide.644687/

Even if it isn't in there, that document is worth reading if you're interested in modding. I see @LeeS as the authority on this stuff.

Thanks. I'll check this out as I start re-creating my art. I seem to remember having to white-out some images so the game can insert its colors, etc., and it was all a bit tedious, so I've been putting that off.

You're not missing anything. It's a painful, one-file-at-a-time process within ModBuddy. I hate it.

Thanks for confirming. I'll probably use Excel to stage a copy/paste into the file directly. I can see where this would turn some modders (with lots of custom art) off from ModBuddy.

You know, I considered this. But, actually, from my experience with other templates - find-and-replace causes more problems than it solves. It also doesn't teach - so my advice for someone using my template to build their own civilization is very much not to find-and-replace, but rather to step-through-and-learn.

I do, however, take the point that defining the various element strings makes sense. However, I feel like the template does that through the notes - it just doesn't put them all in one place - mainly to discourage find-replace modding. I note your feedback, but at this time I think I will respectfully disagree and maintain the definitions as they are - part of the 'help notes'.

As per my description in the resource posting - which perhaps I should include in the project - the definitions come with more hefty notes in the 'first files' you work through; the idea being that as you step through the other files you become naturally familiar with what everything is.

I definitely see your point about urging others to learn from the template, and it has been both a great refresher for me and an invaluable resource for leveraging sql instead of straight xml. It's very easy to miss things by simply copying and pasting, and I agree that it doesn't teach people what they need to know to progress. I completely respect your approach.

Inconsistency with including my initials versus not is entirely on me. I think I followed the 'general conventions', but perhaps not very well. Indeed, I don't even work like that any more - I know append my initials into every newly-defined thing - so I will definitely revisit this. This way, I can support a simple 'search for _MC to find every thing this template adds to the base-game' instruction.

Finally, from your follow-up post:

Correct. An oversight in my initial template - the new version will correct this. I don't even know how I managed to publish with it, to be honest. Schoolboy error.

Thanks for clarifying on the naming conventions; I've seen that regularly with other mods in the past, and I thought maybe there was some logic for applying the prefix to some things and not to others, but I'm with you on switching to always including it going forward.

I think having 1 missing character out of all that work is pretty impressive, and I'm sure you would've caught it quickly when digging into it. I just happened to be working with your template when I read that post and wanted to help that other modder out.

Thanks again for doing all of this!
 
Last edited:
A quick follow-up:

I now have a fully functional mod with a unique Civilization, Leader, Unit, and Building. Other than the xxx.Art.xml file, the only xml file I'm using is a Buildings.xml, but I'm fairly certain I could re-create that with sql-just been tied up trying to resolve my one remaining issue: trying to get my foreground leader art to show up on the diplomacy screen; it seems no matter what I try, Cleopatra shows up there. I've read threads relating to this, but I have not located anything that says this has been resolved if working with ModBuddy/Asset Editor only, which is my goal here. (Those threads appear to have some age on them-not sure if things have changed.) To be clear, I have the foreground and background images working on the leader selection screen, all icons (civ/leader/unit/building) working on every screen (leader selection/in-game/civilopedia), and the leader foreground and background images working on the loading screen. My leader background appears on the diplomacy screen, but Cleopatra appears in the foreground.

From what I gather, the diplomacy screen's art relies on the FallbackLeaders.artdef, which references an xlp (the LeaderFallbacks.xlp in our case), which is referenced by the xxx.Art.xml file. I've re-created each of those and the dds/tex files countless times, trying various code combinations, but no dice. (I'm assuming the diplomacy foreground art is different because it normally needs to account for the various leader animations for interactions.) Once I get this resolved, I'll be happy to share what adjustments I had to make overall to get everything working.

EDIT: I resolved this through some more troubleshooting. I came across the ModArt Generator tool on another thread, and using that eliminated 1 component I kept adjusting. (That tool auto-generates the xxx.Art.xml, so at least you're left with just working with the artdefs and xlps.) My particular issue with the diplomacy screen was due to my Fallbackleaders.artdef which ended up like this:

<?xml version="1.0" encoding="utf-8" ?>
<AssetObjects..ArtDefSet>
<m_Version>
<major>3</major>
<minor>0</minor>
<build>210</build>
<revision>682</revision>
</m_Version>
<m_TemplateName text="LeaderFallback"/>
<m_RootCollections>
<Element>
<m_CollectionName text="Leaders"/>
<m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
<Element>
<m_Fields>
<m_Values/>
</m_Fields>
<m_ChildCollections>
<Element>
<m_CollectionName text="Animations"/>
<m_ReplaceMergedCollectionElements>false</m_ReplaceMergedCollectionElements>
<Element>
<m_Fields>
<m_Values>
<Element class="AssetObjects..BLPEntryValue">
<m_EntryName text="FALLBACK_NEUTRAL_LEADER_SWANSON"/>
<m_XLPClass text="LeaderFallback"/>
<m_XLPPath text="LeaderFallbacks.xlp"/>
<m_BLPPackage text="LeaderFallbacks"/>
<m_LibraryName text="LeaderFallback"/>
<m_ParamName text="BLP Entry"/>
</Element>
</m_Values>
</m_Fields>
<m_ChildCollections/>
<m_Name text="DEFAULT"/>
<m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
</Element>
</Element>
</m_ChildCollections>
<m_Name text="LEADER_SWANSON"/>
<m_AppendMergedParameterCollections>false</m_AppendMergedParameterCollections>
</Element>
</Element>
</m_RootCollections>
</AssetObjects..ArtDefSet>
 
Last edited:
From what I gather, the diplomacy screen's art relies on the FallbackLeaders.artdef, which references an xlp (the LeaderFallbacks.xlp in our case), which is referenced by the xxx.Art.xml file. I've re-created each of those and the dds/tex files countless times, trying various code combinations, but no dice. (I'm assuming the diplomacy foreground art is different because it normally needs to account for the various leader animations for interactions.) Once I get this resolved, I'll be happy to share what adjustments I had to make overall to get everything working.

I've not had a chance to look at any civilization-related files for a while - work has been so busy - so apologies that this is a brief reply. When you create your DDS/TEX pair for your fallback leader, are you ensuring you select the Class Name in the Asset Editor? This is the only one that should be "Leader_Fallback", rather than UserInterface.

Assuming you have that correct (i.e. the TEX file is right), then you should be able to amend the FallbackLeaders.artdef to reference the right entity, by changing the following lines:

Code:
Line 26:

<m_EntryName text="FALLBACK_NEUTRAL_PO_NGBE"/>

Code:
Line 41:

<m_Name text="LEADER_MC_PO_NGBE"/>

Please note the two different references here. The first needs to match that which appears in LeaderFallbacks.xlp (and I think is derived from the DDS filename...but don't quote me on that). The second is referencing the leader entity itself. This file is essentially saying 'for this leader, use this thing as the fallback image'.

By the by, please feel free to share with me your files. I am happy to work with you to get it all working and then I can shamelessly pilfer any of your commentary so that I can work towards version 1.1, or 2.0, or whatever we want to call it, of my template.
 
Ha-I just replied to your conversation message, and that actually was my last code oversight for the diplo screen issue. Thanks again for your help, and you're certainly welcome to use anything I did if it helps add to your work here. To clarify for others, I only used ModBuddy (which includes Asset Editor) and then the ModArt Generator to help me adjust my xxxArt.xml. I mainly used this template and referenced a few working mods to troubleshoot what I was trying to add for artwork.
 
I have good internet now, is there any good guide to deal with the artwork available nowadays?
 
Please help me
There's an error.
 

Attachments

  • 제목 없음.png
    제목 없음.png
    86.1 KB · Views: 159
Last edited:
Hey there maconnolly,

firstly, thank you for making this template and the comments along with it. This has really helped me kickstart my modding. under Civilization_UU.sql you wrote:

It is, however, not required that a unique unit replaces an existing unit - I can provide an alternative set of code that showcases a unique unit that does not replace, should that be useful.

Is it alright if you can provide this code? I'm new to civ modding and would like to add a new unit. Once again, thanks for the template! Its rlly helped my friends and I!
 
I've tried this, and it works, but the era score illustrations do not load. Perhaps it's the updates? But so far, everything is lovely here, and as I am about to embark to creating and testing my first mod, with this template's help.

I hope you can keep this template updated too! It's been a great help to me in learning how to mod, and I'm confident it'll help me more as I will soon begin to understand how modding works!
 
First of all, thank you for the template. It has worked very well so far. But I have a few questions, I'll put them very simply.
How can you replace Cleopatra with your 2D character? When I go to my Civ at the top (and make him fullscreen, the picture is my civ), I only see Cleopatra.
And how can I replace the ColossalHead? Everything I have tried so far has not worked.In addition, all the icons I uploaded are suddenly blurred (for example, the character itself and the symbol of the civilisation).

I hope these are not stupid questions but unfortunately I am not a good programmer either.

I would be happy about any answer :D
 
First of all, thank you for the template. It has worked very well so far. But I have a few questions, I'll put them very simply.
How can you replace Cleopatra with your 2D character? When I go to my Civ at the top (and make him fullscreen, the picture is my civ), I only see Cleopatra.
And how can I replace the ColossalHead? Everything I have tried so far has not worked.In addition, all the icons I uploaded are suddenly blurred (for example, the character itself and the symbol of the civilisation).

I hope these are not stupid questions but unfortunately I am not a good programmer either.

I would be happy about any answer :D

To be honest, the best answer I can give at this stage is: the artwork configuration in the existing version of the template is not perfect. It is, also, not intended to guide on all of the artwork replacement.

However - I am currently working on the updated template. I have become more aware of the finer details over the last year and so version 2.0 will include a full guide on all graphical elements. I expect this to be released this week.

Regarding blurred icons - that must be a dimensions/resolution issue. There's no logic in the template that would take a good image and make it blurry.
 
First of all, thank you for the template. It has worked very well so far. But I have a few questions, I'll put them very simply.
How can you replace Cleopatra with your 2D character? When I go to my Civ at the top (and make him fullscreen, the picture is my civ), I only see Cleopatra.
And how can I replace the ColossalHead? Everything I have tried so far has not worked.In addition, all the icons I uploaded are suddenly blurred (for example, the character itself and the symbol of the civilisation).

I hope these are not stupid questions but unfortunately I am not a good programmer either.

I would be happy about any answer :D
Actually, I was in that exact position a month ago, well since I was stuck there, but managed to get through that problem myself, I'll help ya out:

The fact Cleopatra is there means whatever is supposed to put your 2D character is broken, it's essentially an "ERROR!" sort of thing, it has something to do with how the XLP files work and however you're trying to put up your character, and I believe this might also be connected to your problem of having your civ icons blurred, although I can't really say much unless I know more specific details about your situation

As for the improvement, you probably need to code the xml file of the improvement in a way that it disconnects from the colossal head, and then create a seperate artdef file for the file (this is actually rather complex for people doing this the first time... but once you're familiarized with it, it'll be like a walk in the park) :D
(btw, since i'm helping ya out, yeah feel free to message me here, i could help you out more if you need more detailed help)
 
Last edited:
Great template, on my way to creating my first custom civ. However, when I pick my custom civ in the Create Game screen and press Start Game, after a few seconds an error pops up saying "There was an error starting the game. We recommend disabling any mods and trying again. Error- One or more mods failed to load content" and then it gives me the option to manage mods or close. Does anyone know a solution to this?
 
Thank you Maconnolly for the template! It has been useful in my attempts to build a mod with a custom Civ. I just have one error which I don't really know how to fix, maybe somebody can help.

I have created a list of city names that works for my custom Civ but whenever I settle a city which name contains diacritical marks it appears like this:
Image2.PNG

At the same time if I change manually the name of the city I am able to input the missing character:
Image3.PNG


See my code, I don't think I'm doing anything special, I just filled the template with these names:
Image1.PNG


Has anyone faced anything similar to this?
 
Hi, I'm a complete beginner and am trying to navigate the template. It seems very specific at times to some solutions that are not very universal, like the Colossal head (at times it even seems more like an author explaining their existing work rather than a template). Could we get some instructions how to make something more general and simple? Perhaps how to make a unique improvement that uses any base game 3D model but with instructions to set up everything and not have to rely on Colossal head? Could we get instructions how to use base-game art in general?
 
Hi, I'm a complete beginner and am trying to navigate the template. It seems very specific at times to some solutions that are not very universal, like the Colossal head (at times it even seems more like an author explaining their existing work rather than a template). Could we get some instructions how to make something more general and simple? Perhaps how to make a unique improvement that uses any base game 3D model but with instructions to set up everything and not have to rely on Colossal head? Could we get instructions how to use base-game art in general?

These are fair comments. I can totally appreciate that the specificity of the 'example' isn't necessarily the easiest thing to grasp. I chose this approach, originally, because putting certain specific things in allowed me to showcase the approach needed in certain situations. I also just thought it would be more engaging to learn with rather than a 'full template' that has very generic entries for everything (plus that encourages find-and-replace, which in itself discourages learning). That's just my opinion, of course.

I do think that for complete beginners an over-arching set of instructions would be useful. To be honest, it is something I intended to revisit but it's time-consuming and finding that time has proved a challenge. If a new version gets released, it will absolutely consider the various feedback I've received over the last 18 months or so. I can't promise such a version will materialise - only that if it does, it'll try to address the areas where people have been tripped up.
 
Thank you Maconnolly for the template! It has been useful in my attempts to build a mod with a custom Civ. I just have one error which I don't really know how to fix, maybe somebody can help...

...Has anyone faced anything similar to this?

Yes, this is a known 'limitation' when modding within ModBuddy, unfortunately. You're not doing anything wrong, as such - there are just extra steps needed to get special characters to appear. It's to do with the character encoding that ModBuddy uses.

The only way around it that I know of is to edit the files after you've built your mod, using your preferred text editor. The key thing is to change the encoding of the file to UTF-8 and then update the characters accordingly. As long as they are characters that are valid in UTF-8, you'll see these then appear just fine in-game.

Sorry for the extremely delayed reply.
 
Hey mac, great work on the template! I do like being able to know more-or-less what certain stuff does.

That being said, is there a way to populate the databases via xml files rather than direct sql?
 
Top Bottom