Customization
Civilization IV is much more open to modification than its predecessors. Game data and rules are stored in XML files, and a Software Development Kit was released in April 2006 to allow AI customization. Major parts of the interface, map generation, and scripted events are written entirely in Python and can be customized.
The World Builder allows a player to create a map from scratch or to use an in-game situation as a starting point for a new scenario. The player can modify the map by placing and modifying rivers, landmasses, mountains, resources, units and cities. For example, it is possible to adjust a city's population or culture. Additionally, each civilization's technological progress as well as its diplomatic and military ties to other civilizations can be edited. The world builder can also be used during the middle of a campaign to change anything from names of cities to giving yourself more units making it a quite useful in game cheat device. The World Builder for Civilization IV is in-game, in contrast to previous Civilization games where the Map Editor was an external application.
More game attributes are stored in XML files, which must be edited with an external text editor or application. Barry Caudill, a senior producer at Firaxis Games, said in September: "Editing these files will allow players to tweak simple game rules and change or add content. For instance, they can add new unit or building types, change the cost of wonders, or add new civilizations. Players can also change the sounds played at certain times or edit the play list for your soundtrack."
At the current time the XML processing in Windows is permissive of errors, whereas the Mac OS X version is not. As a result, some XML files which will work on the Windows version of the game may need correcting before they function correctly on the Macintosh version.
The game uses boost.python to allow the Python access to many parts of the game (including the style and content of all interface screens). Python can also be used to modify random map generation and to add complex scripted events. The version of Python present in the Windows version of the game differs from the version in Mac OS X up to and including version 10.4.7, and as a result, while most Python files for the Windows version will work on the Macintosh version, not all will. The reverse is also true.
The Civilization IV software development kit was released on April 13, 2006 to coincide with the release of the v1.61 patch. The kit allows players to view, modify, or completely re-write the game's DLL source code, enabling the modification of the game's AI and other integral parts of the game.
As of the first official patch for the Macintosh version (v1.61 Revision A), there is no SDK for the Macintosh version of the game. In fact the Macintosh version lacks the separate library of game related code which the PC version uses, but instead includes the code compiled into the main executable. There is as of yet no indication of whether this will change in a future patch.
Read more about this topic: Civilization IV