Trip said:
Hey guys.
One of the things we're hoping to do with the next Civ 4 expansion pack is ease the merging of different mods together. One way of doing that would be to split some of the stuff (probably from CvEventManager and CvGameUtils) into different files so that mods won't conflict so often.
But to be honest, we're not the mod-making experts, you guys are.
What structural changes to the Python system would make merging mods easier for you guys?
1. Ideally modular xml files would be a godsend. The dream of being able to have Civ4UnitInfos1.XML, Civ4UnitInfos2.XML, Civ4UnitInfosPirateShip.XML, etc etc would be amazing.
Mostly because it would allow component makers to package their unit/tech/building/whatever as a stand alone product for non-mod makers. A player could go out and download the unit he likes (lets say ninja UU for Japan) that comes complete with an addon Civ4UnitInfosNinja.xml, Civ4UnitclassInfosninja.xml, Civ4ArtDefinesninja.xml and a text file and be off and running. Even better he could download a stack of different units from different players and be able to pick and choose which ones he wanted to use easily.
2. The most important python function should call out to seperate functions. combatResult, onUnitMove, onBeginPlayerTurn, onUnitCreated, onUnitPromoted, onImprovementBuilt from CvEventManager and cannotResearch, cannotDoCivic, cannotTrain, cannotConstruct and cannotCreate from CvGameInterface. Ideally all of the function would call out seperatly.
In a dream world we would be able to put multiple copies of CvEventManager and the game would merge the function for each. So we could have a mod that adds xml files as in point 1 and includes a python file that modifies the onUnitMove function (for example). That function wouldn't replace, but owuld be an additiive to the base onUnitMove and other mods onUnitMove functions.
3. Tying these all together should be a tag that identifies the various files/changes that are from one component. In the game menu it should be possible to add or remove components without having to change files. Such that a player could go in and see a checkbox with "Ninja" by it that he can select to use or not use. Deselecting that option would remove all xml and python changes that component applied.
4. I suspect that this would all be easier if their were differing Assets directories for each component. So you would have 'Assets' for the normal replacement stuff and 'Assets.ninja' for that component, etc. Of course you guys are better at the details of implementation.
5. Yeah I know prereqs are going to be a problem. I dont think there is any way around that and conflicts in any system where you try to allow modularity. But if people are clear as to the required base (Civ4, Warlords, Sevomod, Fall form Heaven, etc) they should be able to add and remove optional components easily with a system similar to this.