1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

BEFORE you publish or download a Mod, PLEASE READ

Discussion in 'Civ4 - Creation & Customization' started by Rayanth, Nov 5, 2005.

  1. Rayanth

    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.
     
  2. WildWeazel

    WildWeazel -- Turns to Completion

    Joined:
    Jul 14, 2003
    Messages:
    6,837
    Location:
    %CIV3%\Conquests\Scenarios\
    I couldn't agree more. This should definitely be a sticky.
     
  3. vbraun

    vbraun Raytracing

    Joined:
    Jul 7, 2003
    Messages:
    3,530
    Location:
    Arizona, USA
    Great Post! THis definatly deserves a Sticky. :)
     
  4. woodelf

    woodelf Bard

    Joined:
    Jun 12, 2003
    Messages:
    15,036
    Location:
    Gallery
    Thanks for putting this into words. I love Mods, but don't comprehend much about them. :D
     
  5. weakciv

    weakciv Prince

    Joined:
    Jul 15, 2005
    Messages:
    469
    Location:
    -1, -4
    2 ..

    3 ..

    4 ..

    I 5th this suggestion, STRONGLY!!
     
  6. Jecrell

    Jecrell Ruled: Civ3 - Civ5

    Joined:
    Oct 9, 2005
    Messages:
    709
    Location:
    California, USA
    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.
     
  7. Dracleath

    Dracleath Warlord

    Joined:
    Jan 25, 2002
    Messages:
    231
    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.
     
  8. Rayanth

    Rayanth Prince

    Joined:
    Sep 16, 2005
    Messages:
    303
    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.
     
  9. Tunch Khan

    Tunch Khan King

    Joined:
    Jun 19, 2005
    Messages:
    805
    Location:
    Williamsburg, Brooklyn
    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. ;)
     
  10. Dracleath

    Dracleath Warlord

    Joined:
    Jan 25, 2002
    Messages:
    231
    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'.
     
  11. snarko

    snarko DLLer

    Joined:
    Dec 9, 2003
    Messages:
    1,512
    Location:
    Sweden
    Dracleath you can find the civ 4 cache in %appdata%\my games. You might need to turn on show invisible files and folders.
     
  12. Dracleath

    Dracleath Warlord

    Joined:
    Jan 25, 2002
    Messages:
    231
    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.
     
  13. DeadZoneMDx

    DeadZoneMDx Chieftain

    Joined:
    Sep 27, 2004
    Messages:
    30
    Thx for pointing the cache bit out folks :)

    Oh and I also support the motion brought up in the first post
     
  14. weakciv

    weakciv Prince

    Joined:
    Jul 15, 2005
    Messages:
    469
    Location:
    -1, -4
    hmm. I have yet to need to clear out a cashe
     
  15. Rayanth

    Rayanth Prince

    Joined:
    Sep 16, 2005
    Messages:
    303
    Please note that the Original Post has been completely revamped.
     
  16. Wyz_sub10

    Wyz_sub10 CIV Gold - Project Lead

    Joined:
    Nov 26, 2001
    Messages:
    2,425
    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.
     
  17. WildWeazel

    WildWeazel -- Turns to Completion

    Joined:
    Jul 14, 2003
    Messages:
    6,837
    Location:
    %CIV3%\Conquests\Scenarios\
    Are you setting the mod to load automatically in the ini file, or loading it from the main menu?
    The cache folder is hidden. You have to show hidden folders to see it.
     
  18. Wyz_sub10

    Wyz_sub10 CIV Gold - Project Lead

    Joined:
    Nov 26, 2001
    Messages:
    2,425
    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.

    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.
     
  19. Rayanth

    Rayanth Prince

    Joined:
    Sep 16, 2005
    Messages:
    303

    Custom*Assets* was fine. CustomMODS is the buggy directory.
     
  20. goofydink

    goofydink Chieftain

    Joined:
    May 2, 2004
    Messages:
    19



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

Share This Page