Quick modding questions

MisterBarca

Prince
Joined
May 22, 2006
Messages
536
Hi, three quick questions:

1. How do I mod out Research Agreements? (It almost seems like a gimmick that only benefits the AI players, since the AI players keep cancelling with me.)

2. How do I mod out certain units that I do not want like the Giant Death Robot, Nuclear Missile, and Atomic Bomb?

3. How do I apply Promotions to new units that previously could not obtain it?

Thanks in advance.
 

magzhi

Warlord
Joined
May 23, 2010
Messages
197
Read this tutorial: Modders Guide
It is easy to understand and it will help you with modding :)
Then when you will have problem with a code just post it here and we will check it :)
 

SamBC

Emperor
Joined
Feb 2, 2010
Messages
1,052
Location
Lancaster
Just don't forget that some of the things have changed since then - graphics and some XML and Lua files now need a VFS flag setting, and there are new required fields in some tables.
 

MisterBarca

Prince
Joined
May 22, 2006
Messages
536
Read this tutorial: Modders Guide
It is easy to understand and it will help you with modding :)
Then when you will have problem with a code just post it here and we will check it :)

I just finished it, but it's very complicated for what I want to do--which is not create a mode out of scratch, but change a few simple values ;)

Also, there's nothing about Research Agreements in there. Actually, it may be better if I simply increase the cost a lot. Which XML document contains Research Agreement parameters anyways?
 

Spatzimaus

Mad Scientist
Joined
Sep 21, 2005
Messages
3,063
Location
Los Angeles, CA
which is not create a mode out of scratch, but change a few simple values

That's what a mod IS. XML modding does not require huge changes, it's mainly about small updates to the existing database. This is why we point people to Kael's guide; your first instinct, to say that it doesn't really apply to X, is just wrong. It's all just a matter of scale, but the mechanics are the same.

Which XML document contains Research Agreement parameters anyways?

GameInfo/CIV5Eras.xml sets the costs, which depend on the current Era. In my own mod, for instance, I've basically doubled the cost of RAs across the board.


See, the problem with RAs isn't that they're overpowered. It's that the AI has no concept of savings. Let's take some hypothetical numbers for an arbitrary point in the game:
An RA costs 400 gold.
A unit costs 600 gold.
Bribing a city-state costs 500 gold.

So a hypothetical AI has 350 gold, and gains 25 gold per turn. On this turn, he can't afford anything, and next turn (375) he still won't have enough. But then he'll have four turns in a row where his only choices are an RA or nothing. The AI is probabilistic, so it might set the RA likelihood low enough that it'll reach the more expensive things fairly often, but what if it doesn't? The AI doesn't know that four turns of not buying an RA will unlock better options, because he can't plan that way.
End result: lots of RAs, few rushed units or city-state bribes. These AIs are tech threats, but no real threat in the long term.

Now, double the cost of the RA so that it's more expensive than rushing a unit in the same era. Now the problem's inverted; if the AI thinks he might want a unit then he'll rush it, and if he wants a resource he'll bribe a city-state, but he'll buy RAs far less often, only buying them when he thinks he doesn't need more units or more allies. This creates a far more dangerous environment for you the player, because the AIs won't skimp on resources or units just to get techs faster, and once they DO have a strong military they'll then buy plenty of RAs.
 

MisterBarca

Prince
Joined
May 22, 2006
Messages
536
That's what a mod IS. XML modding does not require huge changes, it's mainly about small updates to the existing database. This is why we point people to Kael's guide; your first instinct, to say that it doesn't really apply to X, is just wrong. It's all just a matter of scale, but the mechanics are the same.



GameInfo/CIV5Eras.xml sets the costs, which depend on the current Era. In my own mod, for instance, I've basically doubled the cost of RAs across the board.


See, the problem with RAs isn't that they're overpowered. It's that the AI has no concept of savings. Let's take some hypothetical numbers for an arbitrary point in the game:
An RA costs 400 gold.
A unit costs 600 gold.
Bribing a city-state costs 500 gold.

So a hypothetical AI has 350 gold, and gains 25 gold per turn. On this turn, he can't afford anything, and next turn (375) he still won't have enough. But then he'll have four turns in a row where his only choices are an RA or nothing. The AI is probabilistic, so it might set the RA likelihood low enough that it'll reach the more expensive things fairly often, but what if it doesn't? The AI doesn't know that four turns of not buying an RA will unlock better options, because he can't plan that way.
End result: lots of RAs, few rushed units or city-state bribes. These AIs are tech threats, but no real threat in the long term.

Now, double the cost of the RA so that it's more expensive than rushing a unit in the same era. Now the problem's inverted; if the AI thinks he might want a unit then he'll rush it, and if he wants a resource he'll bribe a city-state, but he'll buy RAs far less often, only buying them when he thinks he doesn't need more units or more allies. This creates a far more dangerous environment for you the player, because the AIs won't skimp on resources or units just to get techs faster, and once they DO have a strong military they'll then buy plenty of RAs.

Thanks!

Also, your explanation of the AI thinking process is useful. I thought Research Agreement would only disadvantage human players because of the random cancellations; but I guess it hurts the AI as well, if the AI prefers the "instant gratification" route ;)

I will quadruple the Research Agreement costs (this sounds extreme, but I am also going to mod the game so that there is more money available by dramatically curtailing building maintenance costs and increasing various building/Improvement yields) and probably make the Research Agreements take longer to complete as well (though I am not sure if this affects AI thinking process as well).
 

Spatzimaus

Mad Scientist
Joined
Sep 21, 2005
Messages
3,063
Location
Los Angeles, CA
(though I am not sure if this affects AI thinking process as well).

It probably doesn't. A longer timer most likely means more broken RAs, nothing more. There doesn't seem to be any sort of ongoing friendship during the 30 turns it takes to kick in.

If you're going to scale yields up that way, you'll run into a lot of other balance issues. Settler costs, settler site selection, building costs, unit costs, the semi-exponential city growth formula, the semi-exponential culture formula for policies, and so on. Note the "exponential" part; for many things, you can't just double all of the numbers and have it play the same way.

You'll also have some problems with the AI. If the AI thinks that a luxury resource is worth 300 gold and you then go and double all of the gold inputs, how does the AI understand that 600 is now a fair price? There are ways to adjust this, but there are many similar bits of logic that aren't straightforward to adjust in this way. It's not going to be a small amount of work.
 

MisterBarca

Prince
Joined
May 22, 2006
Messages
536
It probably doesn't. A longer timer most likely means more broken RAs, nothing more. There doesn't seem to be any sort of ongoing friendship during the 30 turns it takes to kick in.

If you're going to scale yields up that way, you'll run into a lot of other balance issues. Settler costs, settler site selection, building costs, unit costs, the semi-exponential city growth formula, the semi-exponential culture formula for policies, and so on. Note the "exponential" part; for many things, you can't just double all of the numbers and have it play the same way.

You'll also have some problems with the AI. If the AI thinks that a luxury resource is worth 300 gold and you then go and double all of the gold inputs, how does the AI understand that 600 is now a fair price? There are ways to adjust this, but there are many similar bits of logic that aren't straightforward to adjust in this way. It's not going to be a small amount of work.

Hmmm, ok. I will skip increasing the yield then.

My main objective as a long-time Civilization player is essentially to have more units (since I enjoy warmongering) and slow down research so units have longer staying power, rather than become obsolete in the blink of an eye. So I thought I could do this simply by 1) flooding the game with gold and production; and 2) at the same time making research far more costly. But I guess not! ;)

Now I am inclined to just reduce unit training costs a bit and increase research costs a bit--rather than going for a major balance over-haul.
 

Spatzimaus

Mad Scientist
Joined
Sep 21, 2005
Messages
3,063
Location
Los Angeles, CA
My main objective as a long-time Civilization player is essentially to have more units (since I enjoy warmongering) and slow down research so units have longer staying power, rather than become obsolete in the blink of an eye.

There are a lot of ways you can do this. For instance in my own mod:
1> The University only adds 30% Science instead of 50, as does the Public School (but with the +3 kept and instead of the 1 science per pop). The Research Lab adds 50% instead of 100%. Libraries are +1 per 3 population instead of per 2.
2> Cities have higher unhappiness (4 + 1.2/pop instead of 3+1), which slows down the rampant expansion significantly. Fewer cities mean less science (and fewer strategic resources), and more development in a city needed to break even on happiness means less spare gold to buy RAs.
3> The amount of food needed for a city to grow a size has been changed, generally upward, so that cities won't get as large as quickly.
4> By tweaking the yields, it's generally better to use a Great Scientist to found an Academy instead of always grabbing a free tech.

And so on. Combined with the doubled RA costs, it does a lot of what you're thinking. I'm not saying that you should copy my mods, but the point is that there are many things you can do to shift the balance, without needing the sort of massive overhaul you'd originally thought of.
 
Top Bottom