'Resource_Distribution' table - anyone figure this out?

Shadole

Warlord
Joined
Aug 7, 2015
Messages
116
If you look at this table, it shows:

Code:
    <Resource_Distribution>
        <Row Continents="1" Scarce="0" Average="7" Plentiful="0" PercentAdjusted="25"/>
        <Row Continents="2" Scarce="4" Average="3" Plentiful="0" PercentAdjusted="25"/>
        <Row Continents="3" Scarce="1" Average="1" Plentiful="1" PercentAdjusted="25"/>
        <Row Continents="4" Scarce="1" Average="2" Plentiful="1" PercentAdjusted="25"/>
        <Row Continents="5" Scarce="2" Average="1" Plentiful="2" PercentAdjusted="25"/>
        <Row Continents="6" Scarce="2" Average="2" Plentiful="2" PercentAdjusted="25"/>
        <Row Continents="7" Scarce="3" Average="1" Plentiful="3" PercentAdjusted="25"/>
        <Row Continents="8" Scarce="3" Average="2" Plentiful="3" PercentAdjusted="25"/>
    </Resource_Distribution>

Looks like they prepared for the possibility of up to 8 continents at once. The values attached to scarce, average, and plentiful make zero sense to me. Also can't figure out PercentAdjusted. If these are known, it seems like we could modify resource frequency instead beyond the current 4 luxuries per continent?
 
I would guess those are definitions for different kinds of continents. It's not about handling up to eight at once - it's about their being 8 different formulas for the resources a continent can contain.

For instance, Continent #1 is full of average resources (which I'd guess are resources with average distribution numbers?) but doesn't have any of the rare or super-plentiful resources on the map.

Just a guess!
 
Wow, I never even thought of that! Something like that may be the case..I'm not sure it's about resources being rare or not, because every luxury has the same value of '2' except for whales and pearls which are 6. Hmm.
 
From the only place in an y lua file where this seems to be used (it's for resouce generation on a map):
Code:
function ResourceGenerator:__GetStrategicResources()
	local continentsInUse = Map.GetContinentsInUse();	
	self.iNumContinents = #continentsInUse;
	self.aStrategicType = {};

	-- Find the Strategic Resources
	for row = 0, self.iResourcesInDB do
		if (self.eResourceClassType[row] == "RESOURCECLASS_STRATEGIC" and self.iFrequency[row] > 0) then
				table.insert(self.aStrategicType, self.aIndex[row]);
		end
	end

	aWeight = {};
	for row in GameInfo.Resource_Distribution() do
		if (row.Continents == self.iNumContinents) then
			for iI = 1, row.Scarce do
				table.insert(aWeight, 1 - row.PercentAdjusted / 100);
			end

			for iI = 1, row.Average do
				table.insert(aWeight, 1);
			end

			for iI = 1, row.Plentiful do
				table.insert(aWeight, 1 + row.PercentAdjusted / 100);
			end
		end
	end
And then the rest of the lua code goes into deeply complex stuff I haven't taken the time to parse to any degree of real understanding.

"GameInfo" in an lua file tells the game to read out data within an XML table.

"self.iResourcesInDB " is just an integer value but as yet I haven't figured out where it is established. Okay, they just set it to the number of different resource types there are in table <Resources>.

---------------------------------------------------------------------------------------------------------------------------------------------

this portion
Code:
	aWeight = {};
	for row in GameInfo.Resource_Distribution() do
		if (row.Continents == self.iNumContinents) then
			for iI = 1, row.Scarce do
				table.insert(aWeight, 1 - row.PercentAdjusted / 100);
			end

			for iI = 1, row.Average do
				table.insert(aWeight, 1);
			end

			for iI = 1, row.Plentiful do
				table.insert(aWeight, 1 + row.PercentAdjusted / 100);
			end
		end
	end
Is just pulling information from the Resource_Distribution table based on the # of Continents there are in the game and then creating a set of "weights" (lua table aWeight) but it's not clear whether the weights created are then randomly selected or are done in order for (for example) strategic resources. To figure that out would require a bunch of time to chase the logic within the file C:\Program Files (x86)\Steam\SteamApps\common\Sid Meier's Civilization VI\Base\Assets\Maps\Utility\ResourceGenerator.lua
 
Last edited:
Back
Top Bottom