Basic Modding Questions

stfoskey12

Emperor of Foskania
Joined
Dec 27, 2010
Messages
1,189
Location
35° 12' N 97° 26' W
I would like to start modding, but first I have some basic questions.
1. What is XML?
2. What can I do with XML?
3. Do I need anything special to edit XML?
4. What is Python?
5. What can I do with Python?
6. Do I need anything special to edit Python?
7. What is the DLL?
8. What can I do with the DLL?
9. Do I need anything special to edit the DLL?
10. Is there some sort of connection between the DLL, Python, and C++?
11. What's to stop me from turning Civ4 into Zoo Tycoon 3 (besides a whole lot of work)?
 
This is quite a long list of very general questions - almost makes me think, it might be a troll post (Edit: no offense meant, just wondering ;)). Anyways...

XML is a formal language, somewhat similar to HTML. It is used to define nearly all game objects and they properties - say units, they strength, speed, bonuses just for example. As such it's the easiest to read, edit and mod. The only thing you need is a plain text editor of you choice. Notepad will work, but you will soon want some advanced search functionality, so look around for something that suits you.

Python is programming language. Modding Python allows you to edit some of the actual game mechanics and events. You still only need a text editor, however it's a bit harder to read and understand and would probably require you to know some programming basics.
The DLL is a part of the game engine, that we are able and allowed to recompile from the C++ source files. It's often referred here as SDK modding and allows for changing nearly every game mechanic aside from the very engine of the game. You will need a working, suitable compiler (one free solution is linked in my signature, there are others as well), and again a text editor and some programming experience.

These things are of course interconnected, which one you need, depends on what you want to do, many things however can be achieved by just modding XML, which is also the easiest - a good place to start.

Another good place to start would be the tutorials section here. Take a look at some XML tutorials, for example the "how to add units" one, and see what you can learn.
 
Well, even if it is a troll post, it gave me a good general look on how civ4 is organized.
Think some other lurkers might get good info from this.
 
Well, in spite of the goofiness of doing so, here are some answers... (Pretty much everything in here is covered in various tutorials down in the tutorials section.)

I would like to start modding, but first I have some basic questions.
1. What is XML?
A way of storing data. Each piece of data is tagged as to what it is for.
2. What can I do with XML?
Change the values for various properties of things (units, buildings, leaders, civics, etc.) in the game, add things that are similar to things already in the game, or remove things that are in the game. Using only XML you can not add entirely new properties to things, only use the existing properties.
3. Do I need anything special to edit XML?
No. You can do it with Notepad. You may want something with a few additional features; one popular free option is Notepad++.
4. What is Python?
A programming language. It is not compiled (converted to an essentially non-human readable form which the computer itself can more easily use) so it is often called a scripting language.
5. What can I do with Python?
You can alter some of the behavior of the game in ways that are not possible using just XML. You can also modify a lot of the user interface as most of that is put on screen via Python.
6. Do I need anything special to edit Python?
Same answer as 3.
7. What is the DLL?
It is a Dynamic Link Library. This is built from the source files by compiling it, so the DLL itself is not really human readable but the source files are. It contains most of the game rules and AI related things, other than some very basic parts of the game - this is the Library part as it is a library of things which the main program uses. It is, in essence, a piece of the game program that is in a separate file and built separately from the main .exe file. This allows different mods to have different DLLs (which is where the Dynamic Link part comes in) even though they all use the same .exe file.
8. What can I do with the DLL?
You can change the rules, alter the AI, add new things including new items to specify in the XML, and even change some parts of how the graphics are displayed. Example: you can add to what data is in the promotion related XML and change the relevant parts of the code for loading it and for rules relating to unit movement in the DLL so that a promotion can allow a unit to move across the Peak terrain.
9. Do I need anything special to edit the DLL?
Yes and No. No because you can edit the source files with Notepad if you want to. Yes because doing that does not get you a new DLL. Building the DLL from the source files requires that you download and install some software.
Notepad is also far from the best available option to edit the source code. Microsoft's free Express version of its Visual C++ (part of their Visual Studio software) is much better.
10. Is there some sort of connection between the DLL, Python, and C++?
Yes. C++ is used to make the DLL. The DLL causes the Python to run for specific things.
11. What's to stop me from turning Civ4 into Zoo Tycoon 3 (besides a whole lot of work)?
Since I have never played Zoo Tycoon, I can't say. Possibly nothing. Possibly lots of things.
 
Some minor additions to God-Emperor:
5) map scripts
9) One of the harder parts is not editing (well...if you know C++, which is not that easy), but compiling that stuff. See a tutorial here.


Other things:
6) The text editor, which comes with Pyton if you download it, is in most cases preferable to edit Python files than other editors. You can sure still do it with Notepad++ or whatever text editor, but they can sometimes behave a bit weird (could explain it longer, but that should be sufficient for now).
11) I only remember the demo, but for the basic stuff I'd say "nothing". But it would really be lots and lots of work.


In general I'd also say that most people should be able to edit the XML stuff and add or remove new things. And this should be for most cases be enough to make a good til great mod. A mod is...or better said can be just new/altered civs, units, buildings, techs, etc. and it can be great. You can turn the whole civ setting into fantasy, history, scifi, or whatever, and you only need XML (if the right graphics are given, but for the most things we have lots of).
Python and SDK editing are advanced stuff. You need them if you want to add more specific things, which you haven't seen in Civ4.
 
Back
Top Bottom