Summary
Civ4 is touted as one of the most modable games out there today. Though, at
minimum to mod Civ4 you need to know how to edit XML files at the worst you
need to know how to edit C++ and compile the SDK files. Unfortunately the game
was shipped without an editor, this mod is the first part of an in-game editor
that will change this.
Chapters:
1 - Limitations and known issues
2 - The Basics
3 - Adding New Techs
4 - Editing Existing Techs
5 - Saving Techs
6 - Deleting Techs
7 - Editing Techs from existing mods
Chapter 1: Limitations and known issues
The released downloadable Tech Tree Editor only allows updating of the standard
values for Warlords or vanilla Civ4. If you want it to edit a custom tag
developed by a modder you will need to merge that mod with the Tech Tree Editor.
To do this you will need to merge the SDK and python files from the other mod
with the Tech Tree Editor SDK and python files.
Only technologies can be edited through the Tech Tree Editor mod. Techs can not
be added as prereq techs for buildings, units, etc. with this mod. This
functionality will be available in the Civilizeditor (Yes, the Tech Tree Editor
will be included in the Civilizeditor, no I don't know when it will be ready
:D).
There is only one known issue at this time. The issue is when you move a tech
around some times a horizontal line segment will not be removed. It doesn't
prevent the editor from working correctly but it is still a graphical issue
needing to be fixed.
Use the Tech Tree Editor you need to start a new game. Once the
game is started press the key combination ALT-F6 to bring up the Tech Tree
Editor screen as shown in figure 1.
(figure 1)
A: The pos:(1,1) indicates the position of the technology in the tech tree.
B: The "Save" button, use this to write out all of the affected files to disk.
C: The "Add New Tech" button, use this to add new techs to the game.
D: Click on a technology to bring up the tech editor window.
E: Technology image button. Click on the image used to represent the technology
in the tech editor to change it.
F: Technology name. Click on the name of the technology in the tech editor to
change it.
G: Minimize/Maximize buttons. Click on the minimize button to shrink the tech
editor to minimize the tech editor so it displays only the tech image, name,
maximize and delete buttons. The minimize (-) button is replaced with the
maximize (+) button when pressed.
H: Delete technology button. Click on the delete button to delete the
technology from the game. The technology is completely removed from the game
this includes instances where the technology is a prereq for game objects
like buildings, units, etc.
I: Close tech editor window. Click on the close button to close the tech
editor.
J: The exit button. Click it to exit out of the Tech Editor screen.
Figure 2 shows all of the values that can be set through the tech editor.
(figure 2)
There are several steps to adding new techs via the tech editor.
1) Click on the "Add New Tech" button in the lower left-hand side of the tech
editor screen (the button is circled in red in figure 3) to bring up the "Add
New Tech" popup dialog as show in figure 4. In this case "Ceremonial Buriel"
as been entered into the dialog. (Yes, buriel is mis-spelled intentionally).
(figure 3)
(figure 4)
2) After entering the name of the new tech press the "OK" button in the "Add
New Tech" popup dialog the new tech with the name entered will be added to the
tech tree in the (1,1) position. Additionally the new technology is
automatically selected. See figure 5.
(figure 5)
3) Hovering over the name shows the associated tooltip, shown in figure 6. To
change the name of the technology (and to fix the mispelling from earlier)
click on the name of the technology in the tech editor window. See figure 7.
(figure 6)
(figure 7)
4) Hovering over the tech image shows the associated tooltip, shown in figure
8. To change the image for the technology click on the image for the technology
in the tech editor window. By default technologies added through the tech tree
editor will have the "replace me" image. See figure 9.
(figure 8)
(figure 9)
For the purpose of example the wrong name for the new technology is entered.
See figure 10. A ugly pink box is displayed when an invalid path is set for a
technology image. See figure 11. An invalid path can be a result of mistyping
in the name of the file or providing a path that the editor cannot reach. To
make things easier all artwork should be put inside of the tech tree editor's
assets/art folder. Any new artwork will automatically be copied into the
correct location when the save button is used.
(figure 10)
(figure 11)
When the correct path to an image for a tech is used, see figure 12, the tech
image is automatically displayed, see figure 13.
(figure 12)
(figure 13)
Next, the new technology should be moved to where it should be in the tech
tree. As previously stated, new technologies are placed in the (1,1) position
by default. See figure 14 (the position has been circled in red in both the
tech tree and editor).
(figure 14)
To change the location of a technology you will need to select a tech and
press the up, down, left or right arrows in the tech editor. In this example
the newly added technology is moved to the (1,9) position. See figure 15.
(figure 15)
The last part in adding a new technology is changing its values. We won't go
into the details of all the different values that can be changed. The following
chapter will go through the process of editing an existing tech including
adding new "OR" and "AND" tech prereqs.
Chapter 4: Edit Existing Tech
This chapter assumes that the tech added in chapter 3 is in the (1,9) position
in the tech tree.
In this chapter, the tech added in chapter 3 will be added as a "OR" and "AND"
prereq tech to existing techs. In the tech tree "OR" tech prereqs are shown as
lines from one tech to another tech and "AND" tech prereqs are shown as icons
in the upper-right hand corner of techs in the tech tree. (I know that this
last bit might be obvious to some but to others I might not be.)
1) Select the tech to add a tech as an "OR" prereq and scroll down in the tech
editor to the "Or Prereq Tech" section. Next click on the "Add Or Prereq Tech"
drop down list to select the tech that should be added as a "OR" prereq. See
figure 16.
(figure 16)
NOTE: The contents for both the "OR" and "AND" prereq tech drop down lists is
constrained by several factors. These are used to prevent recursive prereq tech
associations that cause the game to crash.
2) To add the selected tech as a "OR" prereq click on the "Add" button next to
the "Add Or Prereq Tech" drop down list. When this is done the tech editor is
updated to include the new tech as a "OR" tech prereq for the selected tech and
a line is drawn from the "OR" prereq tech to the selected tech in the tech
tree. See figure 17.
(figure 17)
NOTE: By default only 4 "OR" and "AND" prereq techs can be added to any one
tech. To change this the NUM_OR_TECH_PREREQS and NUM_AND_TECH_PREREQS entries
in the GlobalDefines.xml must be changed by editing the GlobalDefinesAlt.xml
file and changing their values there to the desired value.
3) Select the tech to add a tech as an "AND" prereq and scroll down in the tech
editor to the "And Prereq Tech" section. Next click on the "Add And Prereq
Tech" drop down list to select the tech that should be added as a "AND" prereq.
See figure 18.
(figure 18)
4) To add the selected tech as an "AND" prereq click on the "Add" button next
to the "Add And Prereq Tech" drop down list. When this is done the tech editor
is updated to include the new tech as a "AND" tech prereq for the selected tech
and the icon for the new "AND" tech is displayed in the upper-right hand corner
of the selected tech. See figure 19.
(figure 19)
This chapter assumes that the changes to the tech tree in chapters 3 and 4 have
been made.
Click on the "Save" button to save all changes made to the tech tree. The saved
XML file(s) will be placed in the directory with the name specified in the
"Save Directory Location" option found in the "Tech Tree Editor Config.ini"
file. If the "Create Asset Hierarchy" option in the
"Tech Tree Editor Config.ini" file is set to true then the complete asset
directory structure will be created as well.
XML files will be written out if their underlying objects (units, buildings,
etc.) have been affected by the changes made in the tech tree editor.
Chapter 6: Deleting Technologies
This chapter assumes that the changes to the tech tree in chapters 3 and 4 have
been made.
1) Select the tech to be deleted by clicking on it in the tech tree. Hovering
over the delete button (found in the upper-right hand corner of the tech
editor) for the tech shows the associated tooltip, see figure 20.
(figure 20)
2) Press the delete button in the tech editor to delete the tech from the tech
tree. The tech is then removed from the tech tree and in the case shown in
figure 21. The areas circled in red show the parts of the tech tree affected by
the deletion of the tech.
(figure 21)
Chapter 7: Editing Techs from existing mods
To edit the techs from an existing mod merge that mod's XML director and art
directories with the XML and art directories for the tech tree editor. The only
XML file changed by the tech tree editor mod is the CIV4ControlInfos.xml file.
The only files included in the art directory are: checked.dds, unchecked.dds
and ReplaceMe.dds.