This seems logical at first glance, but leaves out some important factors.
Currently, all units working in a city consume 2 food per turn. This means, the value of any yield "produced" by these units should be set into relation to the food consumption.
This becomes especially clear when looking at the two most problematic production lines (talking about RaR here):
1) Ore
Ore is needed for producing tools. Tools are needed for constructing buildings, yields like cannons, muskets and blades and for producing units like ships (in combination with other yields).
Unfortunately, 1 ore = 1 tool = 1 cannon/musket/blade; regardless of the "demand" you have at any given point of time and regardless of the price for any of these yields.
(Not to mention the reality factor: it is completely unlogical to have to need as much ore for a blade than for a cannon)
In short, the total ore - tools - weapons line is completely broken, if you ask me.
2) Coloured cloth
Let us assume that each unit/profession combination in this line will produce 3 yields per turn.
For coloured cloth you need to produce cotton (current sales value 5 - any "current sales value" taken from an actual game) and indigo (current sales value 5). From the cotton you produce cloth (current sales value 11) and the coloured cloth is produced from cotton and indigo (current sales value 20).
And finally you need two production buildings, the weaver's house and the dyer's house.
So, to keep the coloured cloth's production on and going, you need 8 food per turn, you have to have the buildings and you will get a final result of 3 * 20 gold = 60 gold.
Do the math and you will see that you will get
7.5 gold per food unit consumed.
Now, the assumed cotton planter will produce 3 units of cotton (
15 gold) for 2 food units.
He is as "productive" (in terms of income) as the dyer.
But the yield "Coloured Cloth" will inevitably be valued higher than cotton.
But investigating a bit further, you will see that currently cloth will deliver a value of
8.25/food, yet the sales price still is much lower than for coloured cloth.
Conclusion of 1) and 2):
As far as I see it, the problem has to be adressed in multiple ways:
First, a new setup of the market prices has to be done (rather easy in terms of doing it as we "only" have to change some XML values).
Second, the ratios between ingoing and outgoing yields have to be readjusted (once again, this is rather easy from the technical point of view since this can be done via XML, too - although there might be the need or at least the desire to add some new functionality).
Third, the AI has to enhanced in such way that it can compare the value/food ratio for any yield in the whole production line, as only this can lead to meaningful comparisons.
But we're still not at the end.
Let us assume something like this:
R(10) ---- M1(3) ---- M2(5) ---- P ----- E
where
R = the city which delivers a certain raw yield (R)
M1 = a city consuming 3 R and producing 3 M1
M2 = a city consuming 5 R and producing 5 M2
P = the main port city, storing any surplus R, M1, M2
E = Europe, consuming any surplus R, M1, M2
Now, what is the value of R?
For any "normal" yield, at first glance it seems to be quantity times sales price.
Yet, the picture completely changes when assuming that R is needed for something to be produced in M1/M2 (which would be the case for food, lumber, ore, stone, maybe even silver) as raw materials (there are a lot of other things to be taken into consideration, but I want to keep it short).
Now we have to calculate the value of any
missing quantity of R in any of our cities.
And we have to set this in relation to the time needed until completion of the item needing R (think of a building needing 10 turns of "production": at turn 1, R may be missing without causing any problem. At turn 10, R missing leads to a stopped production or to the need of buying R).
Worse it becomes in the case of education (which opens just another can of worms): missing yields to be equipped to your units cannot be bought - you simply cannot assign the respective profession to the unit which may cause the loss of x turns of education time).
The solution I have in mind for solving this is to evaluate any missing yield in a given city by the following formula:
IDV ("internal demand value") = RC ("replacement cost") * Q (quantity) * T ("turns of unsatisfied demand")
Say, we need a quantity of 30 costing 10 each as a replacement in 10 turns from now on. In addition, we will have a delivery of 10 in turn 3 and a delivery of 15 in turn 5.
T1: IDV = 10 (RC) * 30 (Q) * 1 (T) = 300
T2: IDV = 10 (RC) * 30 (Q) * 2 (T) = 600
T3: IDV = 10 (RC) * 20 (Q) * 3 (T) = 600 - delivery of 10
T4: IDV = 10 (RC) * 20 (Q) * 4 (T) = 800
T5: IDV = 10 (RC) * 5 (Q) * 5 (T) = 250 - delivery of 15
T6: IDV = 10 (RC) * 5 (Q) * 6 (T) = 300
As you can see the result (to be stored in a vector for each missing yield/city combination) will change from turn to turn, giving us some kind of approximation of the relative value of that yield in said city.
The closer we get to the turn in which the yield is really needed, the higher the relative value will get (RC * T), giving us a good chance to compare the "demand" (Q) of said yield in all of our cities at any given point of time.
The calculation by itself is rather easy and not very time consuming, neither for IDV nor for the comparison between the limited number of cities we may have at any given point of time.