View Full Version : The Modder's Guide to Civ4


Weasel Op
Oct 24, 2005, 08:33 AM
DON'T PANIC!


"Civ4 is big. You just won't believe how vastly, hugely, mind-bogglingly big it is. I mean, you may think it's a long way down the road to XML, but that's just peanuts to Civ4." -Douglas Adams, and me


So you pre-ordered the game, you've seen every screenshot, and you've been scouring the forums for months. You finally got your hands on that game, and you just can't get enough of it. And if you're like me, there's only one thing on your mind: how am I going to mod this amazingly deep and complex game?

If you want to mod Civ4, this thread is for you. I'm digging into the modding capabilities of Civ4, and sharing all of it with you. I will post everything that I know in this very thread. And if I don't know it, I'll link to it.

Whether you're a conscript newb who has never played Civ before, a regular modder like me who hasn't quite mastered all there is to Civ3 yet, or a veteran programmer who just can't wait for the SDK, this thread is for you.

QUICK LINKS:
Post 2: Modding Overview (http://forums.civfanatics.com/showpost.php?p=3200753&postcount=2)
Post 3: Graphics (http://forums.civfanatics.com/showpost.php?p=3200757&postcount=3)
Post 4: World Builder (http://forums.civfanatics.com/showpost.php?p=3200762&postcount=4)
Post 5: XML Modding (http://forums.civfanatics.com/showpost.php?p=3200766&postcount=5)
Post 6: Python Scripting (http://forums.civfanatics.com/showpost.php?p=3200770&postcount=6)
---------------
Graphics
DDS Converter (http://eliteforce2.filefront.com/file/DDS_Converter;29412)
jak08's DDS Skin Tutorial (http://forums.civfanatics.com/showthread.php?t=137265)
RAD Game Tools (http://www.radgametools.com/default.htm#Bink)

World Builder
Dale's World Builder Manual (http://members.dodo.com.au/~thesdale/Manual.zip)
BMP to WBS Converter (http://forums.civfanatics.com/showthread.php?t=135740)
Dale's In-Depth Look at the WBS (http://forums.civfanatics.com/showthread.php?t=135669)

XML
Civ4Wiki (http://civ4wiki.com/wiki/index.php/Main_Page)
W3Schools.com XML tutorial (http://www.w3schools.com/xml/xml_whatis.asp)
XML.org Beginner's Guide (http://www.xml.org/xml/resources_focus_beginnerguide.shtml)
BrentRichie's XML Tutorial Part 1: Adding Civs (http://forums.civfanatics.com/showthread.php?t=135459)
Part 2: Civ Info (http://forums.civfanatics.com/showthread.php?t=135535)
Part 3: Leaders (http://forums.civfanatics.com/showthread.php?t=141182)
XML Quick Reference by Max_x_fire (http://forums.civfanatics.com/showthread.php?t=140511)
Adding New Units by sovarn (http://forums.civfanatics.com/showthread.php?t=139721)

Python
Civ4Wiki (http://civ4wiki.com/wiki/index.php/Main_Page)
www.Python.org
GBM's Python Tutorial (http://forums.civfanatics.com/showthread.php?t=97183) and Website (http://sthurlow.com/)
Locutus' Python Documentation (http://forums.civfanatics.com/showthread.php?t=133917)
Civ4 Python API (http://civilization4.net/files/modding/PythonAPI/)

Weasel Op
Oct 24, 2005, 08:37 AM
Modding Overview:


As you probably know, there will be 4 levels of modding in Civ4:

World Builder: This is the equivalent of the map editor in Civ3, but much more powerful. Here you can create custom maps and basic scenarios. You can edit terrain, place cities and units, and much more. The world builder will ship with the game.

XML: This is roughly equivalent to the rules editor in Civ3. This is where you can add units and improvements, edit the civilizations, and tweak just about every value in the game. XML can be written in notepad or an XML editor. XML is similar in appearance to HTML, and is fairly simple to learn once you understand the basic concepts. A great XML tutorial can be found at w3schools.com (http://www.w3schools.com/xml/default.asp)

Python: Python is a programming language that is used in Civ4 for the game interface, map generation, scripting events, and more. Gingerbread Man is building an excellent Python tutorial (http://forums.civfanatics.com/showthread.php?t=97183) focused on Civ4. Several lessons are already available. Python can also be written in notepad. The Python Integrated Development Environment (IDLE), which allows you to run Python files, can be downloaded for free at www.python.org.

SDK: The Software Development Kit is where the hard-core modding will be done. Everything but the graphics engine and the core Civ engine will be available to modders. Programming will be done in C++. The SDK will not be available until early 2006.

Graphics: In addition to these forms of modding, there will also be a demand for graphics. Units, icons, and the user interface will all require new graphics as new mods and scenarios appear. Depending on what graphics are involved, they may require XML, Python, or even the SDK in order to be incorporated into the game.

Creating a mod
Once you find something you want to change, you can make a mod for it. When you create a mod, no matter how small, create a new folder for it inside the Civilization 4\Mods folder with the name of your mod. DO NOT overwrite the original files with your own. If you are making a lot of small changes to the game to fit your own preferences, you will probably want to play this mod every time, instead of the standard game.
Fortunately for you, you can tell Civ4 to run a certain mod every time it loads. There are a few ways to do this. The first is the Custom Assets folder. You can store files in here that you want to override (not onerwrite) the original files every time the game loads. When Civ4 loads, it first takes these files, then follows the designated file path. The Custom Assets folder is a good place for small changes such as textures and text that you want to use for all games.
If are creating a specific mod that you want to load automatically when Civ4 runs, you can direct the game to it from the main configuration file. In _Civ4Config.ini, in the main Civ4 folder, there is a line "Mod = 0". By setting this to a specific folder, such as "Mods\MyMod", you can make Civ4 load a certain mod automatically.
It is not necessary to copy all files into your mod folder- only those that you have changed from the originals. Like Civ3's scenario search folders function, Civ4 will look first in Custom Assets and take any files it finds. It then moves on the to the specified mod, if any, and takes whatever files that it doesn't already have, before getting all remaining files from the main folder setup.

CLEAR YOUR CACHE!!!!!11!!!1!!!1!1!11one1!!!
If your mod is not loading properly, (ie, the game says it loaded but nothing changes), you may need to clear your cache. Civ4 saves a lot of files in a cache folder and uses them instead of reloading the files, so sometimes changes don't appear as they should. Go to C:\Documents and Settings\USERNAME\Application Data\My Games\Civilization 4, show hidden files and folders, and delete the cache folder. You may need to do this periodically as you make changes.

Mod Structure
The Assets folder, which contains all files necessary for a complete mod, contains a massive 559 folders, and over 10,000 files. Fortunately for you, you don't have to duplicate it. Unlike Civ3, when you had to create the folder setup to mirror the original, Civ4 does this for you. When you run the game using a mod, it automatically creates a full folder setup in the mod folder. As you add more files to your mod, simply place them in the same sub-folder that the original was in. The basic unpacked* structure looks like this:
http://img.photobucket.com/albums/v357/WeaselOp/foldersetup.jpg
*If your Civilzation 4\Assets folder DOES NOT contain these subfolders, you will need to decompress the file art0.fpk with the PakBuild (http://www.civfanatics.net/downloads/civ4/utility/PakBuild.zip) utility from Firaxis. art0.fpk is a huge compressed file similar to a RAR archive that contains most of the files and folders from Assets. After you unpack the file, move art0.fpk to a different location or rename it. This is because Civ4 will look for this file before looking in the Assets folder. If you do not move or rename the file, Civ4 will continue to load the default files within the package.

Basic guidelines
As with all modding (or anything in life for that matter), there a few guidelines to follow:
Back up your work. Before you start messing with anything, save a copy of the original (or the latest version of your own work, for that matter) in a place where it won't get deleted, overwritten, lost, or eaten. The only way to recover the original is to reinstall the game. And trust me, your hard drive doesn't want that. And whatever you do, don't come begging for somebody to send you an original file. It's called piracy. And Chieftess will eat you alive. You think I'm kidding, don't you?
Use the Mod folder setup. In other words, DO NOT replace the original files with your own work. First of all, if you did something wrong you might have to reinstall to fix it. Secondly, you may want to play the game as it originally was, instead of your modded version. And thirdly, you won't get any sympathy when you complain about your game being messed up. ;) The Mod folders work the same way as they did for Civ3- just put whatever files your mod or scenario needs into its own folder, copying the setup of the main folder structure. For example, if you create a new XML file, put it in Mods\MyModName\Assets\XML\
Ask questions. If you don't know how to do something, or want to learn more, don't be afraid to ask. We're all learning this together (except for those beta-testers :p) OTOH, some of us have been modding Civ3 for a while, and some of the same concepts will carry over. We're happy to help new modders, because that means (a) more people to help us make our mods and (b) more mods for us to play. :mischief: No, seriously, we help because we enjoy modding and want other people to enjot it as well. So jump right in and start learning!
Have fun. This is the most important thing to remember. It's a game. It's meant to be enjoyed. You can gain a lot of computer-related skills by modding, but that's just a bonus. The real benefit is doing something you enjoy, seeing the product of your hard work and dedication, and working with some really cool people along the way. That's what C&C is all about.

Weasel Op
Oct 24, 2005, 08:38 AM
GRAPHICS

Graphics in Civ4 are more complicated than in previous games. Because of the 3D environment, most graphics consist of models and textures instead of single images or animations.

Units
We are not currently able to create new models and animations. Until Firaxis releases the SDK or a converter plugin for the Gamebryo engine, we have to use the models that shipped with the game. Gaias explained it to me in another thread:
What I was trying to infer with that statement was that even though I did export a basic primitive, it doesn't mean that it would actually work for all that is required to make a unit in Civ4. The plugin in question that I used with Milkshape 3d was a alpha opensourced project that was geared initially toward The Elderscrolls Morrowind (which also used the GameBryo engine). I say 'was' because said plugin is close to a year old and alpha notheless (all I could do was export the basic primitive into the game and nothing else, ie animations).

The other problem is that even though this instance did work the plugin was geared toward a different game entirely. Morrowind came out in 2002, and the authors of that plugin said explicitly that they were working on the NIF file format that was used in the game. Now I am pretty sure that the makers of GameBryo have upgraded their engine in that 3 year time. I am also assuming that Firaxis used a more recent incarnation of that engine. Just by an educated guess I would be lead to believe that even though both NIF file formats are in general the same, they may vary enough as to not be cross compatible. And that is the real problem.

Unless someone with good C++ and a knowledge in 3d applications wants to design a exporter plugin for one of the various 3d applications available to the public, we are just going to have to wait until Firaxis release their SDK with a NIF exporter. Until such time, things like units and building are not going to happen. Well at least not very easily one might assume.

While we can't make custom models yet, that doesn't mean we can't have new units. Units can be "reskinned" by editing or replacing the textures. With a DDS Converter (http://eliteforce2.filefront.com/file/DDS_Converter;29412), you can export the dds texture files to standard bmp images, edit them, and convert them back. A single model can be used with dozens of different textures to create a variety of custom units. jak08 wrote a short DDS Skin Tutorial (http://forums.civfanatics.com/showthread.php?t=137265).
Buildings
Leaderheads
Terrain
Buildings, Leaderheads, and terrain all use the same graphics format as units- a combination of NIF, KF, and KFN files, with DDS textures. Terrain is especially complicated. It encompasses a massive 1,217 files distrubuted among 168 subfolders. Terrain modelling in Civ4 is not for the weak.
Buildings and Leaderheads are somewhat limited at this point because buildings are not culture-specific, and LHs are not era-specific. Until the SDK is released, These graphics will be limited to simple skin replacements only.
Interface
The game interface is comprised mainly of DDS textures, making it the most moddable set of graphics at this point. The interface is run by Python.
Movies
Polyphemous discovered the program used to make bik movies for Civ3, and it turns out that Civ4 uses the same format. The Bink Tools program (http://www.radgametools.com/default.htm#Bink) is a free download from RAD Game Tools.

Weasel Op
Oct 24, 2005, 08:38 AM
The World Builder

The World Builder (WB) is the part of Civ4 that is used to create new maps and scenarios. It can be loaded at any time during the game. Many people find the WB slow and clucnky, but fortunately there are other ways to edit the saves. An interesting thing about the World Builder Saves is that they are saved in ordinary text format. You can open, edit, and save them using the most powerful computer program known to man- NOTEPAD. The file is easy to understand, and for small changes it's probably easier to tweak the text rather than loading it in the World Builder. There is also a converter that creates maps from a series of bmp images.

Manual: Dale (who turned out to be another one of those elusive beta testers) has made a great World Builder Manual in pdf format.
Manual (7.1 mb) (http://members.dodo.com.au/~thesdale/Manual.zip)

Making Maps: There are 3 ways to build new maps. You can use the WB to make it in-game, you can manually set it up in Notepad, or you can use the BMP to WBS converter (http://forums.civfanatics.com/showthread.php?t=135740) to generate maps using bmp images.

The World Builder Save (WBS): Dale is also working on a complete guide to editing the WBS in text format in this thread. (http://forums.civfanatics.com/showthread.php?t=135669)

Unlock the full capabilities: If you have tried to use the World Builder, you have probably noticed that a lot of the functions have been disabled. This is to keep the World Builder from being a cheat machine, but you can't make good scenarios. Fortunately, Soren Johnson released the "cheat code": In the main ini file, which can be accesed through "Shortcut to _Civ4Config" in the main Civilization 4 folder, replace the line "CheatCode = 0" with "CheatCode = chipotle". This will unlock all the features of the World Builder, allowing complete scenario control.

Weasel Op
Oct 24, 2005, 08:39 AM
XML Modding

XML is short for Extensible Markup Language. It appears similar to HTML, but serves a different purpose. While HTML displays information, XML is used to organize information. The unique thing about XML is that there is noset, predefined system. When you use XML, you make up your own tags based on what your program needs to do. XML itself is not a programming language. It's a "metalanguage"- it's used to define new languages.

So what does this have to do with Civ4? Civ4 uses XML to organize information about the game. Instead of the complicated rules editor from Civ3, with obscure labels and buggy functions, Civ4 uses XML to arrange all of the necessary information so that it is easy to read and edit.

I have found 2 good online XML tutorials that I would recommend. They are much more in-depth than my simple introduction, and are very easy to follow.
w3schools.com: XML Tutorial (http://www.w3schools.com/xml/xml_whatis.asp)
XML.org: XML Beginner's Guide (http://www.xml.org/xml/resources_focus_beginnerguide.shtml)

(If you want to jump right in and see some XML in action, keep reading. If you just want to know what this has to do with Civ4, skip this section.)

--------------------------------------------------------------------------
--------------------------------------------------------------------------

That's all great, but what does XML look like, and how does it work? If you are comfortable with HTML, or even the VB code used in your posts, then learning XML should be no problem. It consists of tags like <b>...</b> that wrap around pieces of information to describe them. To see a good example of XML in use, look no further than your PMs! You can download PMs in XML format- there is an option in the menu where you delete them.

As an example, here is a PM that I sent to myself:
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!-- Civilization Fanatics' Forums;http://forums.civfanatics.com
-->
- <!-- Private Message Dump for User Weasel Op; Oct 25, 2005 09:31 AM
-->
- <privatemessages>
- <folder name="Inbox">
- <privatemessage>
<datestamp>2005-10-25 09:31</datestamp>
<title>XML in Civ4</title>
<fromuser>Weasel Op</fromuser>
<touser />
<message>Hey, did you know that Civ4 uses XML? :D</message>
</privatemessage>
</folder>
</privatemessages>

Now that probably looks awfully complicated, especially if you have never seen HTML, but don't worry. I'll explain how it works.
<?xml version="1.0" encoding="ISO-8859-1" ?>
- <!-- Civilization Fanatics' Forums;http://forums.civfanatics.com
-->
- <!-- Private Message Dump for User Weasel Op; Oct 25, 2005 09:31 AM
-->

That part just tells the program reading the file, and you the coder, what this is. The first tag informs the program that this is an XML file, written in version 1.0, and that it uses the Western European character set. The next 2 lines are comments- notice the <!-- and -->. Everything between those is a comment, and is ignored by the program. It's just there for you, so you know what this is.

Next comes the good stuff:
- <privatemessages>
- <folder name="Inbox">

The first tag that really does something is the <privatemessages> tag. This tag tells the computer that everything from this tag through the closing tag (a tag with a / before the name, in this case </privatemessages>) is an element. An element is a piece of information. It can contain other elements, text, or both. In this case, <privatemessages> begins an element that contains all of the private messages in the file. (There is only 1 here, but if I had saved my entire Inbox they would all be in there.)

Next is the <folder> tag. Notice that this tag does not only have a name, but a description. This description is called an attribute. An attribute is a little piece of information included in an element tag. It gives the element a characteristic, in this case the name "Inbox." This is an example of the flexibility of XML. "Inbox" could have been a separate element within "folder" like this:
- <privatemessages>
- <folder>
- <Inbox>

Here, "Inbox" is an element within "folder." However, "Inbox" is better as an attribute because logically, "Inbox" is a specific folder, not a part of a folder.

Are you getting the hang of it yet? Let's move on. This is where things start getting interesting:
- <privatemessage>
<datestamp>2005-10-25 09:31</datestamp>
<title>XML in Civ4</title>
<fromuser>Weasel Op</fromuser>
<touser />
<message>Hey, did you know that Civ4 uses XML? :D</message>
</privatemessage>

That's a big chunk of code, but if you look closely it folloes the same pattern. This is the PM itself, the actual information that I sent myself. Notice the <privatemessage> tag. This is NOT the same as <privatemessages>. That tag defined everything in it to be a group of private messages, but this tag defines itself to be a single PM. Look at the bottom line. See that closing tag? It has the same name, but a slash before it: </privatemessage>. This is the closing tag for <privatemessage> indicating the end of that element. Everything in between, including the tags themselves, are part of the element.

The second line gives us the date and time the message was sent. The <datestamp> tags wrap around it, indicating that it is also an element. Similarly, the next line is the title of the PM, and the line after that indicates who the message is from. Keep in mind that each of these elements are part of the <privatemessage> element, which is part of the <folder> element, which is in turn part of the <privatemessages> element.

The next line looks a little different. This tag combines the opening and closing tags into one. Since the line is blank, there is no need for two separate tags. Adding the slash to the end after the slash is like xml shorthand- it opens and closes the element with the same tag. The "touser" element is blank becuase this is my own PM. If it were addressed to someone else, it wouldn't be in my inbox!

The next element is the heart of it all. This is the actual text of the PM, enclosed in the <message> tags. Depending on the PM, this element could inclde several lines of text, VB code, etc. But the important thing to note is that it's all text. There is nothing magic about XML. There is no compiler, no functions, no special characters. Everything is saved, sent, and edited in text format only.

As I mentioned, the last line indicates the end of the <privatemessage> element.

Now let's look at the last piece of code:
</folder>
</privatemessages>
By now you can probably guess what these do. </folder> closes the "folder" element. Notice that the attribute "Inbox" is not included here. The attribute is a part of the element, not an element itself. In fact it can't be closed because it was never opened. It's just a characteristic of the "folder" element. If there's no more "folder", it can't be an "Inbox". The final line closes the <privatemessages> element.

Now you may be wondering, why are there 3 elements inside of each other like that? If you look back at the entire piece of code, you will see that the 3 major elements open and close together:
<privatemessages>
- <folder name="Inbox">
- <privatemessage>
.
.
.
</privatemessage>
</folder>
</privatemessages>

Why couldn't those all be one element? Actually, the only reason they appear that way is because I only saved 1 PM. If I had downloaded all of my PMs in one file, it would be different. <privatemessages> would still contain everything, because that is the root element. That just means that is the primary, basic element of the file. The whole file is essentially one element, <privatemessages>. Inside <privatemessages> would be two <folder> elements: <folder name-"Inbox"> and <folder name="Sent Items">. After the first </folder> tag, the second folder would then begin:
</folder>
<folder name="Sent Items">

The same would apply to <privatemessage>. Each PM would be a separate element, and after each closed the next would begin, until the end of the folder.

Now that wasn't too hard was it? Once you understand the basic concepts of how XML works, it's a simple process.

Now I know you're probably wondering, how does that help me mod Civ4? PMs have nothing to do with it. That's right, but you will be surprised at how similar it will be.

--------------------------------------------------------------------------
--------------------------------------------------------------------------

XML in Civ4

You can find detailed information about the XML used in Civ4 at Civ4Wiki (http://civ4wiki.com/wiki/index.php/Main_Page). Civ4Wiki includes pages for each XML file, with an explanation of every tag. Wiki sites allow users to submit their own material, which means that if you find an empty or incomplete page, you can update it yourself.

Max_x_fire wrote an XML Quick Reference (http://forums.civfanatics.com/showthread.php?t=140511), which covers all 129 files and includes a basic description of what each file is for, in a neat Excel spreadsheet. If you don't know which files you need to modify, check this out.

BrentRitchie's XML Tutorials provide a more in-depth look at specific tasks dealing with XML:
Adding new Civs (http://forums.civfanatics.com/showthread.php?t=135459)
Civ Information (http://forums.civfanatics.com/showthread.php?t=135535)
Leaders (http://forums.civfanatics.com/showthread.php?t=141182)

Weasel Op
Oct 24, 2005, 08:40 AM
Python Scripting

Python is a relatively new object-oriented programming language that is used for various things in Civ4, including map generation, event scripting, diplomacy, and the user interface. Python is available as a free download from www.python.org

Python is a portable language. It can be written once and run on any system that has a Python development environment installed. Python is also an interpreted language, meaning that it is compiled as it is run. This means that you can write the code and immediately execute it without the need to compile it into binary code like most other languages. The downside to this is that Python does not operate as quickly as other languages, making it unsuitable for the core game code.

Like any new language, Python takes time and practice to master. If you would like to learn how to use the Python language, Gingerbread Man (another beta-tester) has compiled (no pun intended) an excellent tutorial. (http://forums.civfanatics.com/showthread.php?t=97183) The tutorial is simple yet thorough. GBM will have you writing Python code in no time.

Once you have a basic understanding of how the language works, you will probably want to start digging into Civ4. Locutus (also a beta-tester) explains the terms (http://forums.civfanatics.com/showthread.php?t=133917) used in the Civ4 Python code. The Civ4 Python API, which provides additional information for programmers, is also available online (http://civilization4.net/files/modding/PythonAPI/).

The Python files for Civ4 are located in the Assets\Python folder. The files can be opened, edited, and save using Notepad, although Python editors are available. Remember when you edit these files, DO NOT overwrite or change the originals. Create a folder in the Mods folder for your creations.

Weasel Op
Oct 24, 2005, 08:41 AM
*SDK Programming*

Weasel Op
Oct 24, 2005, 08:41 AM
*Future home of modding FAQ*

Weasel Op
Oct 24, 2005, 06:31 PM
Okay, you can post now if you have any specific questions or comments about modding. I will address them if I can.

Pascal
Oct 24, 2005, 07:09 PM
Will it be possible to improve the World Builder using the SDK or Python?

Weasel Op
Oct 24, 2005, 07:21 PM
Good question. :) I never thought about that before. I assume that since the world builder will be an integral part of the game this time (you can even use it during a game to change things while you play), it would be part of the game itself, and would fall under the "everything but the graphics engine and the core civ engine" category. So I would say most likely yes, with the SDK.
I do know that Python is used for things such as map algorithms and game scripting, which would involve the World Builder.

MarineCorps
Oct 24, 2005, 07:53 PM
I was thinking of a thread like this. As we still have no idea how moddable this game is yet.

Civrules
Oct 24, 2005, 07:59 PM
I'll see how this thread evolves and it'll probably be stickied later. ;)

vbraun
Oct 24, 2005, 09:06 PM
I will help when I can. :)

Dale
Oct 25, 2005, 03:36 AM
Civrules:

If I may suggest waiting till after release, there may be something more substantial to sticky for modding.

Dale

Weasel Op
Oct 25, 2005, 07:51 AM
This will be substantial after I get my hands on the game. :)

Weasel Op
Oct 25, 2005, 09:29 AM
XML modding introduction added. XML in Civ4 will be added when I get the game.

Ekmek
Oct 25, 2005, 10:38 AM
What about the leaderheads are they going to use the same flcs are civ3 (if you know) or we can discuss later

Weasel Op
Oct 25, 2005, 10:45 AM
I don't know for sure, but I assume they will use FLC files. They will probably be a different size though.

Olorin0222
Oct 25, 2005, 10:51 AM
There may be more FLC files as well, since CIV LH's seem to have emotions that Civ3 LH's did not have.

GangsterOctopus
Oct 25, 2005, 10:58 AM
Let me start by saying that I don't know a whole lot about Python or XML. So what I’m about to say might not make a lot of sense or it might, just let me know either way.

Anyway I figure that and code we are allowed to see won’t be very well documented. So what I’m saying before you can go in and start changing things you are going to have to figure out how it all works right? If somebody were to document the code and share it with the community it would help new modders get started.

MikeLynch
Oct 25, 2005, 02:28 PM
Another note: People have been asking about the possibility of including existing Civ3 units in Civ4. While Civ4 will not support 2D animations, it's easy to implement what is called a "billboard unit." To do this, you create a transparent plane, or billboard, in a 3D program, and place the Civ3 unit animation onto it as an animated texture. In the game, the unit will appear as it did in Civ3. While this technique has its drawbacks, specifically that the unit would not be displayed properly if the camera was not in the default position, billboard units would make great placeholders while the unit makers prepare the new 3D units.
What about 2D units that *aren't* animated? A la Civ 2?

Weasel Op
Oct 25, 2005, 03:18 PM
Anyway I figure that and code we are allowed to see won’t be very well documented. So what I’m saying before you can go in and start changing things you are going to have to figure out how it all works right? If somebody were to document the code and share it with the community it would help new modders get started.
That may be an issue with Python (although it wouldn't be hard for an experienced programmer to figure it out), but XML is designed to organize information and make it easily accessible. So I wouldn't much about that.

@MikeLynch: That will be possible too. Even easier, in fact- the texture would just be a single image.

Ekmek
Oct 26, 2005, 02:32 PM
Weaselop did you get it yet? any chance you can answer some of the graphic questions?

Weasel Op
Oct 26, 2005, 05:20 PM
I'm still waiting for EB Games. :rolleyes:
Yesterday they said the release date was today. I should go over there and buy myself a regular copy and cancel my order. But with my luck it will be sold out. I haven't been having much luck with anything this week.

Weasel Op
Oct 27, 2005, 04:36 PM
I GOT IT!!!!!! [party]

updates are imminent :scan:

Ekmek
Oct 27, 2005, 05:38 PM
update graphics first please...and any info on citystyles...

Weasel Op
Oct 27, 2005, 06:02 PM
I'm beggining to realize that my mere 9 reserved posts aren't going to be enough space.... :crazyeye:

Mason11987
Oct 27, 2005, 07:40 PM
I don't really know why the next line looks the way it does, but I will let you know when I figure it out. I'm still learning about this too. It may be because I sent the message to myself. In any case, this line usually indicates who the message was sent to.

the <touser /> is eqivilant to writing <touser></touser> basically an empty element, but it's just shorthand for doing it that way :), and once you've seen enough xml, it's more intuitive to see it that way too :).

Weasel Op
Oct 27, 2005, 09:54 PM
Thanks. I'll add that in the next update. :)

Weasel Op
Oct 27, 2005, 11:34 PM
Ok, I added that snippet to the XML post, added some Python info, and added to the modding overview. I'll add to the graphics post tomorrow. I'm having some trouble finding everything.

White Elk
Oct 28, 2005, 07:17 AM
Am I correct in assuming that we can add an unlimited amount of new terrain?

Weasel Op
Oct 28, 2005, 10:43 AM
Adding new terrain types would probably require the SDK, but it would only be limited by what your computer can handle.
Remember, once we get the SDK, practically all limits will be gone.

White Elk
Oct 28, 2005, 10:57 AM
That is so good to hear Weasel OP!!
Thanks for your response :goodjob:

tdpatriots12
Oct 28, 2005, 11:00 AM
Anyone know how to find out what (X,Y) locations certain portions of the map are, such as places to be used as starting locations? Apart from guess and check, that is.

Weasel Op
Oct 28, 2005, 11:15 AM
Since the map uses square tiles this time, (0,0) is the bottom left corner, and (X,Y) is the number of tiles up and right respectively from there. I'm not sure what you mean about what certain portions are.

tdpatriots12
Oct 28, 2005, 11:19 AM
Like, what is the (x,y) of where London should be? etc. But (0,0) being the top left is a good start for me, thanks.

Weasel Op
Oct 28, 2005, 11:20 AM
Anyway I figure that and code we are allowed to see won’t be very well documented. So what I’m saying before you can go in and start changing things you are going to have to figure out how it all works right? If somebody were to document the code and share it with the community it would help new modders get started.

BTW, having seen the code for myself now, I would say it's very well documented. I'm just learning Python, but I looked through one of the map scripts and I could tell what it was doing most of the time becuase of the comments. :)

Some of the XML tags are a little obscure, but for the most part it's easy to understand. Isak is going to post a list of what each tag does once he gets the retail version, so before long we should have everything figured out.

Ironically, the world builder seems to be the hardest to operate so far. :crazyeye:

GangsterOctopus
Oct 28, 2005, 11:27 AM
Good to hear. Won't have to waste any time getting started.

Weasel Op
Oct 28, 2005, 01:48 PM
@White Elk: Zurai made new terrain types with just XML :D
http://forums.civfanatics.com/showthread.php?t=134017
New textures will have to be made for them, but adding them to the game is simple.

White Elk
Oct 28, 2005, 02:58 PM
Niice!! Thanks for the info and link!

Weasel Op
Oct 28, 2005, 06:50 PM
:bump: World Builder updated.

Weasel Op
Oct 29, 2005, 10:26 PM
:bump:
Does anyone have any specific areas that they would like me to concentrate on? I'll try to update the graphics section tomorrow with what we have figured out so far.

jorde
Oct 29, 2005, 11:05 PM
Yes, I'd like you to investigate, if possible, something about leaderhead making :)

Weasel Op
Oct 29, 2005, 11:06 PM
:salute: Will do.

MaisseArsouye
Oct 30, 2005, 02:14 AM
Could you please tell about city graphics ?
- file type
- file organisation ( number, names,... )
- how they look ( whole city or just parts )

EDIT : nevermind, just saw your other post..

tbear2520
Oct 30, 2005, 03:35 AM
I have something I need help on Weasel Op. I've looked at it and I'm struggling to find the right answer. I would like to take the Earth map and put it into the py format so it can be loaded through the single player - custom. This would allow for us to quickly choose who we want to play as and with(#). An option to choose to randomize the starting locations would be a nice touch. Thanks so much.... ;)

Rob (R8XFT)
Oct 30, 2005, 07:09 AM
There may be more FLC files as well, since CIV LH's seem to have emotions that Civ3 LH's did not have.
Another possibility is that we have the same amount of .flc files, but they're longer to incorporate the different emotions.
Are leaderheads in Civ IV era-specific or is it the same clothing/background throughout the game?

Weasel Op
Oct 30, 2005, 02:21 PM
Leaderheads are going to be rough. :wow:
1 C header file (list of animations)
9-10 .dds textures
8-9 .KF files
2 .KFM files
3 .NIF files

Weasel Op
Oct 30, 2005, 07:27 PM
I updated the graphics post, but most of it isn't good news.

Rob (R8XFT)
Oct 31, 2005, 02:26 AM
Leaderheads are going to be rough. :wow:
1 C header file (list of animations)
9-10 .dds textures
8-9 .KF files
2 .KFM files
3 .NIF files
:help:
For a game that's supposed to be completely moddable, they're making it extremely hard. Can one add a new civilization or at this stage, would an existing civilization need to be replaced?

Feet
Oct 31, 2005, 04:48 AM
This thread needs stickification. I can see myself refering to it alot now that we know modding Civ4 isn't exactly straight forward.

Dale
Oct 31, 2005, 05:28 AM
Since the map uses square tiles this time, (0,0) is the upper left corner, and (X,Y) is the number of tiles right and down respectively from there. I'm not sure what you mean about what certain portions are.

Actually be careful here.....

(0,0) is actually bottom-left. ;)

X = shift upwards
Y = shift right

Dale

Colonel Kraken
Oct 31, 2005, 08:47 AM
:bump:
Does anyone have any specific areas that they would like me to concentrate on? I'll try to update the graphics section tomorrow with what we have figured out so far.

Yes, sir. I'd like to know about changing/editing/adding unit promotions. :)

Thanks.

Weasel Op
Oct 31, 2005, 09:28 AM
Actually be careful here.....

(0,0) is actually bottom-left. ;)

X = shift upwards
Y = shift right

Dale

:wallbash:
Whatever happened to standardization?!

@CK: I'll check it out.

Colonel Kraken
Oct 31, 2005, 09:51 AM
@CK: I'll check it out.

Thaks, Weasel Op! Just did. Looks like there are three relevant files:

(1) \XML\Units\CIV4PromotionInfos.xml
(2) \XML\Text\CIV4GameTextInfos_Objects.xml
(3) \XML\Text\CIV4GameTextInfos.xml


(1)Used to describe what the promotion does:

PromotionPrereqOr1/2: the required pre-req promotion
TechPrereq: duh!
Next are all the different abilities: pretty obvious what they do.
UnitCombatType: which units may use this promotion
UnitCombatMod w/ UnitCombatType: Percent combat increase against that type of unit.

(2)Used to merely give the actual text name that'll appear for that promotion (e.g. Combat I)
(3)I believe this is the in-game text help. (??)


That was from a quick scan. I may be wrong on some of it.

See what you can come up with, Weasel.

Weasel Op
Nov 01, 2005, 10:46 PM
:bump:
We almost slid off into the third page of oblivion.
I added some stuff to the WB section. I haven't had a chance to dig into the XML yet. I'm really waiting for Isak's API.

tndp
Nov 01, 2005, 11:13 PM
Elsewhere in the forum it has been implied (probably explicit instructions have appeared) that you can put modified Assets into a custom assets folder, which will be preferentially loaded allowing you to leave your originals unmolested. If the search feature in the forums were enabled I'm sure I could find this out without asking.

I see my Civ IV directory has a short-cut titled - "_Civ4CustomAssets" - but it doesn't seem to work (modified XML files put in the correct directory tree location are not loaded). I assume that I need to do something - rename the shortcut? Replace it with an actual directory? Call the executable with a flag?

Whatever it is I need to do - this is the sort of meta-instruction that should go in the overview section of a useful guide. A brief discussion of the entire directory structure might be helpful as well (outside links would be perfectly acceptable there, though,) to help reduce the panic factor, if nothing else.

Weasel Op
Nov 03, 2005, 09:31 AM
:bump:
I'll try to get to that tonight. Mid-week is busy for me, so I haven't done anything for a few days.

Modifiable
Nov 03, 2005, 01:53 PM
Ok, this might not be the right thread, but I'm asking anyway. Does anyone know what files would have to be changed to change the diplomacy. There is a bug in the hotseat diplomacy that seems like it's probably a pretty simple fix if I could find the right file. When you offer a human player a trade, the trade is immediately pulled off the table as if you had hit clear table. I was wondering if there was a python file that covers this and could be fixed.

Karam
Nov 04, 2005, 07:29 PM
Will the SDK be free?

Weasel Op
Nov 05, 2005, 02:37 PM
It will be a free download, probably from the Civ4 website.

Modding Overview updated with folder setup, file placement, and search paths.

Mr. Will
Nov 05, 2005, 10:35 PM
I'm also looking into the promotions...
Since the buttons for promotion are moved around depending on the unit's existing buttons, I'm guessing that you do not have to specify where a new button for a new promotion would go. However, where would you add a new promotion graphic, how would you link to it, and can you animate it (or not animate it) anyway you want? (i.e., discarding the "glowing" around the button.)

BTW, where are the units classed into mounted, armored, gunpowder, melee, etc.?

Thanks. I'm hoping I can help a little more than I could with Civ3.

Oh. Also, is there a place where the effects of the non-quantative promotions are defined? Things like blitz and amphibious assault. Is it possible to add entire new effects to promotions? It would be interesting if you could add a sacrifice promotion like the Aztec scenario in Civ3 or if you could create units that spread culture as a promotion.

Mr. Will
Nov 05, 2005, 10:43 PM
One more question...

Once SDK is realeased, you can work with oter 3D models, right? Therefore, older unit creators like aaglo, Kinboat, and Muffins will be able to import their raw models into Civ4 and texture them, allowing us to use most of their units again, right?

If I have that concpet completely wrong, please explain it to me. I'm still pretty sketchy.

JG99_Korab
Nov 06, 2005, 01:24 PM
though only those who know c++ will be able to really do anything with the sdk. right?

Weasel Op
Nov 06, 2005, 01:33 PM
@Mr Will: The Gamebryo engine won't be included in the SDK, so we will have to work with its limitations. We will probably be able to import models more easily once we have the SDK, but we probably won't be able to import in other formats. So unless the current models can be made into NIF files, then no. aaglo's models will definitely not be converted.

@JG99: Right, it's just the C++ source code of the game.

Mr. Will
Nov 06, 2005, 02:45 PM
Any clues on what I asked about promotions?

Weasel Op
Nov 06, 2005, 05:29 PM
I haven't really looked into that yet. I'll see if I can get to it tomorrow.

Alathan
Nov 08, 2005, 05:53 PM
:help:
For a game that's supposed to be completely moddable, they're making it extremely hard. Can one add a new civilization or at this stage, would an existing civilization need to be replaced?

We can indeed add new civs without replacing old ones. The following thread by BrentRitchie discusses doing just that:

http://forums.civfanatics.com/showthread.php?t=135459

However, you might need to "borrow" another civ's leaderhead until you can make your own (or find some custom ones here some day). Other graphics (like flags) shouldn't be too difficult to make on your own.

Weasel Op
Nov 08, 2005, 10:16 PM
I *will* get to the xml stuff soon. I've had a few people ask about promotions, so that will be my first priority.

Kentharu
Nov 09, 2005, 10:30 PM
questions questions though... cause i don't really know where to put this but can any of the veteran mods or new mods... or modders period ahhhh... could any of you "proof read" my civ XML thingy. i made a new Caribbean civ, cause that is where im from so why not, and i'm not sure if i got it right. I have it in notepad "format" if that is a format so help?

Weasel Op
Nov 09, 2005, 10:49 PM
Have you read BrentRichie's XML tutorials? In the first one he covers adding new civs step-by step. Try comparing yours to his, try it in the game, and if it doesn't work maybe you can figure it out there or somebody can look at it.

Weasel Op
Nov 12, 2005, 08:07 PM
I decided to wait for Isak's XML API before adding more info there. I'm bound to get things wrong if I don't. Hopefully he will get it finished soon. I'll include a general overview of each file, and list which files you need to work with for any given task.

gakkun
Nov 13, 2005, 06:59 AM
Umm I need help on xml modding if it's okay to post here.

How do I change which tech enables a particular improvement? eg. make pottery enabling winery not monarchy. I've looked in the relevant files ImprovementInfos, BonusInfos and TechInfos but in none of them seems to let you change that.

davbenbak
Nov 13, 2005, 10:00 AM
Could you be more specific on creating a path to a custom mod. Example: Copied the "Greek World" mod folder, renamed it and moved it back into the mods folder. Now how do I create a path so that it shows up with the rest of the mods when I chose "Play a Scenario" in the game menu?

Ok, I figured out that you have to choose the "Advanced" menu then "Play a Mod" but when I select my mod the game restarts with my mod name in the upper right hand corner but now what?

Gabryel Karolin
Nov 13, 2005, 11:40 AM
Any official word on when we can expect to be able to start modding units, etc?

Weasel Op
Nov 13, 2005, 02:27 PM
gakkun: I know it's possible to change the prereq, but I'm not sure how. I'll take a look. When Isak releases the XML info I'll be able to go into that kind of thing in more detail.

davenbak: Once the game restarts, the mod is loaded. Now you just start a new game.

Gabryel: Official, no. There is a Blender plugin in development, and Maya and Studio Max may work (although they are very expensive programs). We may have to wait for the SDK. We can make new skins for models now, using DDS converters and any graphics program.

thtycho
Nov 14, 2005, 12:53 AM
My first post on this forum... :)

Friends and I are trying to understand how all Python code, XML code and Civ4 are put together. Now I'm looking at the "American Revolution" as an example and trying to configure out the structure.

I can see, for example, how Assets\Python\Screens\CvDawnOfMan.py loads text from Assets\XML\Text\AmRevTextInfos.xml. (I can also understand much of the code. Thanks to your Python for Civ4 API.) My questions for now are:

Who (or which components of Civ 4) loads these Python files?
In the case of American Revolution, who loads, for example, Assets\Python\Screens\CvDawnOfMan.py and CvAmRevEvents.py?

I want to know this so to know if I must "tell" certain components to load my Python files. Also, I am trying to configure out if there is certain naming convention that I must follow.

Thanks for any info, everyone.

snarko
Nov 14, 2005, 02:16 AM
Assets\Python\EntryPoints\CvEventsInterface.py loads CvAmRevEvents.py.
Not entirely sure what loads CvDawnOfMan but it might be CyPopupInfo. Look at onGameStart in CvAmRevEvents.py for my reason for guessing that.

LAnkou
Nov 15, 2005, 02:06 AM
well, i have a question...

When you want to create a mod, you add a new folder in the Civilization4/mods folder, right?

and then, if you want to modify some files, you just have to copy the one to be modified in the created folder, right?

snarko
Nov 15, 2005, 03:13 AM
When you want to create a mod, you add a new folder in the Civilization4/mods folder, right?
Right.

and then, if you want to modify some files, you just have to copy the one to be modified in the created folder, right?
Right. Except that you need to keep the path the same. So if the file is in assets\xml\units it'll need to be placed in mods\YOURMOD\assets\xml\units.

Har_melin
Nov 15, 2005, 04:58 AM
I have read the XML modding intro at the beginning but I have further questions.

Let's say that I would like to make a Klingon language version of the game.

1. Where the game stores the accessible language tags? I mean if I made the Klingon version how will the game know that there is a new language and most important, how will it offer to me to use it?

I have seen a line in the CivilizationIV.ini file which defines that which is the default language from the five ones which are included in the game. Does it mean that it is enough to put a Klingon(5) addendum here, set the Language=5 and than I put all the Klingon texts in the sixth row of the XML data, after the Spanish instance? (Of course in between the <Klingon></Klingon> tags.)

2. I copy all the original XML files to the CustomAssets / XML / Text folder and modify them there, am I right? Does it mean that the game check the CustomAssets first?

3. What if I am impatient and want to see my beautiful Klingon texts at least at some instances of the game? I mean what happens if not all the text XML files are edited with the new language tags, or if a file is partially edited? Which language will be used in this case?

4. There are several exotic characters (glyphs) in the Klingon language. Did I see well that these should be inserted in the &#decimalcode; format? E.g é for "é"? Where can I check the decimalcode of specific glyphs? The Windows Charactermap shows the Unicode value not the decimal any more.

Har_melin
Nov 15, 2005, 05:02 AM
Sorry, in the 4. question I should have marked somehow the code to show it for the é, do not interpret it.

LittleRedPoint
Nov 17, 2005, 03:10 AM
I must be blind or stupid, but i can't find other folders in assets/art/... than movies i check the size of folder and searched if it is hiden but nothing. Where are all the other folders and *.dds files? I searched them
D:/progam Files/Firaxis Games/Civ... IV/assets/art/
What i'm doing wrong?

I looked the xml file, and it shows me that these things must be thare...

I want to create new religion and change the buttons and images

snarko
Nov 17, 2005, 04:25 AM
They are in Art0.FPK. You will need to unpack it to be able to mod the existing graphics (but not add new I think... but since I don't do graphics I don't really know)

LittleRedPoint
Nov 17, 2005, 04:56 AM
They are in Art0.FPK. You will need to unpack it to be able to mod the existing graphics (but not add new I think... but since I don't do graphics I don't really know)

I know some people create flags, they replace .dds files. Why not to add new ones. As it seems to me you just have to tie things together in code.

Thanks for helping

LittleRedPoint
Nov 17, 2005, 05:17 AM
Hm, it seems that google will allways help :D

http://www.2kgames.com/civ4/support_ati.htm has the installation instruction

it's in the bottom of that page...

Weasel Op
Nov 17, 2005, 07:23 PM
I'm adding more links to helpful tutorials as they spring up. Civ4Wiki (http://civ4wiki.com/wiki/index.php/Main_Page) is the biggest news atm. It should make navigating the XML and Python a LOT easier. Isak is adding all of his information, so it's already becoming a substantial source of information.

btw CK (and whoever else asked me about the XML files), I never got around to looking through the XML myself, but Max_x_fire posted a great quick ref with a summary of each file. There's a link in the XML post.

thtycho
Nov 17, 2005, 11:58 PM
I'm adding more links to helpful tutorials as they spring up. Civ4Wiki (http://civ4wiki.com/wiki/index.php/Main_Page) is the biggest news atm. It should make navigating the XML and Python a LOT easier. Isak is adding all of his information, so it's already becoming a substantial source of information.

Awesome! Just what I need! :thumbsup:

thtycho
Nov 18, 2005, 12:11 AM
Under "CvPythonExtensions" on http://civ4wiki.com/wiki/index.php/Python_files:

"This is actually implemented in C++, and CvPythonExtensions is an interface between the Python and C++. There is no CvPythonExtensions.py file, however a lot of important functions are in the module."

Does that mean, in my Python code, I can simply use "from CvPythonExtensions import *" and it will work fine just like in other "official mods" (i.e. American Revolution, Desert War)?

Just making sure. Thanks.

Weasel Op
Nov 18, 2005, 10:49 AM
Right. If it works in the official mods, it will work in yours. :)

Anthropoid
Nov 19, 2005, 12:02 PM
ADDIT: to clarify/answer my own question in my original post, user-built "cusom" mods have to be placed in the My Games/ directory not in the Program Files/ directory. I moved a mod folder over to the My Games version, and now the starting turn durations are properly shortened. You might want to clarify this in your first couple posts in the thread Weasel. I read the entire thread, and I did not see this point clarified. It might be a fairly obvious point to modders, but to those who are simply interested in USING mods, it might be important :)

Thus the path for this mod that I'm trying out must be:

Desktop/My Documents/My Games/Sid Meier's Civilization4/MODS/Derelict's Truly Epic


It WILL NOT work if it is in the following path:


(C: )/Program Files/Firaxis Games/Sid Meier's Civilization4/Mods/Derelict's Truly Epic

Even though it DID give me the option to load it in the "Load a Mod" tab, and when I went to "About this Build" it listed the mod as being in effect.

Also, note that the custom version has "MODS" as all-caps verses the original in Title Case "Mods".


ORIGINAL POST:

Hey guys, great thread!

I have a fairly simple question. At this point I'm just trying to understand how it all works, without even aspiring to my long-term aspirations to mod!

Why do I have copies of Sid Meier's Civ4/etc., etc . . . in BOTH

(C: )/Program Files/Firaxis Games/Sid Meier's . . . and in:

Desktop/My Documents/My Games/Sid Meier's . . . .

My reason for asking is, I've dled a little mod by Derelict that simply makes the game play a bit slower. When I try to run it going to the Advanced Tab/Load a Mod in the main game window, it warns me that it is restarting, and it does. When I check out the "About this Build" it now lists "Derelict's Truly Epic" as the mod that is in effect, but then when I start up a new SP game, it still have the 40 year turn times at start instead of the 28 which Derelict's mod is supposed to cause.

I suspect this is not working because I've installed the Derelict's Truly Epic mod folder in the Program Files/ directory instead of in the My Games/ directory?

I notice that the list of folders and files in the My Games directory seem to be the ones that refer to customized assets and such, so I'm guessing that it is in this area that user made mods need to reside?

Weasel Op
Nov 19, 2005, 12:59 PM
I don't know how the MODS folder works, but I've used both Custom Assets and the Civilization 4\Mods folder successfully. The Custom Assets directory is for files that you want to use all the time. Civ4 will always load these files first. The Civilization 4\Mods folder is for custom mods that you can choose to play. When you load a mod, the game will restart and use all of the files in the folder for that mod, but the Custom Assets folder will still be used. It goes like this:

Custom Assets>>Mods\MODNAME>>Assets

Any Custom Assets files are loaded, then if a mod is being run all of the files in the mod folder are loaded (but not files that have already been loaded from Custom Assets), and finally all remaining files are loaded from the main Assets folder.

If you are making a change that you want to apply to ALL games, you put it in Custom Assets. If you are making a change for a specific mod, you put it in Civilization 4\Mods. If you want a mod to load by default, you can specify it in the ini file with "Mod = Mods\MODNAME"

If it's not working this way, you may need to clear your cache. Civ4 saves a lot of files in a cache folder and uses them instead of reloading the files, so sometimes changes don't appear as they should. Go to C:\Documents and Settings\USERNAME\Application Data\My Games\Civilization 4, show hidden files and folders, and delete the cache folder. You may need to do this periodically as you make changes.

Anthropoid
Nov 19, 2005, 01:18 PM
This mod is a very slight alteration in the game, only changing the relative time requirements for techs, and all buildable things (units, but not buildings I think) as well as making it 750 instead of 650 turns max, the overall goal being to slow it down even more than in the out of the box Epic version.

Instead of 40 years per turn at outset, it is set to 28. When I initially had the it in the My Programs/ . . ./Mods directory, it was not working, even when I loaded it from the Advanced/Load a Mod tab.

Once I put it in My Documents/ . . ./MODS instead, it loaded just fine.

snarko
Nov 19, 2005, 01:20 PM
ADDIT: to clarify/answer my own question in my original post, user-built "cusom" mods have to be placed in the My Games/ directory not in the Program Files/ directory. ...

...

This is wrong. Most likely your problem was not clearing the cache (see two posts above). You should not put the mods in my documents/my games/*/mods as this will make you unable to load games saved when using the mod.

Anthropoid
Nov 19, 2005, 04:24 PM
ADDIT: clearing the cache has made the mod work properly from the Mod/ folder! Yeahh!

This is wrong. Most likely your problem was not clearing the cache (see two posts above). You should not put the mods in my documents/my games/*/mods as this will make you unable to load games saved when using the mod.

Yes that is exactly what I have happening now! :blush:

Snarko seems to be exactly right. Putting them in the My Games/ directory causes them to be unable to load. Will check the clear cache issue in the posts above, and see if that makes the mod run properly once I move it to the other directory.

What was it Edison said "Genius is 99% perspiration, and 1% inspiration!?"

Weasel Op
Nov 19, 2005, 04:28 PM
snarko, do you know what the MODS folder is for, and what it does?

Crossbowman
Nov 19, 2005, 10:03 PM
This question may be simple, but I can't find the answer myself:
What do I need to do to let a custom unit appear in the game?

I did everything that is described in unit modding threads.
1-I unpacked art0.fpk
2-I created a mod file with the good folder names
3-I moved all the xml files to the mod folder
4-I made a copy of the "worker" unit in UnitInfo.xml
5-I changed the references (class, type, description, strategy, civilopedia) from (...)_WORKER_(...) to (...)_modernWORKER_(...)
6-I did step 4 and 5 in UnitClassInfos.xml, GameTextInfos_Objects.xml, GameText_Civilopedia_Units.xml, ArtDefines_Unit.xml
7-I changed the name of the unit in GameTextInfos_Objects.xml to modern worker
8-I started civ4 and loaded my mod
9-The unit could not be found anywhere

Did I forget something?

I also destroyed every other unit (in the mod xml file) and they are still there. Is it normal?

Weasel Op
Nov 19, 2005, 10:22 PM
clear your cache

Crossbowman
Nov 19, 2005, 10:35 PM
What???? and how????

Weasel Op
Nov 19, 2005, 10:43 PM
If it's not working this way, you may need to clear your cache. Civ4 saves a lot of files in a cache folder and uses them instead of reloading the files, so sometimes changes don't appear as they should. Go to C:\Documents and Settings\USERNAME\Application Data\My Games\Civilization 4, show hidden files and folders, and delete the cache folder. You may need to do this periodically as you make changes.

1234567890

snarko
Nov 20, 2005, 01:54 AM
snarko, do you know what the MODS folder is for, and what it does?

Not sure I understand the question. It's for loading mods?
Putting something in the mods folder makes that take the highest priority when the game is loading the files. Or second highest, after the cache. But you need to tell the game to load the mod instead of just having it load all the time, like in customassets or assets (assuming the file isn't read from somewhere with a higher priority obviously).

Weasel Op
Nov 20, 2005, 10:53 AM
That's the "Mods" folder in the main Civ4 directory. I'm talking about My Documents\My Games\Civilization 4\MODS. Nothing is installed in it, and I hadn't heard anything about it until Anthropoid mentioned it. You said you games using that folder can't be saved.

snarko
Nov 20, 2005, 12:03 PM
They can be saved but you can't load them. Not because there's something wrong with the folder itself, because there's something wrong with how the game loads mods (it's assuming the path has to start with mods\). Other then that it seems to work just like the normal mods one. Why they made two places? Don't ask me :p

Anthropoid
Nov 20, 2005, 02:57 PM
What???? and how????

I had to ask Windows Help how to "Show Hidden Files and Folders" but other than that it was a snap to clear the games data cache. BTW, it is the Applications Data folder that is hidden.

You reckon this having to clear the cache business is something they'll address in a patch? Doesn't seem to user friendly to have to find a hidden folder that only a MSC type person person would know about, and clear it in order to get the application to switch between mods.

gakkun
Nov 26, 2005, 11:46 PM
Can someone teach me how to mod which civs are at war with each other for a scenario?

pduthie_au
Nov 27, 2005, 07:29 PM
I've been fiddling around this weekend with some basic modding, and I've found that no matter what I do with the mod in "c:\program files\firaxis games\sid meier's civilization iv\mods\mymod", it won't load - I tested this by changing a barracks to give +100 health, then using the World Editor to give my city a barracks and it wouldn't show. And yes, I did clear the cache - several times in fact.

If, however, I put the mod into mydocuments\my games\Civilization 4\mods, it works perfectly first time.

Also, I think that the cannot load bug relating to this folder has been fixed in 1.09 because I seem to be able to load save games without any hassles.

Something I want to try tonight when I get home from work is to see if it is possible to create a worker task that will build a pipeline to bring water to a city's outskirts - similar to the old irrigate to city in earlier civs. It should be possible, but I will have to think closely about it.

Draskar
Nov 30, 2005, 04:48 AM
I have read this usefull topic, but the directory tree in italian version is different. The Assets/art directory has only "interface" and "movies" directory.

Where the other directories? Where are the units?

What kind of files are the units animatione etc..? *.?

Weasel Op
Nov 30, 2005, 04:21 PM
Have you unpacked art0.fpk?

PointlesS
Nov 30, 2005, 08:42 PM
has anyone figured out how to import models? or is there a nif plugin that actually works for civ 4 yet?

Weasel Op
Nov 30, 2005, 11:11 PM
Short answer: no.

Long answer: there are some plugins being developed, and Firaxis has implied that they will release their tools soon, but we may not be able to create new models until we have the SDK.

Draskar
Dec 01, 2005, 02:27 AM
Yesterday i have unpacked the files.

Thanks for help

dlordmagic
Dec 08, 2005, 01:10 AM
I like the quick reference but in which files are all these class references coming from.

Weasel Op
Dec 08, 2005, 01:36 AM
A lot of them import from the DLL files. If you can't find a class in the Python code, it's probably referencing a DLL.

dlordmagic
Dec 08, 2005, 01:47 PM
Thanks its what I thought but I wasnt 100% sure.

King Coltrane
Dec 20, 2005, 04:07 PM
hey all, this is probably a stupid question, but how do i get to the cheat code thing for the world builder? i read weasel's blurb about it and cant figure out what im diong wrong. im in c/program files/firaxis games/SMCiv4 and see the shortcut to _Civ4Config but its only that, a shortcut without anything being "shorcutted to" so when i try to double click on it nothign happens, and when i go to properties by right clicking it doesnt give a target.

so. what am i doing wrong and what do i have to do to fix it?

thanks in advance

white rabbit
Dec 20, 2005, 04:32 PM
RE: MODDING UNIT GRAPHICS
Is it possible to import the NIF files into 3D studio?
is this "milkshake 3d" software (whatever that is!:)) available?
the models cant be too complex... surely if they can be opened and saved in more common modelling software they could be accessible. any body any ideas?

Weasel Op
Dec 20, 2005, 04:44 PM
King Coltrane: The actual ini file is located at C:\Documents and Settings\USERNAME\My Documents\My Games\Civilization 4\CivilizationIV.ini Try setting the file path (in the properties tab) to that.

white rabbit: I don't know much about models, but from what I understand the .nif models used in Civ4 are not standard .nif's (like the FLCs from Civ3 were not standard FLCs). They have features which current modelling programs can't read or save, so any imported models will not be fully compatible. Apparently it's possible to import static red primitives, but that's not very helpful. IIRC the plugin that the niftools team is working on will be used with Milkshape 3D (which is available free).

white rabbit
Dec 20, 2005, 05:06 PM
so it may be possible to download milkshake 3d? it cant be too complicated to use (i have knowledge of 3d studio, maya, rhino etc) ?
i think modding the unit graphics properly, either by manipulating the existing units or creating new ones (more effort, but easily doable if we know the peramaters of the model) is the way to create some awesome scenarios for civ 4.
presumably, the unit characters are polygon meshes (solids) with applied textures.. hence the "skins"
?

white rabbit
Dec 20, 2005, 05:23 PM
Ok I just found out that the 3d modelling package is easily downloadable
its called milkshake 3d, just type it into google

So... anybody understand how to access the models and where they are saved in your Civ 4 folders?

Weasel Op
Dec 20, 2005, 05:47 PM
So... anybody understand how to access the models and where they are saved in your Civ 4 folders?
The models are the .nif files in the various unit folders (Assets\Art\Units), but you can't make or modify models yet. There is no available program that can create the proper models. We have to wait for Firaxis to release the tools, or for the niftools team to adapt their plugin to work with Civ4.

King Coltrane
Dec 20, 2005, 07:04 PM
thanks wealsel, that worked.

kamandi
Jan 04, 2006, 06:47 PM
Which files do I have to modify to create a new building? I am trying to create a new building for a civ and give it to them to make it a dependency for a couple of national wonders. However I get the error Tag:BUILDINGCLASS_TEXAS in Info class was incorrect, Current XML file is: Civilizations/CIV4CivilizationsInfos.xml I have created the entries for this building in CIV4BuildingClassInfos.xml, CIV4BuildingInfos.xml and CIV4GameText_Civilopedia_BuildingsProjects.xml. AM I missing somewhere? I am trying to use default building models for now.
The text from that xml file is <FreeBuildingClasses>
<FreeBuildingClass>
<BuildingClassType>BUILDINGCLASS_TEXAS</BuildingClassType>
<bFreeBuildingClass>1</bFreeBuildingClass>
</FreeBuildingClass>
<FreeBuildingClass> <BuildingClassType>BUILDINGCLASS_PALACE</BuildingClassType>
<bFreeBuildingClass>1</bFreeBuildingClass>
</FreeBuildingClass>

This works if I change from TEXAS to COLOSSUS, so I don't think that the syntax is an issue, and I basically copied all the entries for another building in the other 3 xml files and changed the BUILDINGCLASS and BUILDING keys. Can you not add new buildings at all at this point? or am I missing something?
Thanks,

jalapeno_dude
Jan 04, 2006, 07:43 PM
Try clearing the cache...

white rabbit
Jan 06, 2006, 04:32 PM
The models are the .nif files in the various unit folders (Assets\Art\Units), but you can't make or modify models yet. There is no available program that can create the proper models. We have to wait for Firaxis to release the tools, or for the niftools team to adapt their plugin to work with Civ4.

sorry, no offense, thats a complete pain in the jacksy. i thought this was supposed to be the most moddable version of civ yet?? in every other version of civ it has been reasonably simple to create or edit units -what decent scenario didnt have its own units ? come on Firaxis, what are you playing at!!!

:rolleyes:

Lucas87
Jan 06, 2006, 07:24 PM
where should I look in the python files for editing what happens when an event occurs. For example, if I wanted to change the effects of a golden age. Or even how I would go about adding in an event. Say, I wanted to add an earthquake event. I'm sure once I find the right files, I can make some stuff with enough studying of them. But it would be nice to know where this stuff is kept in the python folder.

Granias
Jan 09, 2006, 01:50 PM
Lucas, I think you'll find what you need in Assets\Python\CvEventManager.py

Weasel Op
Jan 09, 2006, 07:23 PM
Sorry everyone, I've been traveling the last few days with no internet access. I've been meaning to compile a list of what XML and Python files are needed to do what, and what information is contained in each file. But of course I haven't gotten around to it yet.
kamandi, I don't know the answers to your question ATM, but that is the sort of thing that I will be documenting. Clearing the cache may help.
Lucas87, I also think CvEventManager.py is what you need.

kamandi
Jan 10, 2006, 12:13 PM
kamandi, I don't know the answers to your question ATM, but that is the sort of thing that I will be documenting. Clearing the cache may help.

Clearing the cache did work. Didn't think that was the problem as some other new stuff showed up, but now I clear the cache everytime I modify anything just to make sure.

DocScott
Jan 11, 2006, 07:05 PM
Hi all,

Great thread! It inspired me to register for the forums...

I've been trying a fairly simple mod to make PBEM games start a bit faster (e.g. 3 settlers to start instead of 1). One feature of the standard game I haven't been able to locate, though: the scout that expansive civilizations start with. If a civilization is modified to start with more free units (e.g. settlers and warriors), it loses the scout. I could put the scout back in "by hand," but that won't work for, say, the English, where one leader is expansive and the other is not.

Any ideas where in the code that scout hides?

Morred
Jan 11, 2006, 09:19 PM
I think the Scout is more to do with Starting Techs, if you have the correct starting tech, you get a scout.

Vadus
Feb 03, 2006, 04:58 PM
Just a question : When will the Civ Development Kit come out ? The last thing I heard was sometime in january .... :confused:

Weasel Op
Feb 03, 2006, 05:08 PM
Junuary or early February was what I heard.... hopefully any time now.

Kopernikus
Feb 05, 2006, 01:13 PM
Has anybody here any useful informations regarding the possibilitys of the SDK regarding 3D-Modells, most important of course, wether or not it's possible to import new models at all. If so, what specifications have new models to fulfill, eg. Poly-/Trianglecount, Dataformats ect.

Weasel Op
Feb 05, 2006, 01:48 PM
http://forums.civfanatics.com/showthread.php?t=155014
Neomega has imported models for buildings using a nif plugin for Blender. Only static models such as buildings can be imported ATM, but hopefully the plugin will be updated soon to support animated models.

thegreats
Feb 06, 2006, 07:42 PM
Can you help me. I don´t find the art0.fpk file, all i have is a folder in custom assets named art0.pfk.

Weasel Op
Feb 06, 2006, 10:54 PM
Art0.fpk is in the main Assets folder (Civilization 4\Assets)
Edit: depending on which version you have, it may be split into multiple fpk files called Assets

hp-p00nst3r
Feb 12, 2006, 07:51 PM
you said SDK is for "hardcore modding". What is that supposed to mean?

Weasel Op
Feb 12, 2006, 07:56 PM
With the SDK, a C++ programmer will be able to change the way the game works. Not just new material, or scripted events, but changes to the actual gameplay mechanics. With the SDK, Civ4 will be more like a gaming "platform" as Firaxis put it, rather than a single game. Everything from sharing food among cities to multiple maps to an RPG conversion have been proposed.

hp-p00nst3r
Feb 12, 2006, 08:18 PM
thank u that answers my question.

any idea when the sdk is gona come out? we're already halfway into Q1

Weasel Op
Feb 12, 2006, 08:22 PM
The last we were told was "late January or early February." That's already past, so we're just waiting to hear from Firaxis.

hp-p00nst3r
Feb 23, 2006, 12:26 AM
The 3DSMax 7 Exporter for Civ4 is now out, you should consider trying it out and modify the guide as needed.

Weasel Op
Feb 23, 2006, 07:48 AM
I've been meaning to get back into Civ4, but I haven't had the time. This guide isn't nearly as thorough as I had meant it to be. Hopefully I can do some major updates soon to bring it up to date.

Weasel Op
Aug 15, 2006, 10:37 PM
:bump:

As you can see, I have utterly failed to keep this thread up-to date, or even complete the sections that I had begun. I rarely play Civ4 these days, because I spend my game time modding Civ3. Thus I am in no place to continue with this guide. However I feel that it would be nice to have a single thread with an overview of each aspect of Civ4 modding and plenty of links to the most helpful and informative tutorials, etc. Basically, a place where anyone can look to find what they need to know about modding.
So, since I'm not the one to compile such information, I would like to ask for contributions from those who are currently active in this forum. If anyone would like to post some information, be it a few links or a detailed essay, I will gladly edit it into my opening posts with credit to the author/provider.

ulysse
Aug 16, 2006, 11:39 PM
Hi,

Thanks for this thread. I hoped that finally I found something that would help me to start modding and "Dale's World Builder Manual" really looked so. Unfortuantely, the link to http://members.dodo.com.au/~thesdale/Manual.zip does not work, I receive the following message:

Forbidden
You don't have permission to access /~thesdale/Manual.zip on this server.

Does anybody have that file?

Thanks,

Ulysse

feldmarshall
Feb 09, 2007, 08:24 AM
The World Builder

Manual: Dale (who turned out to be another one of those elusive beta testers) has made a great World Builder Manual in pdf format.
Manual (7.1 mb) (http://members.dodo.com.au/~thesdale/Manual.zip)

the site is blocked here, can you post it elsewhere?