Need Tips/Know-Hows With Modding

T.C.Douglas

Medicare
Joined
Mar 12, 2011
Messages
60
Location
Canada
So, my major knowledge with modding in Civilization is only with Civilization III. Now I have the thoughts of making a mod for Civilization V, but I've never had the experience (only fooling around in the map editor).

Practically, the mod I am thinking of making is about the world's current political status in 2015, so that will mean I need to understand how to:
  • Create new Civs
  • Import/Create new leaderheads (as in flags for icons)
  • Import/Create images for leaderscreens
  • Import music for each Civ
  • Import downloaded, user-made units
  • Wrap the mod up to be placed on Steam Workshop

If anyone has a website/tutorial to help me learn to do the above things I listed, I would greatly appreciate it.

Thank you.
 
Spetsnaz - there really isn't 1 overarching tutorial that works for the current iteration of Civ V (BNW latest patch).

However, there are a slew of them all over CivFanatics. You would have to look in the tutorials section.

I recommend Kael's guide to start off with, it runs you through creating a new Civ from scratch, goes into icons and backgrounds for leaders and it teaches a bit about how to make units.

Creating new leaderheads is quite the challenge with modeling, there are a number of good ones available for download on this website.

Use Kael's guide first, grab the SDK off of steam, get modbuddy working, and experiment. the learning curve is sharp, but once you are proficient with understanding the game concepts you will be able to find anything else you need on CivFanatics.
 
Making a new Civ is abut the most intensive thing you can do right off the bat, since it requires knowledge of how to make every other piece of the puzzle at the same time.

As labriejp as said, there currently doesn't exist any "full" guide tailored for BNW, but there are enough resources spread around to get everything working.

Kael's guide is the backbone and starting point for many of us. However, it is outdated, as it was written before BNW was available. BNW changes a few things, so for some of the holes, LuvToBuild's guide can come in handy. However, it's also incomplete, but between the two guides, there should be enough there for most everything.

Those were also the two guides I used myself when I started out.

Past that, you can check LeeS' compilation of useful tutorials and when you start modding in earnest, LeeS' common newbie mistakes thread compiles a list of, well, the most common mistakes newbies make which renders their mod non-operational.

In the end, I think it would be easiest to build up the skills necessary by building one standalone component at a time, before finally combining everything together. Start with a new building given to America, for example. Once that's working, give them a new unit, then a new leader, then a new ability. Once you have those, try to assemble all those parts into a new standalone Civilization.

That said, I didn't follow this path / advice myself, so if you're just as stubborn, make sure to do lots of reading, and lots of searching.
 
That said, I didn't follow this path / advice myself, so if you're just as stubborn, make sure to do lots of reading, and lots of searching.

Lol, me too! There is something to be said about learning the hard way, it's harder to forget the lessons learned.
 
Learning lessons manually is definitely, in my opinion, the best way to learn. This is almost entirely the reason that I avoid using template files, even though they do exist.
 
So, with Modbuddy you cannot create the whole mod there; it takes making smaller mods of each component to create the end-product? What I mean is, for example, you have to make separate mods for each Civilization?

Another question is for you, labriejp - will I have to make a mod to get your "Advanced Air & Naval" units for my scenario, or are they already their own mod and I just need to import them into the mod/scenario folder? I hope that makes sense.

Thank you all for you suggestions. I have been reading Kael's mod guide a bit yesterday and it seemed very intense with the .xml explanation, but I'm sure once I read more it will make sense. I definitely will take a look at those other guides as well.
 
So, with Modbuddy you cannot create the whole mod there; it takes making smaller mods of each component to create the end-product? What I mean is, for example, you have to make separate mods for each Civilization?

Negative.

ModBuddy will be enough to make entire mods -- that's its sole purpose.
My meaning about making separate things is so that you understand how to make a building work by itself. Once you do, then you can remake a building as part of the full Civ. Trying to do 50 different things all at once is a sure-fire way to have stuff break and be at a loss as to how to fix it.

As I said though, I myself did not heed this advice, so I forged ahead and had to make everything all at once. It's definitely possible, but it can also get very confusing very quickly. Limiting yourself to one thing makes it easier to troubleshoot, and then that knowledge is transferable to a new Civ when you need to make something similar.
 
So, with Modbuddy you cannot create the whole mod there; it takes making smaller mods of each component to create the end-product? What I mean is, for example, you have to make separate mods for each Civilization?.
Nope. You can lump everything and the kitchen sink into a single mod. But it is not terribly advisable because such mods are difficult to understand and even more difficult to maintain when changes are required to fix errors and such.

What DarkScythe was saying, and what you are misunderstanding I think, is that instead of trying to get everything to work all in one go, you should take a small-steps approach. Each of the components of your civilization-mod is probably better contained within its own XML file, so use each of these components as what they are -- a code component, and test whether they work at all before trying to roll them into a mod for a new civilization. The components that are required for a civilization are (at minimum):
  1. A Leader
  2. Two Uniques
    • You can have any combination of Unique Units, Unique Buildings, Unique Improvements
  3. A Leader Trait
  4. The Definition of the Civilization itself.
May not seem like much of a list, but consider that
  • the Leader requires both Icons for the Leader "picture" in the civ-selection screen, etc., but also a leader's diplomacy screen image, as well as a DOM image. The leader also requires data for a certain minimum number of diplomacy responses/response-types.
  • A civilization requires both a regular Icon and what is called an Alpha Icon. It also requires a civilization-selection-screen map, player colors scheme, city names, spy names, and for the more adventurous custom music.
  • Unique buildings will require an Icon
  • Unique Units will require an Icon, and if you do not wish to use the Firaxis-Supplied animations for a similar unit, you will need to find a pre-created unit model to use, create the code to activate that model and associate the unit and the model together in-game. You will also need a strategic view icon
  • Unique Improvements: Improvement model that will show on the game map, and Icons: Icon for the Improvement, Icon for the worker-unit-panel.

edit: Meant to add this: After you are sure all your individual component parts of a civilization are coded correctly, then you can roll them all into a single mod for that new added civilization. You will have higher confidence that any trouble encountered has not to do with those pre-tested components, but is directly-related to the new code/elements added for the civilization itself.

And also: don't be deceived by Keal's guide into thinking that adding a new civilization to the game is an easy thing to do. It was in fact probably the worst possible example to use in such a guide because it gave the impression that adding a new civilization was a cake-walk. Adding a new civilization to the game is definitely do-able, but it is not as easy as Keal made it seem.

Nor should you be decieved by how often nor how seamlessly JFD, MoreCivs, Colonialist Legacies, etc., turn out new civilization mods. Remember they have years of experience at doing this, whereas you do not.

Another question is for you, labriejp - will I have to make a mod to get your "Advanced Air & Naval" units for my scenario, or are they already their own mod and I just need to import them into the mod/scenario folder? I hope that makes sense..
Actually, niether. If you want to use his units in a mod or scenario, simply either add within your mod a Dependancy to his mod or a Reference to his mod. A Dependancy means your mod cannot run unless the other mod is enabled. A Reference means that your mod can run without the other mod, but if both are active the other mod loads into the game 1st, thereby letting your mod make use of the code contained within the other mod.

For a simple scenario map you just enable whatever mods you want to use with the scenario map, and then select the scenario map itself as the map-type in the Modded Game Set-Up Screens.
 
Actually, niether. If you want to use his units in a mod or scenario, simply either add within your mod a Dependancy to his mod or a Reference to his mod. A Dependancy means your mod cannot run unless the other mod is enabled. A Reference means that your mod can run without the other mod, but if both are active the other mod loads into the game 1st, thereby letting your mod make use of the code contained within the other mod.

For a simple scenario map you just enable whatever mods you want to use with the scenario map, and then select the scenario map itself as the map-type in the Modded Game Set-Up Screens.

LeeS is 100% correct in this. If you would like to use the art that is in my mod, feel free I didn't create any of it, so it is 100% at your disposal (and it's all 100% available on CivFanatics under Civ V downloads/Units/Modern). If you are going to use any of the actual code in my mod (the XML and SQL) I ask that you send me a private message and we can chat about that. It's not that I don't want anyone to use it, but that it's still in such a state of flux and both of my mods are not out of Beta yet, I have a lot of work to do on them both still (and the 3rd one is in production). Also I name things kind of weird so as to not conflict with other mods.

If you would like to add my mods as a dependency and reference to your scenario, so someone would have to have both of our mods then feel free.


I think your best best would be to start off very slow.

Step 1, Download and read Kael's guide, and build his mod in modbuddy first so you can get the hang of things, then read up some other tutorials, use current mods for reference (especially with art, as that changed a lot with Brave New World).. there is a lot too it, but nothing more than a week of experimenting can't solve.

Good luck to you! We are always here in the forums to help out.
 
So, it would be practical before I start on making the Civs for my mod to get together/edit the images required for leaderheads/maps/backgrounds?

Another thing I have to ask is with Civilizations in ModBuddy - can I make them all in one "New Mod" like the Leader.xml, Civ.xml, etc? I understand you all said to take it step by step which I hope to, but I'm a little confused with what ModBuddy can do. Like, if I can make one Civilization in one mod project in the program; all the .xmls.

Lastly, and these are minor questions: how do you add newer OR edit the names of city states to fit your own (for example if you want to change the CS of Kathmandu to be Copenhagen)? Additionally, can I update the main Civs I am using like America, Russia, China, India to modern leaders/Civs (like America changes to United States with Obama, or Russia changes to Russian Federation with Putin)?

I hope I was clear. Thank you all for your explanations, I really appreciate it!
 
I learnt by doing 2 main things.

1. Reading the tutorials mentioned above and doing it step by step. First the outdated one, then the newer ones to fill the gaps that need to be filled.

2. Looking at other people's civs, how they put it together. XML coding is the most easy since i find it to be a case of just filling in the criteria. like "What is this civilization called? Thebes." go in and fill in the Civilization_Thebes entries, "Whats the unit called? Sacred Band" fill in the Unit_Sacred_Band entries.

And you need to download the XMLs
http://forums.civfanatics.com/showthread.php?t=490901
Using these as bases is just so much easier then writing it all from scratch. Remove the bits you don't need, replace the bits you do. for example, use America as a base and simply Find and Replace the word America with your Civ's name and you've already got that bit sorted.

Lua is a bit more complex, but there are tutorials for that.
 
Using the Civ5DebugDatabase.db database (you will need something to read it, like SQLite) was a life-saver: no longer do you need to trawl through countless XML files (base game, modded, or otherwise) when the entire damn schema & entries are right there in table format.

Also allows easy tracking of your changes (and/or any mod failures that may occur - i.e. values aren't changing the way they should), without the need to play test games.
 
While those template files are there, and they're fine when you need them, I really dislike recommending them to people.

You say to simply "remove the bits you don't need" but the problem is that when you're new, you have absolutely no idea which columns are required and which aren't. Continued use of templates blindly doesn't ever teach you this, either.

In my opinion, the absolute best way to go about it is to reference the game's stock XML, combined with the game's Schemas at the top of said XML files. Searching the game for CIVILIZATION_AMERICA would give you everything necessary to edit America, while the Schema lets you know what else is available (and by extension, optional) for you to use.

If you want to complete a full Civ, then yes, eventually you'll need to create all the artwork. Whether you do it now or later doesn't really matter, as you can temporarily borrow the game's artwork whenever you need to have a placeholder.

I'm not sure what you mean by one "New Mod" but the game simply parses whatever code you have in the XML and translates them into SQL code so that it can alter the game's database file. This means that it doesn't really matter how your XML is structured -- provided they are syntactically correct. Whether you stuff everything single thing in one gigantic cats.xml file or separate everything into individual files (and of course, what you choose to name them) has absolutely no bearing on how the game treats these files. All it cares about are the instructions contained within them.

Otherwise, ModBuddy is theoretically all you need to write the code for any mod. It can't make images or edit audio for you, but it's essentially a tailored text editing program meant to automate the process of packaging up your files into a mod package that the game can read. In the end, you don't even need to write code with it, as I use a different program to do so, and I only use ModBuddy for two things:
  1. Building the mod
  2. Uploading the mod to the Steam Workshop
However, it's probably easiest for the time being that you stick to ModBuddy until you figure out how it works.

For editing stuff in the game, you will generally look for TXT_KEY_ entries. The game doesn't often store text hardcoded like that, and will typically use TXT_KEY_* entries instead, so that they can simply pull that and automatically handle different languages, if they are present.

Whenever you deal with stuff in the game, keep in mind that Civ5 absolutely hates duplicates of anything. If you try to define something that's already in there, the game will puke, throw an error, slap your dog, and treat that file as if it doesn't exist. Usage of <Row> should only be for adding completely new items to the game. <Update> or <Replace> is used for things already in the game -- in your case, to change the name of Kathmandu, you would want to Update or Replace it.

With this, you can extend that to pretty much anything else in the game, so, yes, America and Russia can be changed to what you want to do.

Edit:
@ThorHammerz
While I find the database files invaluable for other reasons, I personally feel like the Schema files are easier to read in the XML, partially because they are ordered vertically in the XML, while they appear horizontally (and the columns are not wide enough to show the names) by default in SQLite Manager. In this case, the Database gives too much information all at once, when all I'm interested in are the available columns.
 
So, I'm trying to rename the American Civ, but it's not working; keeps showing the same names (and yes, I do have build the mod and have it selected in the mod menu).

I created new rows and updated the CIVILIZATION_AMERICA with them, still no go. I have two separate .xml files in different folders. The code reads:
In USA.xml:
-<GameData>

-<Civilizations>
-<Update>
<Where Type="CIVILIZATION_AMERICA"/>
-<Set>
<Description>TXT_KEY_CIV_US_DESC</Description>
<ShortDescription>TXT_KEY_CIV_US_SHORT_DESC</ShortDescription>
<Adjective>TXT_KEY_CIV_US_ADJECTIVE</Adjective>
</Set>
</Update>
</Civilizations>

</GameData>

In NewTitles.xml:
-<GameData>

-<Language_en_US>

-<Row Tag="TXT_KEY_CIV_US_DESC">
<Text>United States of America</Text>
</Row>
-<Row Tag="TXT_KEY_CIV_US_SHORT_DESC">
<Text>America</Text>
</Row>
-<Row Tag="TXT_KEY_CIV_US_ADJECTIVE">
<Text>New</Text>
</Row>

</Language_en_US>

</GameData>

I must be doing something wrong?
 
So, I'm trying to rename the American Civ, but it's not working; keeps showing the same names (and yes, I do have build the mod and have it selected in the mod menu).

I created new rows and updated the CIVILIZATION_AMERICA with them, still no go. I have two separate .xml files in different folders. The code reads:
Spoiler :
In USA.xml:
-<GameData>

-<Civilizations>
-<Update>
<Where Type="CIVILIZATION_AMERICA"/>
-<Set>
<Description>TXT_KEY_CIV_US_DESC</Description>
<ShortDescription>TXT_KEY_CIV_US_SHORT_DESC</ShortDescription>
<Adjective>TXT_KEY_CIV_US_ADJECTIVE</Adjective>
</Set>
</Update>
</Civilizations>

</GameData>

In NewTitles.xml:
-<GameData>

-<Language_en_US>

-<Row Tag="TXT_KEY_CIV_US_DESC">
<Text>United States of America</Text>
</Row>
-<Row Tag="TXT_KEY_CIV_US_SHORT_DESC">
<Text>America</Text>
</Row>
-<Row Tag="TXT_KEY_CIV_US_ADJECTIVE">
<Text>New</Text>
</Row>

</Language_en_US>

</GameData>

I must be doing something wrong?
I'm suspecting you have made the common mistake shown as #1 here

Every file you add to your project in ModBuddy needs some kind of instruction as to how that file should be used by the game. See whoward69's what ModBuddy setting for what file types tutorial
 
Thank you!
Wow, I cannot believe I made that mistake, then again I'm a novice so yeah lol
I had that link bookmarked as well, and I cannot believe I did not reference back to that.
 
Edit:
@ThorHammerz
While I find the database files invaluable for other reasons, I personally feel like the Schema files are easier to read in the XML, partially because they are ordered vertically in the XML, while they appear horizontally (and the columns are not wide enough to show the names) by default in SQLite Manager. In this case, the Database gives too much information all at once, when all I'm interested in are the available columns.

I agree with you in that XML schemas are easier to read for the base primary tables (i.e. "Buildings", "Units", etc), but for tracking data entries by the developers (especially DLC content, which tends to be located in many different places in the DLC folder) the database is still the 1-stop-shop-for-all.

The other good thing about the database is that one can run whatever summary statistics needed with a simple export to Excel.
 
Alright. So now that I know how to rename Civilizations, I need to know how to add leaders. With that said, I do know how to rename them/add flavours & biases, but what about the .dds files for them? For example, for Dawn of Man, Civiliopedia, leader icons, and diplomacy scenes.

As well, when I rename the leader for Russia (for example) from Catherine to Vladimir Putin, it still shows as Catherine when loading up as Russia in-game.
 
DDS files need to be created and/or edited separately in your image manipulation program of choice. You will need the nVidia plugin to save as DDS textures, I believe, for whatever program you end up using.

The DDS files typically need to be saved with an alpha layer (DXT3 or DXT5 compression settings are safe bets,) and they also need to be imported into VFS. Finally, you'll need to actually update the appropriate areas of the Civilization so that the game will use them.

There are various guides around in the Tutorials subforum related to various aspects of graphics creation.
 
Back
Top Bottom