Suggestion: Modular leader changes (swap-able files)

Tomice

Passionate Smart-Ass
Joined
Oct 5, 2009
Messages
2,353
Location
Austria, EU, no kangaroos ;)
I was just browsing through EricB's new Communitas modmod's files, and I found something very interesting.

He put all the changes for each leader/civ in a single file, making sure that you could just delete the file if you wanted to keep the original version.

Actually, it would be cool if this would be implemented for the base version, too!



Leaders/civ changes are unique in that they are balanced seperately from other gameplay elements. We have a baseline - all the general values (e.g. how much yield from a farm, how many movement points for ships, a base set of units,...). Each civ could actually be seen as a modmod of this basic gameplay, changing a bit of this baseline to alter the gaming expirience.




So, if we have all changes for a civ in a single file, it would be very easy to provide two versions of Rome for example. We have discussed over and over if this specific civ should have a naval UU or some kind of UB. Why not make it modular?

Sure, this would be some work, but it seems like this wouldn't involve much more than some copy-paste to distribute the changes over multiple files. I have no real programming skills, so I can only estimate, but it seems like not too much work compared to the huge possibilities.

We could even have a subforum for alternative civ modmods - surely a much better way to balance them compared to the endless discussions in the various leader threads. If a leader modmod is more popular than the "official" version, the modmod could become the new official version shipped with the one-click download of Communitas (a.k.a. Steam version)
 
I set it up that way for a couple of reasons.

One is that it's easier to find the specific code implementing something. It's easier for me and easier for others too. I'm also a programmer who makes stuff in C++ with object-oriented design, so it's just the way I do stuff in C++. You make a small piece of code that is modular.

A second reason is that it's easier to test and find the bugs. If I have a syntax error somewhere in the file, then the system throws the whole file out implementing nothing in there. It's frustrating when you spend a lot of time on something such as re-designing a policy tree, then test it and nothing works at all. You dig through this huge file to find what's wrong and it's something very simple usually. For example, I re-did almost the entire Wealth and Knowledge trees. I put each policy in a separate file so that I could test them separately. When testing it, if the text isn't appearing correctly for a policy, then I know that there's a syntax error somewhere in that specific file. I don't have to dig through the weeds of endless working code, but I can find the error quicker.

I didn't even think that it would make it so people could quickly just delete an effect that they didn't like. For example, I thought that the Fine Arts policy in Aesthetics was too weak. It gave +1 culture for every 2 extra happiness. Most of the time if I'm a peaceful, cultural civ I'm going to have around +30 happiness and maybe raking in 150-200 culture around the same time. That nets you 15 culture, which is a less than 10% increase in culture. Especially since culture doesn't give you anything except more future policies, this is pretty weak. So I bumped it up to +1 culture per +1 happiness (doubling it). Since it's in it's own separate file, it's really easy to revert back to the core CEP settings if you want to by just commenting out the file or deleting it.

Some things couldn't be simply changed by deleting them. I did try to make it easy for you to find a particular effect you're looking for by commenting a lot so that you can easily change it. Also easier for me to find it that way. I change my own mod frequently so it's easier to keep track of things if I document them.
 
It doesn't matter how we organize the data in these files. If someone creates a mod-mod for a specific leader, it will override the CEP version, regardless of how we store the data. It's easy to delete a leader's changes too - just open a file and delete the data.

If someone wants to reorganize the leader files, you're welcome to do so. I estimate it would take about an hour of work.
 
Well, if it doesn't help any serious modder, then it's probably pointless. I just found it very straightforward as layman - don't like a leader, just delete a file ;)

But right, a modmod would work just as well and is the more professional solution.
 
If you are feeling like something to do, when we first laid out the leader files we did so in alphabetical order of civilizations. However, as you well know, when you choose a leader it is by alphabetical order of their names.

Thal and I toyed with the idea of re-arranging them to give some sort of ease of use but decided against it for no particular reason.

It still taps away at the back of mind sometimes that we should have made that change, maybe someone could do that and see if it aids selection or does anything of use?

Or not.

Just mentioned it to highlight the point; there is no 'best' way to structure mods, just different.
 
The problem is: My capabilities regarding modding are extremely limited. I can do as much as change the percentage of plains tiles in the Communitas map script, but that's only because the code is so well-commented.

Me reorganizing the Communitas code is like letting a kindergarten child rearrange mom's collection of expensive wine and champagne glasses - somethings gonna break :lol:

Forget it, I shouldn't have told you guys how to do your work. I was just fascinated how layman-friendly EricB's arrangement looked like. You sure had your good reasons to do stuff like you did. And as Thal said, the advantage I imagined to be there actually isn't.
 
@Tomice
Don't take my posting as a criticism of your idea. I never want to stifle thinking outside the box.

I also think you are greatly under-estimating your own abilities. Believe me you don't need a degree in Computer Science, which BTW I think a large percentage of the team do possess (not me though), to be able to edit these files.

Have a go, you may just spark an ability you never knew you had.
 
Thx for the encouragement ;-) I'll take this as an motivation to finally check how to do a proper modmod (and not just alter the files directly like I did before quite often). I'll post it if I come up with something useful.

I still don't think I'll try any 'improvement' of the main communitas code anytime soon! :D
 
It's not actually that hard to make your own mod. Setting it up is fairly easy. I found a short video on youtube to get me started. To make a mod of a mod make sure you have set up the Communitas mod as a dependency and a reference mod. Getting it set up is pretty easy. Getting it to actually make a change can be more difficult (or also easy) depending on what you want to accomplish.

The first thing to understand is how the core game files are laid out. Which effects are in which tables. Understand how the vanilla game works. Then, it comes to figuring out what the CEP code does to modify the vanilla code. Then, you can add your stuff on top of that. Start with one small thing and build from there.
 
Top Bottom