DLL - Unified Yields

The CP already has a plotyieldchanges table for buildings and policies, if that helps. :) (I'm sure you already knew this.)
G

I did :) I've decided to pick off the standard secondary tables first - hopefully any new tables we've added work for all six core yields anyway - if not I'll be sending a bug report your way ;)
 
I know I'm talking with the big league here, but is there something I can do to help with this without any knowledge in C++? I mean, with a bit of guidance can I be of some use? It seems to be brute work from my (tainted) perspective; basically ordering tables and seeing how they react?

JFD did most of the brute work last night (or morning his time!), but yes, any help appreciated.

At the moment I'm filling in holes - "does this yield work in this table", eg YIELD_CULTURE in the Unit_YieldFromKills table. The hole can be filled in in one of three ways. If it's used in the game code xml files it gets an "xml" entry. If I check it through the code base (which takes a long time - as I have to be very careful when following spaghetti) it gets a "code" entry. If someone actually tests it in game it gets a "test" entry

I've updated the spreadsheet (see post #2) to include all of JFDs additions. I'll copy them as tables into post #2 later.

Once I know where the gaps are, someone will have to "code them in" (which will probably be me) - at which point it'll get an "impl" entry. These then need people to test them in game (and swap them to a "test" entry)

Hope that makes sense

W
 
I wasn't certain whether local [food/production] yields should be considered N/A for this [unit] table, so I left them blank

I think they should be n/a

Ignoring the morality of "food from kills", which city would you give the food to? The nearest, the capital, the one starving, the one with the least pop, the most pop???

Production from kills seems to be more of a "%chance of making vanquished unit a worker (slave)"

(Both of the above can be handled by Lua as there is a PreKill event in the DLL.)
 
Unit_YieldFromKills - really surprised Culture didn't work

There's nothing in the code to indicate that it won't. And if it doesn't the trait shouldn't work either. Very odd.
 
There's nothing in the code to indicate that it won't. And if it doesn't the trait shouldn't work either. Very odd.

Sorry, you're right. I retested it and it does work - not sure what happened the first time (maybe too many yields from kills at once, as the only difference between now and then is I didn't test every yield at once). Nonetheless, I've updated the table.

I also retested Improvement_FreshWaterYields, but still nothing.
 
Food from kills could be not cannibalism but captured populations (similarly poor morally of course). CEP used a system that distributed food from maritime CS as a flat amount of food spread evenly* over all your cities (rather than a set amount of food for each city), I could see using that method for food from kills, if someone wanted to go that route.

Obviously culture, faith, science, gold or golden age points are much simpler. But the option might be attractive.

*There were some adjustments for preferring the yields go to the capital and to avoid cities in "avoid growth" mod.
 
Obviously culture, faith, science, gold or golden age points are much simpler. But the option might be attractive.

Speaking of which, the table should've really be done as a promotion. Easy enough to replicate in Lua with this DLL, so not worth the trouble of making a new table devoted to it, I expect. But it seems like a more sensible thing Firaxis should've done.
 
But it seems like a more sensible thing Firaxis should've done.

If I could find the end of that particular list, I'd add it ;)
 
I'm going to spend a few hours on some of the smaller tables, and then do a build of my dll for testing as much as I have done by then
 
Improvement_PrereqNatureYields - Not sure what this is supposed to do, but it didn't seem to do anything.

It's tied to being able to construct an improvement on a tile or not

Code:
CvPlot::canHaveImprovement()

for (iI = 0; iI < NUM_YIELD_TYPES; ++iI) {
  if (calculateNatureYield(((YieldTypes)iI), eTeam) < pkImprovementInfo->GetPrereqNatureYield(iI)) {
    return false;
  }
}

So if forests have +2 production, plains have +0 production and tundra has -1 production, a forest on plains would be +2 production, whereas on tundra it would be +1 production.

If you then add Improvement_PrereqNatureYields(IMPROVEMENT_LUMBERMILL, YIELD_PRODUCTION, 2) you wouldn't be able to build lumber mills on tundra forests
 
Improvement_YieldPerEra - IIRC, this is hardcoded in some way (to Landmarks, to being built over Archaeological Digs, I'm not sure)

That's what it's used for, but it's not hard-coded to landmarks, it just needs an archaeological record for the plot - so only landmarks in the standard game.

BUT, I've already added the Lua API to add archaeological records to plots
Code:
pPlot:AddArchaeologicalRecord(iArtifactClass, iEra, iPlayer1, iPlayer2)
so mods should be able to use this as they want to produce some funky effects

For Improvement_YieldPerEra to work, the plot must be owned and the difference between the owners current era and that of the plot's record is used to boost the yield from the plot.
 
Post #2 updated with the tables for Beliefs, Features, Improvements, Processes, Resources, Routes, Terrains and Units. (Which just leaves Buildings, Policies and Traits)

V54a of my DLL can be downloaded here

At the very least all of the "impl" entries need testing.

In an ideal world all of the "code" entries would also be tested - but that may be unrealistic. Faith and Culture are handled in the code as special cases, while the other four are handled the same way, so you can possibly get away with testing faith, culture and a random one of the other four.
 
Yields from Beliefs

(See also)

Culture Faith Food Gold Production Science
Belief_BuildingClassYieldChanges xml xml xml xml xml xml
Belief_CityYieldChanges test test test test xml test
Belief_HolyCityYieldChanges test test test test test impl
Belief_FeatureYieldChanges xml test test test test test
Belief_ImprovementYieldChanges xml xml xml test xml test
Belief_MaxYieldModifierPerFollower code code test test xml test
Belief_ResourceYieldChanges xml xml xml test test test
Belief_TerrainYieldChanges test xml test test test test
Belief_YieldChangeAnySpecialist test test test test xml test
Belief_YieldChangePerForeignCity test xml n/a test n/a impl
Belief_YieldChangePerXForeignFollowers xml test n/a test n/a impl
Belief_YieldChangeTradeRoute test test test test test xml
Belief_YieldChangeNaturalWonder test xml test test test test
Belief_YieldChangeWorldWonder test xml test test test test
Belief_YieldModifierNaturalWonder code code code code code code

Mostly just Science did not seem to work, nor the YieldModifierNaturalWonder table, nor culture and faith for Belief_MaxYieldModifierPerFollower.
 
Beliefs
Mostly just Science did not seem to work, nor the YieldModifierNaturalWonder table, nor culture and faith for Belief_MaxYieldModifierPerFollower.

Is this from the standard game or with V54a linked above?

Either way, many thanks for doing this
 
Some of the "code" entries that didn't work don't surprise me (as I found late last night that the method they're used in never gets called!) Science not working (the three "impl") is a bit odd. Oh well 8/10 must try harder ;)

Edit: Just done the maths - there are a total of 456 entries, 350 are now "xml", "test" or "n/a", leaving 106 to check. Of those 106 I still need to code 12 (all in the buildings table for faith and culture)
 
Back
Top Bottom