Mod switcher

You know, this is increasingly looking like the sort of stuff CVS (Concurrent Versioning System) and other code repositories do. They have a feature which enables multiple persons to make changes to the same piece of code and update the code intelligently. In case of conflicts they can ask from the user what to do with particular line(s) of code. So, it is possible to make a program which can do the same thing to mods. Of course, some mods are innately incompatible and cannot be combined because they might, for example, change the rules of the game in different ways.

Cheers,
Uluk
 
Uluk said:
You know, this is increasingly looking like the sort of stuff CVS (Concurrent Versioning System) and other code repositories do. They have a feature which enables multiple persons to make changes to the same piece of code and update the code intelligently. In case of conflicts they can ask from the user what to do with particular line(s) of code. So, it is possible to make a program which can do the same thing to mods. Of course, some mods are innately incompatible and cannot be combined because they might, for example, change the rules of the game in different ways.

Pretty much yes. I've actually replicated some of the behavior of GNU diff and patch in my program to handle python files.

alms66 said:
There are dozens of free document merge programs available via the web, why write a new one?

Because this one has a user interface and other features specifically designed for Civ4 mods.

Take a look at what the GNU diff utility thinks of the CIV4LeaderHeadInfos.xml from FinMod (in the attached file). Looks rather sub-optimal, no? What do you think would happen if some other mod first added a leaderhead between Kublai Khan and Louis XIV and you then tried to apply that patch?

My program solves this problem by looking at the XML structure of the file. It treats the elements ar leaderhead definitions and not just some piece of text. When it sees Kekkonen in FinMod's file, it looks at the original file and notices it's missing. Thus, it stores the definition in the mod file. When it next sees Kublai Khan, it can find it from the original and notices they're exactly the same definition. Thus, there's no point in storing that.

You know, I'm getting so much negative responses here that I'm wondering if you actually want this program. I can just keep it to myself and let you merge your mods by hand or whatever diffing utility you like. I can take critique constructively, if there's actually something to construct with.
 

Attachments

tdb said:
You know, I'm getting so much negative responses here that I'm wondering if you actually want this program. I can just keep it to myself and let you merge your mods by hand or whatever diffing utility you like. I can take critique constructively, if there's actually something to construct with.

Hint: Being thick-skinned is a definite plus when dealing with people on the internet. ;)
Some will appreciate your work and some won't, no matter what ... that's just the way it is.
 
I know... I've had this kind of "why reinvent the wheel" comments countless times before. As for the why, I like coding. It's a magnificent feeling when you finally see your project working.

BTW, I just got the program successfully compiled on Windows. Now I just need to kill some bugs before I release it.
 
First version released (download link in the first post)

Please report any problems and suggestions to this thread.

Maybe this should be moved to the "Utility programs" section now? Or should I create a new thread there?
 
tdb said:
You know, I'm getting so much negative responses here that I'm wondering if you actually want this program. I can just keep it to myself and let you merge your mods by hand or whatever diffing utility you like. I can take critique constructively, if there's actually something to construct with.

Now don't get me wrong tdb. If done properly, this could be great. That CVS thing just hit my mind because of a recent lecture at the uni I attended. And reinventing the wheel isn't necessarily that bad, it's a learning experience! In fact, I believe that a large amount of work people do includes some form of reinventing. Nobody's going to pull new stuff simply out of their hats, it has to be based on something.

Nevertheless, if you are going to make a program which practically every civ player can use, a simple document merging program is not going be enough. It has to have some civ specific functionality as well. Keep up the good work, tdb.

Cheers,
Uluk
 
I'm going to integrate some kind of mod editor with this. I'm not yet sure how complex. At first it will probably be a simple text editor, but in the future I might create a point-and-click interface with icons and everything.

If you have any ideas about what features this program should have, just tell me and I'll see what I can do.
 
I have no idea about the computer lingo you guys are using yet I knew the importance of it to read the whole post. :D Must be doing something right then. :lol:
I kind of follow what you are trying to do and making it more Civ specific (compared to other generic mergers) is wonderful. Seems like that idea is warranted considering all the people this series/game positively affects.
Next, the simple idea you had of a.)showing which lines of code conflict and b.) giving the user the option to choose, would be a fundamental place to start, IMH(Ignorant)O. After that, the next logical (but difficult) step could be prompts explaining to the non-'coders' what those conflicts were.

If you could do those three,...
1. Multiple Mod Merging (MMM... good)
2. Conflict prompts using 'coder' language
3. Lamen conflict-explanations
... what more could a Civer ask for? :goodjob:
 
People seem to bring up the topic of combining mods regularly, so would someone please make this sticky and/or move it to the Utility Programs forum?

There's a new version coming out today that will fi most of the problems mentioned in the first post.
 
I'll try to post a new thread in which we can keep track of good and bad combo's of mods. I was searching for something like this myself when i stumbled upon your prog (making me very happy and anxious to see the new version)

I will post a link towards this thread to introduce more people to your work.

Keep it up:goodjob:
 
Here it is - the new and shiny civ4modder 0.2! The most important new feature is undoubtedly the conflict checker. Other improvements include on-demand loading of the mod files for faster startup and the ability to select teh mods you want with the checkboxes in the list.

Download link has been updated in the first post.

Ad Hominem said:
Aye, this is of great importance! This is the tool we need... if only you can make it work right *crosses fingers*
Rest assured, with the help of you people I can make it work right. If you come up with some feature you'd like to have, there's a 99% chance that I can code it.
 
This is an absolutely superb idea. I've been looking for something like this so I can combine my different mods and easily add a few features that others have developed. No, I don;t have anything useful to say -- I just wanted to encourage further development :)
 
I'm not familiar with what a run-time environment is. And since others may agree, can you tell a little about what it is, why we need it, and a little more explanation on how to configure it?
Thanks for your modding contribution. I'm sure it will be a big hit!
 
twelvetime said:
I'm not familiar with what a run-time environment is. And since others may agree, can you tell a little about what it is, why we need it, and a little more explanation on how to configure it?
Thanks for your modding contribution. I'm sure it will be a big hit!

Basically, it's a collection of libraries to provide some user interface stuff the program needs. It's a lot easier to use (programming-wise) than WinAPI, and also is portable. Since I'm doing the actual development on Linux, a portable UI library is a must.

I've added detailed instructions for installing gtkmm to the first post.
 
Ok, i'm still applying the civ4modder, found the first bug, being human error...:rolleyes::blush: No serious consequences though.

I tried combining two mods and place the newly created modfile into the mods-map in the game's installation directory. I Started the game, went to load the new mod and found an XML mod and an art mod and I thought DOO how could i be so stupid. So now i treid the same thing over again but created the new mod-file in a new folder within the mods-folder. I thought this would be it and tried to load the mod. Loading the mod went ok, but when i tried to find the new civ (the netherlands was on of the two initial mods) i couldn't find them. So obviously something had went wrong.

When i wanted to redo the whole thing, i couldn't find the original mods... because civ4modder had somehow cleaned out the entire modsfolder.
So now i'm reinstalling the mods.

STILL not working for me!
I'm trying to combine the most recent versions of lost unit mod(by Frontbrecher) and the Netherlands(by Tremo). The Civ4modder creates a new modfolder (which i named Multiple) in the modfolder in the installation dir. In which i can see the new (two) leaderhead folders etc, and the new units (14 in total of which one is UU for netherlands) It looks to be ok, uploading the mod into the game also seems to go just fine. But when i try to find the new civ, it isn't available.

Could some one tell me what went wrong?
 
Okay, the civ4modder's CustomAssets directory definitely nees some more documentation.

The program uses that directory as the combination mod's assets directory. You'll generally want to use one of these choices (adapted to your setup):
C:\Documents and Settings\Username\My Documents\My Games\Civilization 4\CustomAssets
C:\Program Files\Firaxis Games\Sid Meiers Civilization 4\Mods\MyCombinationMod\Assets

Your second attempt didn't work because the game looks for an Assets folder in the mod folder.

Also, when applying the mods, the program deletes the entire destination directory to ensure you'll only get those mods you have selected. So that's why your Mods folder disappeared.
 
Back
Top Bottom