Fixing the 'no reagents' problem

cephalo

Deity
Joined
Jul 26, 2007
Messages
2,058
Location
Missouri, USA
I've had some complaints with my Creation map script that reagents sometimes are not available. After some research I have determined that there is nothing in Creation.py in particular that causes this to happen, but this problem exists in any map script that uses the default bonus placement scheme. Therefore, rather than change Creation.py to circumvent this problem, I'm going to discuss some easy ways to fix it for all map scripts.

-Explanation of problem-
If you play with the recommended number of players for a particular map size, you will usually get the intended number of reagents on the map, which is about 75% of the number of starting players. Considering the importance of this resource, that number is already pretty darn low. I can be difficult to get reagents under these circumstances.

However, the real problem occurs when you want to play with alot of civs, or if you want to play with the Blessing of Amatheon(Double resources) option. Each bonus in Civ4 belongs to a particular bonus 'class'. This class mechanism is used to prevent bonuses of the same class from being too near each other. In the case of reagents, the bonus class is BONUSCLASS_RUSH. Other bonuses belonging to this class are gunpowder, copper, iron, mithril, horses. These bonuses are not allowed to be within 4 map tiles of any other bonus in the class. This is to prevent supercities that have access to too many important resources. Another aspect of the bonuses in this class are that the number to place is based on the number of players and has nothing to do with the map size. So taking up 4x4 tiles of real estate for each placement has a different meaning on a small map with many players than it would on a large map with just a few players. Since bonuses in Civ4 are always placed in a fixed order, the bonus that is last in line to be placed has to hope that there is room left on the map that is 4 tiles away from any other bonus of that class. With many players or with double bonuses, there is often no room left for reagents, which are last in line to be placed.

-The Easy Fix -
Fortunately this problem is very easy to fix, and you have several options. The first option I will give is the least intrusive. Open the XML file in your Civ4\BtS\Fall from Heaven 2\Assets\XML\Terrain directory called Civ4BonusInfos.xml. Find the following block of code:
Code:
        <BonusInfo>
            <Type>BONUS_REAGENTS</Type>
            <Description>TXT_KEY_BONUS_REAGENTS</Description>
            <Civilopedia>TXT_KEY_BONUS_REAGENTS_PEDIA</Civilopedia>
            <BonusClassType>BONUSCLASS_RUSH</BonusClassType>
Now change the bonus 'class' of reagents from BONUSCLASS_RUSH to BONUSCLASS_GENERAL, which has a much more forgiving proximity rule.
Code:
        <BonusInfo>
            <Type>BONUS_REAGENTS</Type>
            <Description>TXT_KEY_BONUS_REAGENTS</Description>
            <Civilopedia>TXT_KEY_BONUS_REAGENTS_PEDIA</Civilopedia>
            <BonusClassType>[COLOR="Red"]BONUSCLASS_GENERAL[/COLOR]</BonusClassType>
This will give you the intended number reagents on the map almost every time.

For those of you who like to use Blessing of Amatheon along with more than the normal number of players, you might consider a different fix that more directly addresses other crowding problems besides just reagents. Doubling the bonuses doesn't really work if there is no room to place them. Find the file Civ4\BtS\Fall from Heaven 2\Assets\XML\Terrain\Civ4BonusClassInfos.xml. Find the following block of code:
Code:
		<BonusClassInfo>
			<Type>BONUSCLASS_RUSH</Type>
			<iUnique>4</iUnique>
		</BonusClassInfo>
set iUnique to 3.
Code:
		<BonusClassInfo>
			<Type>BONUSCLASS_RUSH</Type>
			<iUnique>[COLOR="Red"]3[/COLOR]</iUnique>
		</BonusClassInfo>
This should give you plenty of room for the doubling of bonuses. In fact, you might go through each bonusclass definition and reduce iUnique by one. That way 'double bonuses' means exactly that, without the crowding problems.
 
Excellent! Thanks.
 
Great work cephalo! Im going to change the iUnique in 0.31 to 3 as you suggest.
 
How do you change XML? it wont let me
 
What are you trying to edit it with? Notepad works fine, although notepad2 or notepad++ would be better.
 
How do you change XML? it wont let me

You're not using Vista by chance are you? If so you may need to explicitly take ownership of the file.

Keep in mind the 'no reagents' issue should not exist in new versions of FFH.
 
It does when you play with 19 civs on a small map. :mischief:

Would a solution be to set <iUnique> of all BonusClasses to zero, but instead give each individual bonus an appropriate <iUnique> in BonusInfos?
 
Keep in mind the 'no reagents' issue should not exist in new versions of FFH.

I still have problems finding regents, and thats on huge maps with 19 civs, on .34, so i don't know whats up. When I went to edit the XML, the iUnique was set to 6, could that be it?
 
use snarko's options mod if you want to always have reagents- the mod allows you to force-place resources for all players.
 
i don't really want everyone to have them, its just there are NO reagents at all on the map. If there were I wold get a city near it by any means necessary. And also, I think I broke the game when I tried to edit the XML. It somehow changed everything else, even in other folders :confused:.
 
I still have problems finding regents, and thats on huge maps with 19 civs, on .34, so i don't know whats up. When I went to edit the XML, the iUnique was set to 6, could that be it?

With a setting of 6, I would think there would be huge crowding problems. However, in my version .34 I'm seeing 3.
 
Top Bottom