LoneGazebo / Community-Patch-DLL

Community Patch for Civilization V - Brave New World
Other
285 stars 158 forks source link

Technologies overvalued in deals? #11280

Open azum4roll opened 2 weeks ago

azum4roll commented 2 weeks ago

In CvDealAI::GetTechValue(), the base cost of a tech is calculated as follows:

    // BASE COST = (TurnsLeft * 30 * (era ^ 0.7))   -- Ancient Era is 1, Classical Era is 2 because I incremented it
    iItemValue = max(10, iTurnsLeft) * /*30*/ max(100, GC.getGame().getGameSpeedInfo().getTechCostPerTurnMultiplier());
    float fItemMultiplier = (float)(pow( (double) std::max(1, (iTechEra)), (double) /*0.7*/ GD_FLOAT_GET(TECH_COST_ERA_EXPONENT) ) );
    iItemValue = (int)(iItemValue * fItemMultiplier);

It seems the second max on the second line is supposed to be min, or it doesn't make sense.

The first max could also be min, but at the end, are these upper/lower bounds really necessary? Looks like it's better with just iItemValue = iTurnsLeft * /*30 in standard*/ GC.getGame().getGameSpeedInfo().getTechCostPerTurnMultiplier();

azum4roll commented 2 weeks ago
UPDATE GameSpeeds
SET TechCostPerTurnMultiplier = 20
WHERE Type = 'GAMESPEED_QUICK';

UPDATE GameSpeeds
SET TechCostPerTurnMultiplier = 30
WHERE Type = 'GAMESPEED_STANDARD';

UPDATE GameSpeeds
SET TechCostPerTurnMultiplier = 45
WHERE Type = 'GAMESPEED_EPIC';

UPDATE GameSpeeds
SET TechCostPerTurnMultiplier = 90
WHERE Type = 'GAMESPEED_MARATHON';

The numbers for each game speed, for reference. None of them matter as it's always 100 right now.

RecursiveVision commented 2 weeks ago

@axatin

axatin commented 2 weeks ago

I don't play with tech trading on so I don't really have a feeling for which values would be reasonable there, and I never changed anything in that part of the code. Feel free to rework it as you like.

Mwallx commented 1 week ago

In my current run, you can buy a tech which is worth 20k science for just 2-5k gold from AI you made friendship, and you can sell a tech at 10-15k gold to them. I feel like this should at least be the opposite.