[MODCOMP] Ellestar's REF mod

Ellestar

Prince
Joined
Oct 30, 2005
Messages
477
Location
Russian Federation, Moscow
NEW Royal Expeditionary Force + Tax Limit v1.04 - REF shouldn't be as crazy as before if you make a lot of bells. Tax shouldn't grow too fast even if you trade a lot.
http://forums.civfanatics.com/downloads.php?do=file&id=10805
Royal Expeditionary Force v1.02 - REF shouldn't be as crazy as before if you make a lot of bells.
http://forums.civfanatics.com/downloads.php?do=file&id=10787

Royal Expeditionary Force grows according to a number of rebel colonists. Cannons also increase REF if you'll have more cannons than 15% of a total number of colonists. REF starts from about 20 units and grows from that. So, you may generate as many bells as you want, it will not increase REF to insane amounts.
Right now it's set to +1 REF unit per 1 rebel colonist on Explorer difficulty, one half of that on Pilgrim difficulty and 2 REF per rebel on Revolutionary difficulty. If you like it hot, there are "*2" difficulties where REF grows twice as fast.
King doesn't like when you decline his requests so you better give him what he wants. King also doesn't like when you declare a war on other european colonies.
You can load REF v1.00 saves
You can apply it to an unmodded saves as well, but that will require replacement of Assets\CvGameCoreDLL.dll with a modded version (don't forget a backup), XML files should be placed in _Civ4CustomAssets folder.

v1.01 new features:
King doesn't like when you don't submit to his demands and when you start wars with other colonies.
New difficulty levels with double REF increase speed.
"Free" cannons that don't trigger REF increase are tied to a total population, not to the number of rebels.
v1.02 fixes:
Rebel sentiment is limited by population once again - small cities with 3 Elder Statesman will not generate more REF than they should (i should have thought about it when i made a change in v1.01 :/)
v1.04 optional tax mod:
Tax will not grow too fast even if you have a big trade empire and you trade a lot (tax grows slower and it's limited by a game turn, patch can be applied to existing games - it will reduce current tax rate if it's too big). Optional patch, game should be fine without it. Decide if you want 1.04 REF+Tax or just 1.02 REF.

Detailed:
REVOLUTION_EUROPE_UNIT_THRESHOLD in GlobalDefines.xml changes the global REF increase speed (lower value - bigger REF). Default value is 100.

iAIKingUnitThresholdPercent in CIV4HandicapInfo.xml changes REF size according to difficulty (lower value - bigger REF as well).

When you decline a king's request for gold or a tax increase, you'll get 1% REF increase (retroactive). If you give him the money he asks (but not a tax), REF will be 1% smaller (units will not be removed from REF, but game will count it later). 15% maximum. You may change it in GlobalDefines.xml - REVOLUTION_EUROPE_TAX_PERCENT and REVOLUTION_EUROPE_MAX_TAX_PERCENT Note that total difference is twice as much, as the value may be either positive or negative: 15%-(-15%) = 30%

REVOLUTION_EUROPE_FREE_CANNONS_PERCENT in GlobalDefines.xml sets percent of free cannons relative to a total population.

When you declare a war to other european colonies, REF is increased by REVOLUTION_EUROPE_WAR_WITH_COLONY percent (in GlobalDefines.xml), right now it's set to 15%. It's counted once per team per game (so you may make peace then declare a war again without additional penalty).
When you declare a war to a native leader, nothing happens by default but you may change it - REVOLUTION_EUROPE_WAR_WITH_NATIVES in GlobalDefines.xml
 
Is the code included?

EDIT:
BTW, why the nightmare download procedure? Just add it to CFC's download database. So much easier.
 
How does this work with soldiers (rebel colonists don't include soldiers)? If you take a bunch of people out of being colonists and make them soldiers, does the REF stay the same size or does it shrink? Also, how does it work in terms of timing - if you suddenly go up a lot in rebel colonist count, how does the REF increase, suddenly or over time?
 
Is the code included?
I added it in the newest upload. It looks bad but it seems to be working :lol:

EDIT:
BTW, why the nightmare download procedure? Just add it to CFC's download database. So much easier.
Good idea :)

How does this work with soldiers (rebel colonists don't include soldiers)? If you take a bunch of people out of being colonists and make them soldiers, does the REF stay the same size or does it shrink? Also, how does it work in terms of timing - if you suddenly go up a lot in rebel colonist count, how does the REF increase, suddenly or over time?
It doesn't include soldiers directly, but you can't declare a revolution with less than 50% rebel sentiment so you can't have too many soldiers compared to colonists.

REF never shrinks. The only exception is when you load an unmodded save, mod will make a one-time reset of REF to a modded value.

REF increases suddenly.
 
Suddenly as in, all the way to the desired amount in one turn? I'm basically concerned that this will be exploitable by shuffling your soldiers around to keep a low REF level (while producing bells normally), and then suddenly increasing your SoL level...
 
Glad to see this one
Finally i wouldn't be overrun with my "beloved" king anymore
 
Suddenly as in, all the way to the desired amount in one turn? I'm basically concerned that this will be exploitable by shuffling your soldiers around to keep a low REF level (while producing bells normally), and then suddenly increasing your SoL level...

Why's that any different from now, when the advice is "don't produce any bells until as late as possible--then hide all the statesmen and suddenly produce masses of bells"?..which is basically an exploit however you dress it up, albeit semingly a necessary one.

While Ellestar probably hasn't got things quite right, he's trying :)
 
Oh, it's no different from now ... I just think a different direction is better; either a straightline reduction for any given level (increase the threshold) or something like Dale's idea is probably better.

Trying is definitely good though :)
 
Suddenly as in, all the way to the desired amount in one turn? I'm basically concerned that this will be exploitable by shuffling your soldiers around to keep a low REF level (while producing bells normally), and then suddenly increasing your SoL level...
Yes, in one turn. Then again, it shouldn't increase the army more than once per turn if you play your game normally and don't try to exploit anything.
Well, i guess you can make a size 3 city with 3 Elder Statesman and Newspaper, produce a lot of bells there, join 10-15 colonists there and immediately trigger the revolution, but this one is easy to fix - i'll add another REF level check in a doRevolution() function.

What else do you have in mind? There is no point to keep SoL level low earlier in the game. If you want to minimize REF, you may have as many rebels as half of your total population in the turn when you'll declare revolution. Say, if you'll have 50 population when you'll declare a revolution, then you'll have a minimum of 25 rebels at that turn and a REF corresponding to 25 rebels. So, even if earlier in the game you'll have 100% SoL with half of that population (25/25 rebels), REF will not be higher than that.
You may also declare a revolution at a higher than 50% SoL, in that case REF will be bigger but you'll get a combat bonus for your troops, that should help to fight a bigger REF.

I'm more concerned with that a REF may be too small, noone suggested what will be a good number of REF compared to rebels for various difficulty levels :/

Oh, it's no different from now ... I just think a different direction is better; either a straightline reduction for any given level (increase the threshold) or something like Dale's idea is probably better.
Didn't i answer it already? You didn't answer to my arguments why my idea is better. That is, straightline reduction makes it manageable without an exploit, but with exploit REF will be reduced from manageable to a punching bag. My way, i just remove that exploit and hopefully make it always manageable (with some number tweaking, right now it's probably easy but i guess players may just choose a higher difficulty level in that case).

Dale's idea is too hard to balance, players will still be better with an exploit and they still may face an overwhelming REF if they'll choose not to pay off the king (say, new players who don't know what to do).
 
I think this logic is much better then difficult to understand original logic, while do the same in fact (more rebels - more REF). Just without strange behavior

The only thing concern me - why canon's REF-free amount based on quantity of you rebels, not on you total population size? For me it's more intuitive - King's not bother while colony have Big Guns to protect themself, but bother if they have too much of this guns. It's strange that King calculates how many rebels in colony and allow them few canon, but not too much, while not allowing any canon to monarchy followers :))

May be make it just 'REF increase if you have canon more then one tenth of you total colonists'?

I think it also needed to take in consideration amount of Ships of the Line. It's pure military unit, very strange to have even single for colonies.
 
Dale's idea is too hard to balance, players will still be better with an exploit and they still may face an overwhelming REF if they'll choose not to pay off the king (say, new players who don't know what to do).

Based on new-comer comments in other threads, they are actually paying the King thinking that it actually does affect REF. I'm just making that true.
 
Based on new-comer comments in other threads, they are actually paying the King thinking that it actually does affect REF. I'm just making that true.

I don't see why you guys can't combine BOTH approaches.

1) As the game "out of the box" stands (from your info Dale):- the King should always be refused as saying yes does basically nothing. (I won't comment on how the heck this got through beta-oh I just did-) So what's the point of his requests then? Just a niggle factor? (Damn and if being asked to fight wars I can't possibly get to in Civ - a la just met via optics - wasn't annoying enough)

Therefore your solution is neat as it adds in a factor that should really have been there from the start..

2) But why on earth should the REF solely be based on Liberty bells? If you have 2 or 3 little colonies with hardly any troops (even at 100% rebel sentiment), why on earth would any King in even a rather loose state of mind, be recruiting 100's of troops to counter?

Therefore (to my mind), a combo of Bells and Pop makes most sense. Dunno how easy this is to combine in code though...
 
... But why on earth should the REF solely be based on Liberty bells? If you have 2 or 3 little colonies with hardly any troops (even at 100% rebel sentiment), why on earth would any King in even a rather loose state of mind, be recruiting 100's of troops to counter?

Therefore (to my mind), a combo of Bells and Pop makes most sense. ...

I have to agree with this. Props to the creators of all mods for what they do, but this should have been fixed before release and should be the number 1 item on the patch's todo list. For something as important as the last army you are going to fight in the game, to only base its creation on a single game state is just plain bad coding.

All in all, this mod and Dale's together does sound like an exceptable fix to the current situation.
 
I'd say it should be a mix of rebel sentiment (which might be a better option than just liberty bell production), population and guns! Who'd you fear the most? 100 unarmed people or 25 with guns?

Technically, if you have a soldier you don't 'have' the 50 guns he uses, so each soldier should count as 50 guns, if that's somehow possible. Cannons could also be a factor, but I'm not sure about horses. Perhaps they should be taken into account, but to a lesser extent.
 
Well, I don't think refusing king will do you good when you will need a cheap unit to defend your colony, I think it effects price of Military Protection Units, not Royal Expeditionary Force.

I would say that Dragoons, VETERAN soldiers and cannons should affect REF, aswell as population and rebel sentiment, Liberty Bells should affect REF only little
 
Just having a look through you're code, I just have a couple of questions so I can understand where you're going with this. :)

Questions:

1. Why do you use getAIKingUnitThresholdPercent() instead of getAITrainPercent()?
2. Why do you CRIPPLE the AI coloniser civs by dramatically cutting their threshold levels but not the human by using the Founding Father multiplier (a drop from threshold * 2, to threshold * 0.6)?
3. Why do you use the Founding Father multiplier for the AI only when FF's have nothing to do with this component? Are you trying to rip the AI off by making the threshold so much lower that they get a massive REF making it harder for them to win? BTW, you can't alter this value to balance your new formula as doing so has a dramatic effect on FF price.

Code:
  // ***** Ellestar's REF - Start *****
	iThreshold *= GC.getHandicapInfo(getHandicapType()).getAIKingUnitThresholdPercent();
	iThreshold /= 100;

	if (!isHuman())
	{
	  iThreshold *= GC.getHandicapInfo(GC.getGameINLINE().getHandicapType()).getFatherPercent();
	  iThreshold /= 100;
	}
  // ***** Ellestar's REF - Start *****

4. Why the move of adding iBellsRate to FF's from the start to end of doBells()?
5. I'm wondering why you delete all of the bells stores and REF only to reset REF to starting level. Seems redundant. Why don't you just work with changes? All those vector clears and resets take time.

Code:
      if (NO_PLAYER != getParent())
      {
        CvPlayer& kParent = GET_PLAYER(getParent());
        FAssert(kParent.isEurope());
	  		changeBellsStored(-getBellsStored());
        setRevolutionEuropeUnitThresholdMultiplier(100); //default
        clearRevolutionEuropeUnits();
        kParent.initFreeUnits();
      }

6. I'm sorry, but this is just completely wrong:

Code:
		// We allow extra 20% free cannons, everything else leads to a REF increase
		iNumRebels += std::max(0, getExtraLandCombatUnits() * 100 - iNumRebels / 5);

If I have total pop of 30, with 50% sentiment in each city, and 10 cannons. That means this equation is doing (10 * 100) - ((30 * 0.5) / 5) == 1000 - (15 / 5) == 1000 - 3 == 997. So iNumRebels JUMPS from 15 --> 997. See next question for consequence.

7. Can you please explain the logic behind the next section? Using iNumRebels from point 6, and how you've reset getBellsStored() to zero already (see point 5) there's a redundant calculation in this formula. It's very confusing, it reads like the win strategy is to keep population tiny so you don't trigger the threshold.

I don't get what you're trying to do in the code, could you explain the process? :)
 
I just posted in Dale's REF mod thread, and then read this.

It does sound like a change to the REF is needed that incorporates a number of factors.

1. I like Dale's idea of changing the modifier based on money given to the King. The more money you give, the more sparse the increases in the REF.

2. Scaling of the REF to other factors, such as population, number of guns, cannon, etc... is interesting, but requires some thought.

From a game design perspective, are we trying to BALANCE something here, which means as you get more of something, the REF gets bigger and harder? If that is the case, there will always be some 'gamey' solutions, once you understand what the factors are.

From a historical perspective, the REF was not affected by rebel sentiment, gold given, number of guns, etc? It was the most forces the King could afford to put in the field, given the other demands of running a global empire and wars against Europeans and so on. It was probably FIXED.

This means it is a constant height hurdle, which if you play well (develop strong colonies, trade well, build guns, etc) you will jump easily.

The REF could simply be proportional to difficulty level, and that is all. All of this attempted BALANCING simply means confusion at some level. Good things to do are good things to do, and the constraints are the Indians, other Nations, limited gold, men, time, etc

On balance, I think the REF should be largely fixed, not dependent on many of these other factors (or only in a minor way, not in a way that effectively penalises preparation for the WOI).

Since Rebel Sentiment must equal 50% or more at DOI, just decide the appropriate REF, and make it proportional in absolute terms to Rebel Sentiment.

If this makes the game TOO EASY, then a harder difficulty level awaits.

It is the counterbalancing attempts (all through the REF size) that screw up the balance of the game.

Even with this suggestion, it would be possible to do something along the lines of Dale's Mod, that is, include an effect of refusing to give the King some money. It would have to be an additional mechanism to the above (and easily coded using the current escalation mechanism).
 
Just having a look through you're code, I just have a couple of questions so I can understand where you're going with this. :)

Questions:

1. Why do you use getAIKingUnitThresholdPercent() instead of getAITrainPercent()?
2. Why do you CRIPPLE the AI coloniser civs by dramatically cutting their threshold levels but not the human by using the Founding Father multiplier (a drop from threshold * 2, to threshold * 0.6)?
3. Why do you use the Founding Father multiplier for the AI only when FF's have nothing to do with this component? Are you trying to rip the AI off by making the threshold so much lower that they get a massive REF making it harder for them to win? BTW, you can't alter this value to balance your new formula as doing so has a dramatic effect on FF price.
1) I didn't want to add new values to HandicapInfo. getAIKingUnitThresholdPercent() is being used in doBells() only so i can freely chage it, unlike getAITrainPercent().
2) I don't understand that question... On easier levels, AI should fight a bigger REF, on harder levels AI should fight a smaller REF. I changed getAIKingUnitThresholdPercent() to getFatherPercent() since i needed the former in (1) and getFatherPercent() was close enough to what i needed.
3) ... Does it matter what exactly do i use if i get the desired effect? Your question doesn't make sense, i think you should check getFatherPercent() for different difficulty levels. I think you suppose it's a fixed value or something.

4. Why the move of adding iBellsRate to FF's from the start to end of doBells()?
Because of " if (iBellsRate == 0) return"

5. I'm wondering why you delete all of the bells stores and REF only to reset REF to starting level. Seems redundant. Why don't you just work with changes? All those vector clears and resets take time.
It happens only once and only if a you load an unmodded save (iRefVersion == 0) or it's a new game. In that case, getBellsStored() contains a different value that i can't use (from an unmodded script), and mod recalculates the REF. And i'm not sure how REF is being initialized in an original script when you start a new game so i just reset it.
After doBells() for all players, iRefVersion is being set to a non-zero value in CvGame::doTurn() - "setModVersion(MOD_REF, MOD_VERSION_REF);"

6. I'm sorry, but this is just completely wrong:
Code:
		// We allow extra 20% free cannons, everything else leads to a REF increase
		iNumRebels += std::max(0, getExtraLandCombatUnits() * 100 - iNumRebels / 5);
If I have total pop of 30, with 50% sentiment in each city, and 10 cannons. That means this equation is doing (10 * 100) - ((30 * 0.5) / 5) == 1000 - (15 / 5) == 1000 - 3 == 997. So iNumRebels JUMPS from 15 --> 997. See next question for consequence.
In Civ 4 percents are stored as an integer 0..100
10 * 100 - 30 * 50 / 5 = 1000 - 300 = 700 extra added to 1500
Working as intended.

7. Can you please explain the logic behind the next section? Using iNumRebels from point 6, and how you've reset getBellsStored() to zero already (see point 5) there's a redundant calculation in this formula. It's very confusing, it reads like the win strategy is to keep population tiny so you don't trigger the threshold.

I don't get what you're trying to do in the code, could you explain the process? :)
getBellsStored() is being reset only once, see (5)
 
The only thing concern me - why canon's REF-free amount based on quantity of you rebels, not on you total population size? For me it's more intuitive - King's not bother while colony have Big Guns to protect themself, but bother if they have too much of this guns. It's strange that King calculates how many rebels in colony and allow them few canon, but not too much, while not allowing any canon to monarchy followers :))

May be make it just 'REF increase if you have canon more then one tenth of you total colonists'?
Ok, in a new version it will be changed to 15% free cannons from population.

I think it also needed to take in consideration amount of Ships of the Line. It's pure military unit, very strange to have even single for colonies.
I thought about it but their cost is prohibitive and it's a "do or die" strategy - either you kill all REF ships or you just waste your resources on Ships of the Line (so you'll have less resources to fight on land, so REF increase effect compared to your forces already happened, no need to apply it twice). So, IMHO it's pointless to penaltize a player by a bigger REF if he uses that strategy, i think it's balanced enough as it is.

I don't see why you guys can't combine BOTH approaches.
Planned for a next version, i'm just too lazy to finish it :)

I'd say it should be a mix of rebel sentiment (which might be a better option than just liberty bell production), population and guns! Who'd you fear the most? 100 unarmed people or 25 with guns?
Well, maybe but New World is a dangerous place, that's why a King sells you guns in a first place. So guns alone doesn't mean anything and you can't use more guns than your population so it's already indirectly taken in account in REF calculations. If you declare a revolution when you don't have enough guns, sucks to be you, be prepared next time. If you have enough guns, population is a deciding factor.
 
Back
Top Bottom