Merging MODS: MOD as patch or install file
Here I see many creative modders publishes really good mods. I admire and thanks very much to these mod creators.
Problem is, it is very cumbersome or impossible to combine multiple mods easily into one and use them in-game at once.
You can use or apply two or more mods same time only if they don't modify same game file.
If not, you should merge the changes manually and it is quite labor intensive, error-prone, and quite intimidating to non-techie type.
It may require quite a knowledge on XML or Python programming language.
Don't even think of "un-installing" mods combined by hand.
This reduces usefulness of each mods and I think it is a design flaw made by Firaxis. The "unit of change" is per file based.. Too big chuck to avoid clash.
Firaxis said Civ 4 is very modable game, but I don't think so.
In Civ 4, nearly all mod change should replace whole file or multiple files.
It is very clash-prone. File as unit of change is too big unit to avoid clash.
They should have choose 'single XML entry' as unit of change , not whole file.
Civ 4 is *NOT* designed to handle multiple mods or un-installation gracefully.
In more modable game like The Sims 2 / SimCity 4 from Maxis, every aspect of game is stored in database-like file.
Custom mod file is just a single file which consists of same basic records which is very small and easy to replace original record and un-install.
Each record is few list of values or texts or short code snipet - similar to single database record.
So it is very easy to cascade or combine the The Sims 2 / SimCity 4 multiple mods or user created content without clash unless they modifies same databse record. No need to merge mod files physically. Adding new records never causes any clash.
But we can not stand here complaining their faults and let this quagmire to last forever.
We need a standard or recommandation on mod wrting to mitigate this sorry situation.
My suggestion on this problem is as follows:
1. Every MOD should be distributed as standard UNIX context diff file which is generated from utility like GNU diff and patch.
This will solve most of XML file clash unless it modifies same or very adjacent XML entry.
Adding new entry at near end of XML file (before closing XML tag) should be quite safe from clash.
2. Text translation XML file in 'Assets\xml\text' folder can be standalone file. Modder can add NEW file to this folder. So if every modder agrees to use same text file for adding text translation, it will not need to touch or change existing game file.
3. Harder part is merging Python file. Python is white-space sensitive language.
So blindly merging source text may not work. So, to help the merging process, the changed part of Python code should be marked clearly in Python source file itself.
Every original code line should be preserved and commented out with special comment mark. For example : "#!", "#<", "#>" instead of plain "#" in beginning of original source line or muti-line string (""") as comment.
Newly added line should be also marked with special comment line like " #----- BEGIN -----, # -----END -----".
On later day, someone can write more Civ4/Python specialized diff/patch utility to help and automate merging process of Civ 4 Python file. More detailed scheme for marking change will posted later.
4. We need new Civ4 specialized merge utility program to aid players to merge mods.
And mod creator should also help utility program to identify their change and let their mod to be merged smoothly by complying the recommendation. Incompatible/clashing diff change will be reported and marked in output file clearly for manual editing later.
automatic diff utility for mod author will be needed which generates diff file that comply the recomamndation.
Yes, Not ervery modder will comply this recommandation.
But decent modder will follow the guideline and then his/her mods will have much higer chance to work successfully when combined with other compliant mods.
5. Applying the diff file using GNU patch program may be difficult or cumbersome to quite large part of non-techie Civ 4 players.
So we may need more user friendly "Installer" type distribution. It will contain the 'patch.exe' and diff's and resources.
It will automate the diff/patch process. Modder can use free Installer maker utilit.
"NIS Installer" from NullSoft ( the winamp maker, http://nsis.sourceforge.net/Main_Page ) to create mod Installer come to my mind.
Someone should write sample Installer script for most of Modder who is not familiar with NSIS Installer script writing.
6. Merged Mods file may written to new folder under MODS or CustomAssets folder.
I would prefer new folder under MODS folder. It is easier to test and use selectively different combinations of mods.
7. Spcial information file ( like cover sheet page or *.NFO or *.DIS file ) needed. It will identifies the MOD, author and contact, version number, date, inter-operablity with Civ4 version or other mod, related URL , or distribution pointer or site.. etc and etc..
Any sugesstion?
.
Here I see many creative modders publishes really good mods. I admire and thanks very much to these mod creators.
Problem is, it is very cumbersome or impossible to combine multiple mods easily into one and use them in-game at once.
You can use or apply two or more mods same time only if they don't modify same game file.
If not, you should merge the changes manually and it is quite labor intensive, error-prone, and quite intimidating to non-techie type.
It may require quite a knowledge on XML or Python programming language.
Don't even think of "un-installing" mods combined by hand.
This reduces usefulness of each mods and I think it is a design flaw made by Firaxis. The "unit of change" is per file based.. Too big chuck to avoid clash.
Firaxis said Civ 4 is very modable game, but I don't think so.
In Civ 4, nearly all mod change should replace whole file or multiple files.
It is very clash-prone. File as unit of change is too big unit to avoid clash.
They should have choose 'single XML entry' as unit of change , not whole file.
Civ 4 is *NOT* designed to handle multiple mods or un-installation gracefully.
In more modable game like The Sims 2 / SimCity 4 from Maxis, every aspect of game is stored in database-like file.
Custom mod file is just a single file which consists of same basic records which is very small and easy to replace original record and un-install.
Each record is few list of values or texts or short code snipet - similar to single database record.
So it is very easy to cascade or combine the The Sims 2 / SimCity 4 multiple mods or user created content without clash unless they modifies same databse record. No need to merge mod files physically. Adding new records never causes any clash.
But we can not stand here complaining their faults and let this quagmire to last forever.
We need a standard or recommandation on mod wrting to mitigate this sorry situation.
My suggestion on this problem is as follows:
1. Every MOD should be distributed as standard UNIX context diff file which is generated from utility like GNU diff and patch.
This will solve most of XML file clash unless it modifies same or very adjacent XML entry.
Adding new entry at near end of XML file (before closing XML tag) should be quite safe from clash.
2. Text translation XML file in 'Assets\xml\text' folder can be standalone file. Modder can add NEW file to this folder. So if every modder agrees to use same text file for adding text translation, it will not need to touch or change existing game file.
3. Harder part is merging Python file. Python is white-space sensitive language.
So blindly merging source text may not work. So, to help the merging process, the changed part of Python code should be marked clearly in Python source file itself.
Every original code line should be preserved and commented out with special comment mark. For example : "#!", "#<", "#>" instead of plain "#" in beginning of original source line or muti-line string (""") as comment.
Newly added line should be also marked with special comment line like " #----- BEGIN -----, # -----END -----".
On later day, someone can write more Civ4/Python specialized diff/patch utility to help and automate merging process of Civ 4 Python file. More detailed scheme for marking change will posted later.
4. We need new Civ4 specialized merge utility program to aid players to merge mods.
And mod creator should also help utility program to identify their change and let their mod to be merged smoothly by complying the recommendation. Incompatible/clashing diff change will be reported and marked in output file clearly for manual editing later.
automatic diff utility for mod author will be needed which generates diff file that comply the recomamndation.
Yes, Not ervery modder will comply this recommandation.
But decent modder will follow the guideline and then his/her mods will have much higer chance to work successfully when combined with other compliant mods.
5. Applying the diff file using GNU patch program may be difficult or cumbersome to quite large part of non-techie Civ 4 players.
So we may need more user friendly "Installer" type distribution. It will contain the 'patch.exe' and diff's and resources.
It will automate the diff/patch process. Modder can use free Installer maker utilit.
"NIS Installer" from NullSoft ( the winamp maker, http://nsis.sourceforge.net/Main_Page ) to create mod Installer come to my mind.
Someone should write sample Installer script for most of Modder who is not familiar with NSIS Installer script writing.
6. Merged Mods file may written to new folder under MODS or CustomAssets folder.
I would prefer new folder under MODS folder. It is easier to test and use selectively different combinations of mods.
7. Spcial information file ( like cover sheet page or *.NFO or *.DIS file ) needed. It will identifies the MOD, author and contact, version number, date, inter-operablity with Civ4 version or other mod, related URL , or distribution pointer or site.. etc and etc..
Any sugesstion?
.