Adding new bonuses - anyone know what these cryptic XML tags do?

tndp

Chieftain
Joined
Nov 1, 2005
Messages
16
This post has been stripped of all tabs - can I post in plaintext on this system?

Firstly, the schema that I'm having trouble with:
Schema itself is in CIV4TerrainSchema.xml
But I'll excerpt from CIV4BonusInfos.xml
Spoiler :
Code:
		<BonusInfo>
			<Type>BONUS_ALUMINUM</Type>
			<Description>TXT_KEY_BONUS_ALUMINUM</Description>
			<Civilopedia>TXT_KEY_BONUS_ALUMINUM_PEDIA</Civilopedia>
			<BonusClassType>BONUSCLASS_MODERN</BonusClassType>
			<ArtDefineTag>ART_DEF_BONUS_ALUMINUM</ArtDefineTag>
			<TechReveal>TECH_INDUSTRIALISM</TechReveal>
			<TechCityTrade>TECH_MINING</TechCityTrade>
			<TechObsolete>NONE</TechObsolete>
# Self-explanatory, I believe.
			<YieldChanges>
				<iYieldChange>0</iYieldChange>
				<iYieldChange>1</iYieldChange>
				<iYieldChange>0</iYieldChange>
			</YieldChanges>
# Seems to be food, production, trade. Bonuses from mine are specified elsewhere, but that's not a problem.
			<iAITradeModifier>10</iAITradeModifier>
# I assume higher is more desirable to the AI.
			<iHealth>0</iHealth>
			<iHappiness>0</iHappiness>
# Again, self explanatory.
			<iPlacementOrder>2</iPlacementOrder>
# Okay - this is the order in which they're placed, maybe? Values in "placementorder" appear more than once, though. Hit Movies etc. are placement -1.
			<iConstAppearance>100</iConstAppearance>
# Maybe this is the frequency? It is always either 100, 50 or 0. Tripling every value in the file has no noticeable effect. Changing to 0 probably deletes the resource (see Hit Movies, for example) but that doesn't prove much.
			<iMinAreaSize>3</iMinAreaSize>
# .. What? Maybe this has something to do with the minimum sparseness? I've noticed that two resources of *different* types are never adjacent. Always 3, except for sea resources, which are 10. Dramas etc. are -1.
			<iMinLatitude>0</iMinLatitude>
			<iMaxLatitude>90</iMaxLatitude>
# Self explanatory - latitude ranged allowed.
			<Rands>
				<iRandApp1>10</iRandApp1>
				<iRandApp2>10</iRandApp2>
# On the other hand, this also looks suspiciously like a random number for frequency. This might be clumping frequency, though. Both 10 for all production resources, both 25 for all others.
				<iRandApp3>0</iRandApp3>
				<iRandApp4>0</iRandApp4>
# Always 0. For making clumps with three or four members in them?
			</Rands>
			<iPlayer>100</iPlayer>
# 100, 67 or 0. I don't see a pattern.
			<iTilesPer>0</iTilesPer>
# Either 0 or a power of 2. Sparseness? Again, might impact frequency.
			<iMinLandPercent>0</iMinLandPercent>
# Always 0, so I didn't touch it. Should try experimenting with this one (may do the obvious).
			<iUnique>0</iUnique>
# Can be any value, no pattern. No idea.
			<iGroupRange>0</iGroupRange>
# 0 or 1. Might de-uniqueify placement order?
			<iGroupRand>0</iGroupRand>
# Usually 0, but is 25 or 50 for some luxuries. Maybe has something to do with continent-specification?
			<bArea>0</bArea>
# 1 for land-based non-production resources. What is an Area?
			<bHills>1</bHills>
			<bFlatlands>0</bFlatlands>
			<bNoRiverSide>0</bNoRiverSide>
# Self-explanatory, 1->you can find it there (except riverside).
			<bNormalize>0</bNormalize>
# Mostly 0, sometimes 1. No idea.
			<TerrainBooleans>
				<TerrainBoolean>
					<TerrainType>TERRAIN_PLAINS</TerrainType>
					<bTerrain>1</bTerrain>
				</TerrainBoolean>
				<TerrainBoolean>
			<FeatureBooleans/>
			<FeatureTerrainBooleans/>
# I've deleted the other examples - you add one of these blocks for each terrain type in which the bonus can be generated.

Anyway, if anyone has already done extensive experiments (or just knows) what these things do, and can fill out the rest of the tags, I'd appreciate it greatly.

I'm particularly interested in the rarity numbers - all of them are pretty much the same (so I could just copy and modify an existing instance) but while I'm adding new resources I'd like to make some of them rarer than others - otherwise, iron and copper become impossible to obtain - alternatively, I could make bonuses more common overall, which I think is more fun anyway.

I've done some experiments but fiddling with these numbers but I don't see a huge impact. At the moment, I can't even figure out where in the python code the bonuses are added to the random map - are the bonuses just considered features? They don't seem to be called "bonuses" in the perl code (except where it deals with documentation)? I have to look through CvMapScriptInterface.py, actually - might be in there somewhere and just never used.

/cygdrive/c/Program Files/Firaxis Games/Sid Meier's Civilization 4/Assets/Python
$ grep -ci bonus *.py */*.py */*/*.py | grep -v :0
CvAdvisorUtils.py:17
CvDebugTools.py:6
CvUtil.py:1
PyHelpers.py:146
EntryPoints/CvMapScriptInterface.py:21
EntryPoints/CvScreensInterface.py:10
Screens/CvDebugInfoScreen.py:22
Screens/CvForeignAdvisor.py:21
Screens/CvMainInterface.py:53
Screens/CvPediaBonus.py:51
Screens/CvPediaBuilding.py:5
Screens/CvPediaHistory.py:8
Screens/CvPediaImprovement.py:12
Screens/CvPediaMain.py:19
Screens/CvPediaUnit.py:8
Screens/CvScreenEnums.py:1
Screens/CvTechChooser.py:19
Screens/CvWorldBuilderScreen.py:20
pyWB/CvWBDesc.py:8

No mention that I can see in any of the random map generation stuff.

Anyway, there are a bunch you might profitably add:
Tobacco is a luxury, made obsolete by Genetics (as people stop smoking it.)

Chocolate, coffee and tea are all luxuries.

Guano deposits are important for military purposes post gunpowder but pre-WWI - window is slightly narrower than the one for whales.

Oysters are a luxury found in sea hexes.

Honey makes mead - you could build wineries on the hexes.

Cedar is a luxury that appears only in forests - they are collected using timbermills. There are some other luxury woods - Ebony and Mahogany, for example.

Rubber is a construction material (+1 hammer) found only in jungles. It could halve the price of some wonders, I suppose.

The "gems" resource clearly represents corundum (rubies, sapphires) or possibly beryl (emerald) and is not interchargable with diamond, which is a luxury and may have military or industrial applications late in the game (subject to another mod, probably). There are several types of gems in the ancient world, which were definitely traded for each-other, so we might also add "jewels", meaning there would be three types to trade.

Platinum never played an important role in the ancient old world, but that is an accident of history and geology - the inca knew it used it.
 
Perhaps we could add tin, and make ancient units require either copper and trin or iron
 
tndp said:
This post has been stripped of all tabs - can I post in plaintext on this system?

Try posting the code surrounded by "code" blocks by surrounding the code with [code] and [/code].

Code:
To make this code...

	I surrounded it with "code" blocks.

And if it's really big, maybe put is in a spoiler by doing [spoiler][code]Put code here[/code][/spoiler]

Spoiler :
Code:
This could be used for longer segments that may take up the full screen.
	Of course, it's not necessary, but makes the post readable I think.

Codes and examples here
 
Back
Top Bottom