About the autogeneration of market value. I can do it that way. Here are the variables, can you come with an interesting formula?
plant.harvestedThing.BaseMarketValue
plant.harvestedThing.IsIngestible (boolean)
plant.harvestYield (count of things)
plant.growDays (0 to many days)
plant.fertilityFactorGrowthRate (0 to 1)
plant.sowMinSkill (0 to 20)
plant.growOptimalGlow (0 to 1)
Those are the most relevant variables. There are some more.
I can give it a shot.
MarketValue = RoundUpToNearestHundredth(BaseMarketValue * UtilityValue) * (harvestYield / growDays) * (SeedsProduced * SeedChance * (1 + ExtraChance)) * (21 - sowMinSkill)
UtilityValue = 1 + (IsColonistIngestible * 0.1) + (IsAnimalIngestible * 0.05) + (craftingRecipesCount * 0.01) + (IsMedicinal * 0.1)
Let's look at an example: potatoes with the spreadsheet provided kindly by gillsminnow in the first comment page and the vanilla game values for growDays. I'll assume BaseMaketValue is equivelant to ProduceValue for this example and that there isn't any crafting recipe that uses potatoes beyond the three meal types (like vodka or something in a mod -- would this be programmatically possible to discover? Ask Ringworld how many crafting recipes exist with [plant] as a possible ingredient?)
First, the Utility Value: 1 + (1 * 0.1) + (1 * 0.05) + (3 * 0.01 ) + (0 * 0.1)
UtilityValue = 1.18
This means that potato seeds are actually 18% more valuable than the BaseMarketValue of potatoes themselves. Now let's use it in the MarketValue calculation:
MarketValue = RoundUp((1.5 * 1.18) * (8 / 4.90) * (1 * 0.58 * (1 + 0.1)) * (21 - 0))
MarketValue = RoundUp(38.71748)
MarketValue = 38.72
So, the final value of potato seeds is 38.72 silver per packet. It's braindead easy to grow, grows fairly quickly, is edible by both animals and people, and can be used in three types of recipes. Not a bad or unfair price for such a useful little plant, I must say.
A few cavats: you'll need to put in some kind of sane minimum value for growDays; obviously, 0 won't cut it. If it has zero grow days, then maybe something like a default of 0.01. That will balloon up the price nicely for such an insane turn around.
I'm clearly making a few assumptions here; mainly that there is a way to tell if a plant is animal ingestible vs colonist ingestible, as well as if it can be used as medicine, a crafting ingredient, and how many of those. I honestly don't know if any of that is possible to get.
As a bonus, let's do the same calculation, but for Devilstrand. I'm assuming Devilstrand has a minimum skill requirement of 10, (but I don't know if that's accurate) and its only use is to make devilstrand fiber.
UtilityValue = 1 + (0 * 0.1) + (0 * 0.05) + (1 * 0.01) + (0 * 0.1)
So the UtilityValue is 1.01, really close to its BaseMarketPrice.
MarketValue = RoundUp((6.4 * 1.01) * (3 / 22.5 ) * (1 * 0.55 * (1 + 0.1)) * (21 - 10))
MarketValue = 5.735722667
MarketValue = 5.74
And here we see that because Devilstrand is hard to grow, takes forever to mature, and has very limited utility it's cheap to get the seeds. The seeds are actually cheaper than the Raw Devilstrand itself! Which makes a lot of sense, considering how much of a hassle to cultivate the plant is -- most people would rather just get the damn Raw Devilstrand and let some other sucker deal with trying to grow the persnickerty plant, so the demand for seeds would be low.
Out of curiosity, what does plant.growOptimalGlow measure? How much light is needed for the plant to grow optimally?