BEFORE you publish or download a Mod, PLEASE READ

Rayanth

Prince
Joined
Sep 16, 2005
Messages
303
There are alot of mod out there for civ4, and his post is both for Mod-makers and Mod-users alike, laying out the most basic information about setting up a mod the right way.

Please note that this post has been re-written more intelligibly than its original form.

The WRONG Way:: Do not ever modify the original files!

Replacing your original files. Under no circumstances should a mod require you to replace or overwrite your original game files. There simply is no reason to, civ4 and all it's expansions allow very simple and effective ways to load customization items while leaving all the original files unaltered. The one exception I can think of is Blue Marble, but that mod has been around for years, and it makes very specific and minor alterations to some textures.

The RIGHT way:

There are two ways to add customized content. One is to create or install a proper mod, the other is to put the modifications in Custom Assets.

Making a proper mod:
Mods go in the mod's directory, which is generally along the .../$Program Files/Firaxis/Sid Meier's Civilization 4/Beyond the Sword/ path (obviously no BtS if you're installing into Vanilla, and it's a Warlords folder for Warlords). When you install a mod the path to the mod should look something like this (the exact $Installpath is different, but for most users it's along $ProgramFiles, there is also a similar mods directory along $MyDocuments/$MyGames, but it's buggy, so it's not recommended to use it):
$InstallPath/Beyond the Sword/Mods/$ModName
Each Mod should get its OWN folder, and should contain copies of the files it overrides. If you have a mod you enjoy and want to launch it automatically, copy your BtS shortcut on your desktop or start menu, then name the copy shortcut the name of the mod, and right click on it and select properties. In the target line add mod="ModName" to the end of the path, as an example this is what the Legends of Revolution installer created shortcut target looks like on my computer: "C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Beyond the Sword\Civ4BeyondSword.exe" mod="LoR"

This method prevents you from having to worry about backing up your files, and is the way the Firaxians wanted us to do things. Mods that request you to back up your originals because they are being overwritten, are doing things the wrong way; you should not install them, or create them, and especially don't release them.


Custom Assets:

Custom assets modding will work, and it wol't mess up your original game, but for the most part it's not recommended. This is because custom assets are loaded first before anything else, so the can cause conflicts with some mods. If you release a mod, you definitely should not have it install to custom assets (the exception being the BUG mod). The nice thing about custom assets is that they are loaded automatically, so many modders start out using custom assets, but in the long run it can be a hassle. To use custom assets simply find the file you want to alter, and copy it into the custom assets folder; ensure you maintain the same basic file structure as Civ4 does. For instance if tweaking Unit values with custom assets, copy your CIV4UnitInfos.xml from $ProgramFiles/../BtS/Assets/XML/Units to $MyGames/BtS/Custom Assets/XML/Units, then make the changes to the file in your custom assets folder.


The Cache
Please note that Civ4 keeps a cache. For the most part the cache will not break properly created BtS mods, but it may, and it's known to cause many conflicts with Pre BtS mods and custom assets. The cache is a backup of many files, to enable Civ4 to load frequently-used (or particularly large) files faster -- the cache is a compressed version of the file re-written to be more easily machine readable. Why is this important? The game loads the cache first -- if a file is in the cache, it will NOT reload it if it was modified. How do you get around it? clear the cache! Simply hold down shift while starting up Civ4. Also you may manually delete the cache file by browsing to this directory:

$UserName\Application Data\My Games\Sid Meier's Civilization 4\cache

You can also disable caching in the main Civ4 Config file. The civ4 config file will be found in the main folder where custom assets is, and there is also a link to it from the main BtS installation folder. The name of the file is: CivilizationIV.ini
There are some usefull items you may want to change in the config file:
Spoiler :
Toggles the game into windowed mode if set to zero, to easily tab out of the game.
Code:
; Specify whether to play in fullscreen mode 0/1/ask
FullScreen = 0
Setting to 0 will give debugging statements about python going wrong. You should probably only turn these on if you know what python is.
Code:
; Set to 1 for no python exception popups
HidePythonExceptions = 0
Pretty self explanitory:
Code:
; The maximum number of autosaves kept in the directory before being deleted.
MaxAutoSaves = 5

; Specify the number of turns between autoSaves.  0 means no autosave.
AutoSaveInterval = 4
Also self explanitory, if you're using mods or doing alot of modding you should definatly set these to 1 to disable them:
Code:
; Disable caching of file system (may slow initialization)
DisableFileCaching = 1

; Disable caching of xml and file system (may slow initialization)
DisableCaching = 1
Debugging mode, change the "0" to "chiptole" as shown below. Very useful, it opens up quite a few tools. For instance pressing ctrl + z reveals the map. In all RevDCM based mods pressing ctrl + shift + X starts AI Autoplay, and ctrl + shift + l will allow you to switch players.
Code:
; Move along
CheatCode = chipotle
Pretty self explanitory, but you need to have some idea of what you're doing in order to make sense of the logs:
Code:
; Create a dump file if the application crashes
GenerateCrashDumps = 1

; Enable the logging system
LoggingEnabled = 1


Thank you all, and Happy Modding!


Moderator Action: Updated with content supplied by phungus420 - thanks for your help.
 
Thanks for putting this into words. I love Mods, but don't comprehend much about them. :D
 
2 ..

3 ..

4 ..

I 5th this suggestion, STRONGLY!!
 
Indeed -- I've done a lot of modding already but I'm not publishing without proper documentation and polish -- which is something else I suggest every modder consider before dropping the files on the forums like bombs in a war -- people might get wrecked. =)

And this should probably be stickied.
 
Customassets doesn't seem to particularly do anything though. At least not on my install, I can install something in it's own mod directory and it's fine but installing the same content in customassets doesn't lead to any changes.

Come to think of it it seems there are also similar problems with mods. I recently installed a leaderheads mod and a flag mod in the same mod directory, both refused to work at all, the mod would load but the original files. oddly enough this seemed to work itself out and later the content mysteriously started working without any intervention on my part.

I've been keeping a backup of the originals and editing the main directory lately just because the prioritizing seems to be so buggy that that seems to be the only way to get things to actually work 100% of the time.
 
Dracleath said:
Customassets doesn't seem to particularly do anything though. At least not on my install, I can install something in it's own mod directory and it's fine but installing the same content in customassets doesn't lead to any changes.

Come to think of it it seems there are also similar problems with mods. I recently installed a leaderheads mod and a flag mod in the same mod directory, both refused to work at all, the mod would load but the original files. oddly enough this seemed to work itself out and later the content mysteriously started working without any intervention on my part.

I've been keeping a backup of the originals and editing the main directory lately just because the prioritizing seems to be so buggy that that seems to be the only way to get things to actually work 100% of the time.

Did you try clearing your cache during all of this? Many things in the game are cached (particularly xml) -- occasionally this cache will prevent a change from loading.
 
I prefer to give the mod user his/her own choice depending on the structure of the mod. In the readme file, i suggest to place the mod in the proper MOD directory and load it as a seperate mod as it should be, but also give the option of overwriting the original files if they wish to do so, as they may want it as a permanent feature. I've had problems while testing the mod from the custom assests tho, and also compatibility is an issue. Most of the mods don't have to conflict with eachother but they share certain files which disrupts compatibility. Perhaps as we explore deeper in this jungle of modding we may find the right answers or die trying. ;)
 
Rayanth said:
Did you try clearing your cache during all of this? Many things in the game are cached (particularly xml) -- occasionally this cache will prevent a change from loading.

That's probably it actually. Is this an actual in-game cache or just my temporary files IE cache?

I'll try clearing the second between mod changes, if that's what you're talking about it's really odd, but I guess it's Microsoft's poor design and not firaxis'.
 
Dracleath you can find the civ 4 cache in %appdata%\my games. You might need to turn on show invisible files and folders.
 
Ok, I've been playing around with that.

From what I found the way it works is:

If you add anything to customassets or change anything there you MUST clear the cache before it takes effect. Otherwise the game won't look at it at all, you can throw gibberish in there and it won't matter.

If you change a mod that previously exists on your computer without changing the name of the mod in any way you MUST clear the cache before any of your changes will take effect in the game.


This all seems like a rather odd and confusing way to do things, especially since clearing the cache didn't seem to have that much of an effect on my load times.
 
hmm. I have yet to need to clear out a cashe
 
Please note that the Original Post has been completely revamped.
 
I have to say that I have had no problems using the CustomAssets folder, but I will repackage my mod using the 'Mod' directory structure noted above.

EDIT: Well, I can't get the mod directory to work. I've trying copying the exact structure of the other mods. I've tried omitting the 'Asset' folder and going right to XML, etc. Nothing works.

Using 'CustomAssets' the game works perfectly, but using the mod folder I cannot seem to get it to work. The top right hand corner says 'Canada Mod' but it simply does not load a damn thing in it.

Alsom, I don't seem to have a cache directory - can't find it in the Firaxis dir or Civ4 dir, although it's obvious that caching is taking place.
 
Weasel Op said:
Are you setting the mod to load automatically in the ini file, or loading it from the main menu?

I load it from the Main Menu - start the game, select 'Advanced', then load and restart. It tells me the mod is loaded but with no changes (the files are fine - works from the CustomAssets folder).

If I delete the files, the game crashes (presumably trying to load the files on startup), but then starts fine the second time (presumably loading original files). I though this would 'clean' it, but no - same problem everytime.

The cache folder is hidden. You have to show hidden folders to see it.

Hmmm, thought I had hidden folders on. Thanks, though, I'll double check and try to see if that helps. Makes me wary of switching mods, though.
 
Wyz_sub10 said:
I have to say that I have had no problems using the CustomAssets folder, but I will repackage my mod using the 'Mod' directory structure noted above.

EDIT: Well, I can't get the mod directory to work. I've trying copying the exact structure of the other mods. I've tried omitting the 'Asset' folder and going right to XML, etc. Nothing works.

Using 'CustomAssets' the game works perfectly, but using the mod folder I cannot seem to get it to work. The top right hand corner says 'Canada Mod' but it simply does not load a damn thing in it.

Alsom, I don't seem to have a cache directory - can't find it in the Firaxis dir or Civ4 dir, although it's obvious that caching is taking place.


Custom*Assets* was fine. CustomMODS is the buggy directory.
 
Rayanth said:
Ok, a few mods are starting to leak out, and I'm seeing a lot of confusion. This post is both for Mod-makers and Mod-users alike.

Please note that this post has been re-written more intelligibly than its original form.

The WRONG Way:

Replace your original files. Under no circumstances should a scenario mod require you to replace or overwrite your original game files. (There is one exception I know of, and possibly one or two others - if the mod in question is an exception to this rule, the author should clearly state so, and give a good explanation of why.)

The RIGHT way:

Note: There are two versions of the right way. One is, as of this writing, bugged. I will post it second and note it as such.

(The working way): Mods should be posted in the C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Mods\MOD_NAME folder. Each Mod should get its OWN folder, and should contain copies of the files it overrides. The modding system developed by the programmers checks here *first*, and any files NOT overridden are then loaded from the original game files.

This method prevents you from having to worry about backing up your files, and is the way the Firaxians wanted us to do things. Mods that request you to back up your originals because they are being overwritten, are doing things the wrong way (with the few exceptions noted)

The buggy right way:
There is another Mods folder, it has a shortcut labeled _Civ4CustomMods that points to My Documents\My Games\Civ4\MODS. The problem with this right now is that if you load a Mod from this folder, start and save the game, it fails to re-load it properly. There is an issue with the loading script that corrupts the path it tries to load the mod from. Developers and Players alike should avoid using this directory until the bug is fixed -- there's no real reason to use it over the core Mods directory under Program Files, that I am aware of.

The Cache
Please note that Civ4 keeps a cache. This is a backup of many xml files and other files, to enable Civ4 to load frequently-used (or particularly large) files faster -- the cache is a compressed version of the file re-written to be more easily machine readable. Why is this important? The game loads the cache first -- if a file is in the cache, it will NOT reload it if it was modified. How do you get around it? clear the cache! Simply browse to this directory:

C:\Documents and Settings\COMPUTER_USER_NAME\Application Data\My Games\Sid Meier's Civilization 4\cache

And delete all of the files in it, then reload Civ4. Do this any time you suspect a changed file is not being loaded by the game. I am currently unaware of any way of turning off caching entirely.

EXCEPTIONS
I noted a few exceptions to the practices outlined above. I am listing them here.

1) HUD Mods. Until the developers make these loadable via the Mod, the HUD is loaded from a directory that is not overwritten by mods. This directory is C:\Program Files\Firaxis Games\Sid Meier's Civilization 4\Resource -- Mods (including the one I will eventually be posting, keep tuned) for the HUD will require you to overwrite the game's original files... in this case you should most definitely back up your originals.

2) There are no other exceptions that I am aware of at this time.

I hope this post has clarified the way the Modding system in Civ4 is supposed to operate :)

Thank you all, and Happy Modding!



Well I have tried both ways and cannot get the Canada Mod that has been posted to run....
 
Top Bottom