Change what Resources are worth?

Ryika

Lazy Wannabe Artista
Joined
Aug 30, 2013
Messages
9,395
Couldn't find anything in the xml/lua-files, so it's probably not possible?
 
No, from trading. Instead if getting 1.something EPT per Petroleum getting 6 or something like that.
 
Assuming Civ:BE is using the same code as Civ:V, it's hard-coded in the DLL

Spoiler :
Code:
/// How much is a Resource worth?
int CvDealAI::GetResourceValue(ResourceTypes eResource, int iResourceQuantity, int iNumTurns, bool bFromMe, PlayerTypes eOtherPlayer)
{
	int iItemValue = 0;
	const CvResourceInfo* pkResourceInfo = GC.getResourceInfo(eResource);
	ResourceUsageTypes eUsage = pkResourceInfo->getResourceUsage();

	// Strategic Resource
	if(eUsage == RESOURCEUSAGE_STRATEGIC)
	{
		//tricksy humans trying to sploit us
		if(!bFromMe)
		{
			// if we already have a big surplus of this resource
			if(GetPlayer()->getNumResourceAvailable(eResource) > GetPlayer()->getNumCities())
				iResourceQuantity = 0;
			else
				iResourceQuantity = min(max(5,GetPlayer()->getNumCities()), iResourceQuantity);
		}

		if(!GET_TEAM(GetPlayer()->getTeam()).IsResourceObsolete(eResource))
			[B][COLOR="red"]iItemValue += (iResourceQuantity * iNumTurns * 150 / 100);	// Ex: 5 Iron for 30 turns * 1.5 = value of 225[/COLOR][/B]
		else
			iItemValue = 0;
	}

	// Increase value if it's from us and we don't like the guy
	if(bFromMe)
	{
		int iModifier = 0;

		// Opinion also matters
		// [B][COLOR="Red"]SNIP ... lots of hard-coded values[/COLOR][/B]

		// Approach is important
		// [B][COLOR="red"]SNIP ... lots of hard-coded values[/COLOR][/B]

		iItemValue *= iModifier;
		iItemValue /= 200;	// 200 because we've added two mods together
	}

	return iItemValue;
}
 
That's actually kinda suprising. I was expecting reference to some sort of database backed value or something there. It seems like a gameplay parameter they would want more easily adjusted and synchronized.
 
Not really that surprising, as when you start digging into the code, what becomes apparent is how little of the AI is configurable from the game database
 
In most games, what is available to the end user vs. what is hardcoded is simply a matter of how much time the developers had for such a non-critical exposure of values.

To the devs, it's all configurable because they have the source. It's disappointing, but resources are resources. I'm hoping for more stuff to be exposed in the Winter Patch, as the Fall Patch added some useful bits and bobs about the place (not least Miasma immunity per unit instead of hardcoding it to the Explorer / Worker / whichever one it was).
 
Top Bottom