Mod Idea: Paying Interest on Money in Bank

burfmeister31

Chieftain
Joined
May 5, 2011
Messages
20
Location
North Carolina
I have no idea how you would program this or if this is feasible but I wonder if it is possible to create a mod where you gain a certain amount of interest per turn on money saved in the bank. You could make the interest earned go down as you accumulate more money so it does not get out of control and/or you could trigger the start of interest being paid once you research banking. Just an idea, maybe something like this already exists. If it does point me to it because I would like to test it out in a game.
 
This is easy enough to do in Lua; at the start of each turn, check each civ's gold reserves and give them some more based on their current total. It's a trivial change, and you can make it as complex as you want.

But like most other Lua changes, there's a catch: the AI won't understand this. It'll balance its budget the normal way, and not know that it's going to be getting a little something extra at the end of the turn. As a result, this leads to two bad problems:

1> The AI won't know that stockpiling gold is a good thing, but the player will. The AI will continue to spend money as soon as it has enough to do so, on city-state bribes, research agreements, rushed units and buildings, etc. This is a huge competitive advantage for the player.

2> The AI has certain thresholds for behavior, and this change would screw those up. As an example, let's say that whenever an AI is losing 10 gold per turn, it starts shifting its cities into Gold Focus mode or has them build Wealth. In the short term this is okay, but in the long term the lack of production is crippling.
So let's say that, during a game, the AI is running at -15 gold per turn. (If your interest mod is accompanied by an increase in other costs, like building maintenance, then this is easily possible. If not, then your balance is going to be WAY off, because gold is already pretty plentiful and you'll just make it more so.)
In a normal game, that -15 would be enough to trigger the emergency Gold Focus behavior, for good reason. But if that same AI was earning 10 gold each turn in interest, then it'd REALLY only be losing 5gpt and shouldn't go into emergency mode. So you're crippling the AI by causing it to take unprofitable actions when it shouldn't be.

These arguments apply to nearly every Lua mod; the AI just can't handle this sort of direct after-the-fact modification. It'll base its behavior on the game without that mod, and if the change is severe enough this can cripple the AI.
Once we have DLL access then it shouldn't be too hard to alter the AI to accept this.

--------------
Now, there's another method that WOULD allow the AI to know what it's doing, at least in terms of #2. Instead of just granting gold at the end of the turn, you instead create a custom building that gives +1 gold, with the NoLimits flag set in its building class. Set its cost to -1 so that players can't build it, and don't give it a tech prerequisite.
Then, at the end of each turn, just place the appropriate number of copies of this building in each player's capital. Since it'd be giving an actual yield, the AI would treat it the same way as any other +gold building. The NoLimits flag also prevents the building from showing up in the UI, so the only thing to watch out for would be the yield multipliers in the city.

It still wouldn't help #1; the AI will still not see the benefits of saving up, so you'd want to set the cost structure to taper off at a certain point. But it would, at least, prevent the AI from going into emergency +gold mode.

I've used this method in my own mod to create an Empath specialist that generates +1 happiness; at the end of each turn the mod creates an invisible +1 happiness building in the capital, with the number of copies equal to the number of active Empath slots in the empire that turn. While it doesn't update the happiness numbers mid-turn when you change the slot allocation, it does get the total correct at the end of each turn. And unlike your change, I can encourage the AI to take advantage of this through Flavor values. Since there are no "+25% Happiness" buildings, I don't have to worry about that balance issue either.
 
I have zero experience in programming aside from some statistical programming in SAS, MatLab, and Stata. I'm just thinking of ways that Civ 5 could be made more economically realistic.

I've seen the AI store up thousands in gold in several of my games. I once saw Bismark store up to 10,000 in gold before. It is annoying to see the computer save up all that money then spend it all on a diplomatic victory in the end while I'm sitting back shooting for a technology victory. If you had a civilization, player or AI, that was hoarding gold, then that would lead to a tight money supply. Assuming of course the currency is gold which it is in Civ5. Tight money supply would lead to inflation as less money is chasing the same/increasing amount of goods being produced. This could be modeled in Civ5 through increased unit/building maintenance costs.

I'm just batting ideas around.
 
I've seen the AI store up thousands in gold in several of my games. I once saw Bismark store up to 10,000 in gold before.

That's not common, because if the AI CAN spend money on something it thinks it needs, then it will. As long as the AIs remain friendly with each other, they'll buy Research Agreements whenever possible. And if the AI is in a war and needs another unit, he'll generally buy it.

It is annoying to see the computer save up all that money then spend it all on a diplomatic victory in the end while I'm sitting back shooting for a technology victory.

Then that means you lost, and the AI did what it was supposed to. If the AI had enough income to be able to buy a diplomatic win outright, then it meant that he was strong enough economically that he SHOULD win and that you were never in the dominant position anyway. And that means you need to start looking into countermeasures; bribe a few city-states of your own, instead of sinking all of your money into rushed units and buildings. Or conquer a few city-states yourself (since the number of votes needed does NOT go down as city-states are conquered, so take out enough of them and a diplomatic win becomes impossible).

The cultural and diplomatic victories are in the game for a reason. A civ that's a runaway tech leader, or is dominant militarily, needs to pay attention to those other factors instead of just beelining for its own preferred victory at all costs. Just because you're getting close to a science win doesn't mean the AI shouldn't be able to try winning some other way.

Now, if you think a diplo win is just too easy in general, there are other ways to mod that: reducing the effects of bribes, increasing the number of votes needed, increasing the frequency at which city-states offer "quests", and so on. But don't blame the AI for doing exactly what a player would do if he were going for a diplo win.

Tight money supply would lead to inflation as less money is chasing the same/increasing amount of goods being produced.

Only if you assume that the gold we're talking about here represents the entirety of an economy. It doesn't. The gold you're generating really represents the amount of money the government has to spend on whatever additional projects it thinks it needs. As the U.S. has shown for decades (until the last couple of years), it's easily possible to have a strong economy while the government has a massive deficit, as long as the citizens continue to gain and spend money. A negative income doesn't mean a shortage of money throughout your empire, it just means your government is spending more on infrastructure than it gains in taxes; as long as there's another nation willing to loan money to cover the deficit, everything's fine.

---------

Bottom line, I've told you the mechanical problems with adding this into the game in a way that the AI would be able to handle. So no matter how much you like the idea, it just won't work, because it'd give a human player (who knows about the system) a huge advantage over the AI. When we get the DLL that'll change, but until then...
 
Back
Top Bottom