Resource amounts?

lamp xoxo

Chieftain
Joined
Sep 15, 2014
Messages
1
Alright so I started up a game on a gigantic map size on custom continents with the most recent version of AND. As I was playing, I noticed that when discovering resources with tech, instead of normally finding one or two within my borders, and several elsewhere on the map, I would instead not find any on the known map, which was about 3/4 of the large continent I was on. I figured it was just due to random placement, and kept on exploring, looking for these fabled apples and iron and ancient relics. Still I found only very little. Thinking it might be a bug, I backed out to the main menu and generated a new map with similar settings, but unlocked worldbuilder.

On the map I opened up, there were a total of:

General resources: 1 silver, 1 gold, 1 ancient relics, 1 furs, 1 incense, 1 elephants, 1 whale, 2 obsidian, 2 copper, 2 rubber, 2 uranium, 3 coal, 3 bauxite, 3 iron and then 44 geothermal power and 57 stone and 76 methane ice (yes I counted). Also notable was the 3 oil and 2 horses all on the same continent.

Luxuries: 1 coffee, 1 dye, 1 sugar, 1 hemp, 1 spices, 1 gems, 1 silk, 1 grapes, 1 olives, 1 cotton, and 1 pearls.

Food: 1 apple, 1 salt, 1 tea, 1 lemon, 1 banana, then numerous rice, pig, shrimp, fish, clams, cows, corn, potatoes, crab, deer, and sheep.

This was on a gigantic map. With balanced resources. I understand that because some improvements can spontaneously pop in some new copies of resources, the number of resources at the outset should be adjusted accordingly, but what about the ones that can't be generated? Pearls? Apples? Lemons? Ancient Relics? And why make renewable resources like wheat, corn, geothermal energy, and even stone so omnipresent? The only ones that seem to be at the amount that I expected were sheep/deer/fish/clam etc. The rest just seemed like there was either too much or not enough.

I just want to know if this is working as intended or not, and if it is, I'd like to know why the mod designers made the choices they did in regards to this.
 
I agree that's an area that should use some fixing. But as far as I know it's a problem of both Game Size and the Map Generator you use.


I see many people complaining over the abundance of resources. But what I see is the same of lamp xoxo: a big lack of resources.

But actually with the Random Events that spawn resources, and all the improvements that pop them, the resource placement hasn't been problematic in any of my games. But I see that in the games of those with abundance it is a problem.
 
We'll try to fix that eventually, at least for most used mapscripts (I guess custom continents) is one of those. lamp xoxo, does it happen every time you try the same mapscript/mapsize? Or was it just once or twice? Can you do me a favour and try generating a few maps with this mapscript and just check if it happens that resources are normal or if it always happen what you've experienced? You don't need to count every resource, just let me know roughly if the situation is always so bad. Thank you.
 
IMHO I do not want to edit every mapscript to fix resources. The way resources in Civ4 is distributed via the random factors in the BonusXML is absurd to me, but it's far too late an hour to change now.

I think the easiest solution is to introduce a new tag to the bonus infos. Something like this:

Code:
<MinimumPerWorldSizes>
    <MinimumPerWorldSize>
        <WorldType>WORLDSIZE_SMALL</WorldType>
        <iMinimum>4</iMinimum>
    </MinimumPerWorldSize>
    <MinimumPerWorldSize>
        <WorldType>WORLDSIZE_STANDARD</WorldType>
        <iMinimum>6</iMinimum>
    </MinimumPerWorldSize>
</MinimumPerWorldSizes>

Then, when the game starts up, and after the mapscript runs, the DLL could check the map to enforce these minimums.
 
I've noticed some rarities, of seemingly random resources, on Perfect World and Totestra but nothing as bad as described. I suspect it has to do with those scripts tendency to try to realistically cluster resources. It doesn't bother me, but it did lead me to wonder if the AI can recognize rare resources and value them more, or if they can be taught to. Any thoughts from the mod devs?
 
I've noticed some rarities, of seemingly random resources, on Perfect World and Totestra but nothing as bad as described. I suspect it has to do with those scripts tendency to try to realistically cluster resources. It doesn't bother me, but it did lead me to wonder if the AI can recognize rare resources and value them more, or if they can be taught to. Any thoughts from the mod devs?

That logic has been coded into the AI since forever.
 
But unfortunately it isn't tied to mapscripts' resource rates

I'm not sure what you mean. The AI has valued resources more if they are rare, and less if they are common, since 2010/2011. I wrote the code myself, ages ago during the Better AI years. It doesn't matter what mapscript you use, the AI judges resource value based on the amount available on the given map, which is independent of mapscript. Why would you want it tied to mapscripts? That would be horrible.

Edit: Check out the dates on the code comment. Ancient stuff. As I said, AI always took into account resource scarcity.

AI code:
Spoiler :
Code:
/************************************************************************************************/
/* Afforess                       Start          01/18/10                                               */
/*                                                                                              */
/*                                                                                              */
/************************************************************************************************/
                        //Resource scarcity. If there are only limited quantities of this resource, treasure it.
                        if ( !bJustNonTradeBuildings )
                        {
                                PROFILE("CvPlayerAI::AI_baseBonusVal::recalculate Bonus Scarcity");
                                int iTotalBonusCount = 0;
                                for (int iI = 0; iI < MAX_PLAYERS; iI++)
                                {
                                        if (GET_PLAYER((PlayerTypes)iI).isAlive())
                                        {
                                                if (GET_TEAM(getTeam()).isHasMet((GET_PLAYER((PlayerTypes)iI).getTeam())))
                                                {
                                                        iTotalBonusCount += GET_PLAYER((PlayerTypes)iI).getNumAvailableBonuses(eBonus);
                                                }
                                        }
                                }
                                iTempValue = getNumAvailableBonuses(eBonus) * 300;
                                iTempValue /= std::max(1, iTotalBonusCount);
                                iTempValue += GC.getBonusInfo(eBonus).getAIObjective() * 10;

                                iValue += iTempValue;
                                iTradeValue += iTempValue;
                        }
                        
/************************************************************************************************/
/* Afforess                          END                                                            */
/************************************************************************************************/
 
That logic has been coded into the AI since forever.

Alright, thanks for the answer, I'd always wondered about it. Does that affect the effort that they will put into acquiring it via settling and conquest, or just trade value?
 
Alright, thanks for the answer, I'd always wondered about it. Does that affect the effort that they will put into acquiring it via settling and conquest, or just trade value?

The bonus value affects a lot of things, including settlement location values.
 
Just curious, the value seems to increase based on copies of the bonus I have.
If I have 10 bananas and 2 cows, shouldn't I value cow more instead?
 
Just curious, the value seems to increase based on copies of the bonus I have.
If I have 10 bananas and 2 cows, shouldn't I value cow more instead?

I'm not sure where you are seeing that behavior. The code specifically does not do that, specifically here:

Code:
iTempValue = getNumAvailableBonuses(eBonus) * 300;
iTempValue /= std::max(1, iTotalBonusCount);

Say you have 10 bananas, and there are 20 bananas in the world. You will value bananas at 50% because you have half of them. If you have 19 of the 20, you'd value bananas at 5%. getNumAvailableBonuses is the number of the resource *you* have. iTotalBonusCount is the number in the known world. iTotalBonusCount will always be equal to, or greater than getNumAvailableBonuses.
 
Isn't case 2 valued at 95% rather than 5%?
It is number I owned, divide by total known world
 
You may also consider it is possible that copies of same resource may be more than number of players, which become redundant unless corporation available.

Say, if I have 30 cows and 500 pigs, but there are only 3 players in the game, I probably won't value either more for trade, since the max I can trade away is 2 each.
 
Top Bottom