How to change REF-Starting-Size and -Growth ...

historix69

Emperor
Joined
Sep 30, 2008
Messages
1,402
1. In file "Assets\XML\Civilizations\CIV4CivilizationInfos.xml" there are entries for all civilizations in the game ... the 4 european motherlands do have entries for the starting size of REF ... unfortunately, every single REF-unit is listed separately using up 5 lines of text each :confused: ... (In Col1-savefiles it was 4 Bytes for complete REF for each nation, if I remember correctly.) ... Anyway ... with some good will and talent for copy and paste or a small program/script, it should be possible to set the Starting Size of REF for each nation to any desired value ... This REF-size would apply to all levels of difficulty.

Spoiler :
<FreeUnitClasses>
<FreeUnitClass>
<UnitClassType>UNITCLASS_SHIP_OF_THE_LINE</UnitClassType>
<FreeUnitProfession>NONE</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_SHIP_OF_THE_LINE</UnitClassType>
<FreeUnitProfession>NONE</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_SHIP_OF_THE_LINE</UnitClassType>
<FreeUnitProfession>NONE</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_SHIP_OF_THE_LINE</UnitClassType>
<FreeUnitProfession>NONE</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_CANNON</UnitClassType>
<FreeUnitProfession>NONE</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_CANNON</UnitClassType>
<FreeUnitProfession>NONE</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_CANNON</UnitClassType>
<FreeUnitProfession>NONE</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_CANNON</UnitClassType>
<FreeUnitProfession>NONE</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_REGULAR</UnitClassType>
<FreeUnitProfession>PROFESSION_DRAGOON</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_REGULAR</UnitClassType>
<FreeUnitProfession>PROFESSION_DRAGOON</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_REGULAR</UnitClassType>
<FreeUnitProfession>PROFESSION_DRAGOON</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_REGULAR</UnitClassType>
<FreeUnitProfession>PROFESSION_DRAGOON</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_REGULAR</UnitClassType>
<FreeUnitProfession>PROFESSION_SOLDIER</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_REGULAR</UnitClassType>
<FreeUnitProfession>PROFESSION_SOLDIER</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_REGULAR</UnitClassType>
<FreeUnitProfession>PROFESSION_SOLDIER</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_REGULAR</UnitClassType>
<FreeUnitProfession>PROFESSION_SOLDIER</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_REGULAR</UnitClassType>
<FreeUnitProfession>PROFESSION_SOLDIER</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_REGULAR</UnitClassType>
<FreeUnitProfession>PROFESSION_SOLDIER</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_REGULAR</UnitClassType>
<FreeUnitProfession>PROFESSION_SOLDIER</FreeUnitProfession>
</FreeUnitClass>
<FreeUnitClass>
<UnitClassType>UNITCLASS_REGULAR</UnitClassType>
<FreeUnitProfession>PROFESSION_SOLDIER</FreeUnitProfession>
</FreeUnitClass>
</FreeUnitClasses>


2. I suppose it should be possible to completely turn off REF-Growth by changing the value REVOLUTION_EUROPE_UNIT_THRESHOLD in GlobalDefines.xml, e.g. to the following value

<Define>
<DefineName>REVOLUTION_EUROPE_UNIT_THRESHOLD</DefineName>
<iDefineIntVal>750000</iDefineIntVal>
</Define>​

-> You have about 750.000 Bells free before the first REF-Growth happens ...

I gave it a short try and it seemed to work ... Longtime experience is still missing ... also I did not have enough time to check the code for every usage of the changed parameter ...
Hopefully this may be an easy way to individually solve the REF-problem for everybody without having to change c++-code and compile the dll.
 
Or just play the Snoopy/Dale patch with REF fixes and many more bugs fixed. :)
 
Nice on shoving an advertisement to your Unofficial Patch Mod right at the top, but I think the point of this thread was simple XML changes anyone can make to fix the REF.

When I'm not modding I use these settings:
Code:
	<Define>
		<DefineName>REVOLUTION_EUROPE_UNIT_THRESHOLD_INCREASE</DefineName>
		<iDefineIntVal>200</iDefineIntVal>
	</Define>
	<Define>
		<DefineName>REVOLUTION_EUROPE_UNIT_THRESHOLD</DefineName>
		<iDefineIntVal>200</iDefineIntVal>
	</Define>
	<Define>
		<DefineName>REVOLUTION_EUROPE_UNIT_SHIP_MODIFIER</DefineName>
		<iDefineIntVal>-50</iDefineIntVal>
	</Define>
 
Just changing the xml doesn't fix the fundamental problem that more LB's == more REF though.
 
The idea is to set REVOLUTION_EUROPE_UNIT_THRESHOLD to such a high value, that the expression

Code:
if (getBellsStored() >= revolutionEuropeUnitThreshold() && iBellsRate > GC.getCivilizationInfo(getCivilizationType()).getF reeYields(YIELD_BELLS))

never becomes true. -> REF will never grow during game.

By editing the xml, people can fix the REF-Size to any size they like and have Fun with ...

Edit :
People who like a small WoI-challenge may choose REF like 40/20/20/10.
People who prefer longer battles may choose 120/60/60/30.
...
People can start producing Bells from the beginning and don't have to be afraid that REF will grow exponentially ... They can see the fixed Size of REF from the beginning and can build up their horses/guns/cannons-storage over time up to a size which they feel sufficient to win WoI ....
 
Well, I don't personally want the REF to never increase, you could just turn the Independence Victory off, I am wanting some kind of fight when I declare Independence. With the numbers I posted, the REF still increases, just much more slowly.
 
Just changing the xml doesn't fix the fundamental problem that more LB's == more REF though.

No one said it did. The point is to fix the main problem of the REF getting to big, without having to recompile the DLL or use some "Patch" mod that changes tons of other things that wern't glitches.
 
You can turn the Idenpendance victory off? I would have been nice if they could have allowed other victory options.
 
No one said it did. The point is to fix the main problem of the REF getting to big, without having to recompile the DLL or use some "Patch" mod that changes tons of other things that wern't glitches.

Like what? Please explain what you don't think aren't glitches?
 
You can turn the Idenpendance victory off? I would have been nice if they could have allowed other victory options.

If you check the custom game options, I'm pretty sure you can. There are three victory condition checks. Is well as "Independence" there is also "Europe" and "Time". Presumably this means you can set the condition to just conquer Europe and you can also make it winnable by a certain time.
 
The idea is to set REVOLUTION_EUROPE_UNIT_THRESHOLD to such a high value, that the expression

Code:
if (getBellsStored() >= revolutionEuropeUnitThreshold() && iBellsRate > GC.getCivilizationInfo(getCivilizationType()).getF reeYields(YIELD_BELLS))

never becomes true. -> REF will never grow during game.

By editing the xml, people can fix the REF-Size to any size they like and have Fun with ...

Where's that code? Is it easily accessable for us or is it something that has to be compiled? I'd like to change getBellsStored() to a new function, even something like getPoliticalPointsStored(), if that function exists.
 
Like what? Please explain what you don't think aren't glitches?

Well, I'm glad you asked... ;)

* Europe Sea Zone fix to one third of the way in from the map edge and 4 tiles from coast

I don't see any need for a European Zone to ever be 6 Tiles wide. Is there some bug I am unaware of with the normal European Zones?

* Colonists can now join cities after moving (like founding cities).
* Can now set profession after moving (like clear profession).

This really seems more like a preference thing then any kind of glitch.

* Converted native can no longer be educated at Indian settlements
* Converted natives can no longer become missionaries.

Can you please explain, In Character, how this works out. I would think that an Indian, that speaks the language, would train quicker at an Indian Village. You would also think that a CN would train especially as fast at the Village he was born and raised in. Game mechanics are great and all, but if it doesn't make sense in the fluff of the game then it just stands out as a glaring Balancing Mechanic.

* Units cannot be made a soldier/dragoon and attack the same turn (eliminates an exploit).

I've heard talk about this one on other threads and I can see the point, but I disagree with the implimintation. I think it would be better, and forgive me if I sound like a person thats never opened the SDK, if the Units couldn't drop guns after they have attacked, instead of not being able to attack when they pick guns up.

I fear you have broken a good game mechanic with the current implementation. Seeing as I've been attacked very few times, I can't be sure, but I believe if you have enough guns in storage in a city, and no soldiers gaurding a city, and the city is attack, then some colonist will pick up those guns and defend the city.

* European horses tripled in price.

This is definetly not a glitch fix. It could be considered a game balance, but I don't see the point. When you can get 50 horses with a hurried Scout for 60 to a few hundred gold and then breed an infinite amount of horses, there is already very little need to buy horses and making them more expensive lowers that need to 0.

* Warnings: Out of raw good for processing warning.
* Warnings: Almost out of space warning.

These aren't glitches. There is already a ColAlerts mod out and these are more appropriate to a normal mod instead of a Patch Mod.

* Can't declare war against another European Civ for the first 20 turns.

I really like this new mechanic, but it is just that a new mechanic and not a glitch fix. I can see where it is a good thing now that the other Europeans are smarter, but it should have a Game Option checkbox in the Custom Game screen if it doesn't already.

Those are the ones I don't like so far. The rest seem needed. :goodjob:

Looking at your todo list I see a few that pop out at me.

* Allow training multipe colonists
* Do not allow free training of costly colonists

These sound more like extensions or improvements then bug fixing.

* No negative for placing missionaries (needs to fail in some cases).

Again, this is an improvement, not a glitch repair and up to personal taste on whether or not it needs to be done.

* Fix trade routes so that units are not left in excess of warehouse capacity
* Allow partial trades in diplo trading with natives/colonies.

Not to sound repeative, but, *repeat prievious concept* while these aren't ideal implementations, they aren't glitches either.

* Show promotions on units in city screen.

The only glitch with the City Screen I've ever noticed is that the Main Interface's Gold Amount Text doesn't always hide when you bring up the City Screen.

* Mark rejected FF's in FF screen.

If a screen works, then it doesn't need to be changed in a Patch.


****

Now I'm not being criticle of you, I've seen this happen to each of the "Unofficial Patch" Mods in turn. As soon as some one starts asking for bugs to squash in the patch mod, every player and their mom is online touting their pet peeve as a glitch needing immediate repair. And, us being nice people that just want to make the players happy, the natural inclination is to include whatever sounds like a good change.

But the point of a Patch Mod is to fix glaring problems and true glitches until Firaxis puts out the official patch.

I don't know, in the end its not a big deal to me, I can pick and choose what changes I want out of your SDK, but its players that don't want any game play changes, but do want glitch fixes that always miss out with these Unofficial Patches.

Just my two cents. Take it as you will man. :king:
 
Well, I'm glad you asked... ;)

....SNIP....

Just my two cents. Take it as you will man. :king:

Some of those are actually bugs, for instance "Do not allow free training of costly colonists" where if you have no gold you can train a graduating colonist as a professional (eg: statesmen) for free. :) But the majority eliminate major exploits, or game-breaking inbalance.
 
Ok, I can give you that one. But your last line is my point exactly, exploits and balance issues. An Unofficial Patch should fix glitchs, not mess with things some people think are exploits or imbalanced.

Anyway, keep up the good work man. :band:
 
Totally see your point, sent you a PM on the topic too (not exactly the right thread for discussion of this) ;)
 
Yeah, you'll need to compile a new DLL with any code changes you make. :)
 
It would be harder than I thought. I think I'd have to rip out the REF unit threashold testing and REF unit generation code from the LB gneration function and put them in their own functions with a passing variable. Then I could pass through things like FF points or cross generation.

Boy, I hope someone documents the code and where to get what (such as FF points for each type) so we know how to code * HINT HINT *
 
That would take many months of code reading. Not something I'd look forward to.
 
I hate to revive a dead thread but where do i find the values to adjust the REF again? I looked for several hours and just couldn't find ANYTHING at all, I just want to change the speed of it's growth and starting size.
 
Top Bottom