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

Problems running multiple mods

Discussion in 'Civ5 - Creation & Customization' started by alysenne, Feb 8, 2011.

  1. alysenne

    alysenne Chieftain

    Joined:
    Nov 10, 2005
    Messages:
    40
    How does the mod system resolve conflicts?

    Some of the good (or more popular mods) encompass so many changes. Some mods add a lot of 'extras' that have nothing to do with the main functionality. It seems like it could be difficult to install multiple mods without running into some overlap.

    For example, what happens if two mods try to change the same policy or the same building? What happens if two mods try to change the same UI element?

    I'm running into a lot of crashes right now and I'm trying to figure out what's going on.
     
  2. Spatzimaus

    Spatzimaus Mad Scientist

    Joined:
    Sep 21, 2005
    Messages:
    3,063
    Location:
    Los Angeles, CA
    How does it resolve mod conflicts? It doesn't. Depending on what type of incompatibility you're dealing with, the game will either ignore one set of changes or just crash.

    There are a few different types of compatibility issue.

    1> XML database updates.
    Generally speaking, two mods that only modify XML will combine fairly well. You might get some balance headaches, but it's not going to cause a crash.
    Order of operations generally applies here. If mod A changes the strength of an Infantry from 36 to 40 and mod B changes it from 36 to 30, then it'll be either 30 or 40 depending on the order the mods are loaded.
    Now, as I said, you could get some balance headaches. If modder A decided that Academies should get +2 science once you reach Physics, while modder B decided that Academies should get +2 science once you reach Atomic Theory, you'll end up getting BOTH increases.
    It can get more abuseable than that. Modder A decides that he liked the Public School in its original form (+50% science), but that 50 was too much and that it should be decreased to 40. Modder B decides that he likes the current method better (+1 science per population), but that it's too strong and so should be reduced to +1 per 2 population. Combining the two mods, depending on the order involved and the exact syntax used, could leave you with a building that does both, giving +1 per 2 pop AND +40%.

    2> New Lua functions.
    Unless by sheer chance two modders picked exactly the same name for the files/routines, there's no conflict here. This is where a lot of UI mods come in, but it also applies to many other functions; if I add "Terraform.lua" to my mod, then the only way it'd cause a problem is if someone else also added something named Terraform.lua. (That's why all of my Lua files have names like "SpatzWonders.lua".) Now, as with the XML it might screw up balance, but that won't crash anything.
    NOTE: Many early mods implemented new Lua functions through InGame.xml. By its nature this made these mods mutually exclusive, so a lot of incompatibilities with older mods can be traced back to this. It's easy enough to fix, though; I've got a couple of these on my computer, where I took someone else's mod, removed the InGame.xml dependence and rebuilt it.

    3> Old Lua functions and/or art assets.
    This one's a problem. If you edit an existing game asset (anything that needs VFS set), and someone else edits the same, then it's almost guaranteed to break. InGame.xml, above, is one example of this, but the best example is AssignStartingPlots.lua. This function allocates the resources to the map at the start of a game, and so any mod that adds a new resource or changes the rarities of existing resources must, by definition, edit this file. And unlike the database XML, you can't do an "Update" command; you have to replace the whole thing with a new version, although that doesn't mean editing the actual original file itself. (Non-database XML files also work this way.)
    This wouldn't be so bad, except several map scripts (Lakes, Great Plains, and Highlands) ALREADY override some of the routines in that file, so if your mod edits AssignStartingPlots, then the game will break if you try running one of those map scripts. So it's a pretty good indicator of what'd happen if you try to run two mods editing that asset at the same time.
     
  3. alysenne

    alysenne Chieftain

    Joined:
    Nov 10, 2005
    Messages:
    40
    Thanks. This is really great information! Helps me in so many ways.
     

Share This Page