How to seeds?

I’ve done a few PRs now, and I’m pondering adding more seeds/crops for my next. I looked at jokermatt’s farming update, and while I think I’ve got an idea of how this works, I’m not certain enough to begin.

One, it looks like the game gets the identity of the crop the seed is supposed to produce by subtracting “seed_” from the start of the seed’s item ID, and the rest had better match the crop’s item ID. Is this the case?

Two, growth time is part of the seed’s entry and relative to a 91-day season. The game will compress the growth time proportionally for shorter seasons, right? I do think this is the case given that when I tried actually doing some farming in-game, the crops grew really fast–I was playing with 30-day seasons and fertilised the crops.

Three, for crops where the seed is the crop, like beans, is there any support for a crop that can be planted and produces more of itself without a separate seed item, or would the code still require a separate “seed” item? I’m going to guess the answer is the latter, but figured I’d ask.

Four, it looks like adding new crop seeds can be done entirely JSON-side. Am I correct?

Like I say, I’m not sure of the above, but if I’m correct, I can go ahead and see about adding some more crops soon. I’m thinking things like oats and rice, and maybe zucchini and broccoli for the V8-drinkers out there; maybe even beans (might be hard to find “seeds,” since apparently the beans that would grow best in New England, fava beans, aren’t super-common in the United States) and/or soybeans. I’d prefer to keep any necessary recipes simple at this point–all the different potential applications of soybeans could probably be a PR in and of itself–but at least some basic things like processing oats into flour and/or oatmeal would naturally be included.

2 Likes

[quote=“AllisonW, post:1, topic:8802”]Three, for crops where the seed is the crop, like beans, is there any support for a crop that can be planted and produces more of itself without a separate seed item, or would the code still require a separate “seed” item? I’m going to guess the answer is the latter, but figured I’d ask.

Four, it looks like adding new crop seeds can be done entirely JSON-side. Am I correct?[/quote]

You need a seed item for now. Seed implementation is hacky at the moment - it literally just cuts out the first 5 characters (“seed_”) from the seed item id to get the result’s id.

Yes, new crops are handled mostly by JSONs. Just add an item with a SEED tag and “seed_” in id. For example, “seed_broccoli”.
One thing that you can’t set in JSONs is the byproduct - wheat, barley and hops drop straw, sugar beets drop nothing, everything else drops withered plants.

Planting maladapted beans is fine - beans are really good, so it makes sense (from gameplay point of view) for them to require some extra time.
If adding beans, you’ll probably need to add a “beans” item and add it to all recipes (and create a recipe for drying them). There are no fresh beans in the game at the moment.

1 Like

[quote=“Coolthulhu, post:2, topic:8802”][quote=“AllisonW, post:1, topic:8802”]Three, for crops where the seed is the crop, like beans, is there any support for a crop that can be planted and produces more of itself without a separate seed item, or would the code still require a separate “seed” item? I’m going to guess the answer is the latter, but figured I’d ask.

Four, it looks like adding new crop seeds can be done entirely JSON-side. Am I correct?[/quote]

You need a seed item for now. Seed implementation is hacky at the moment - it literally just cuts out the first 5 characters (“seed_”) from the seed item id to get the result’s id.

Yes, new crops are handled mostly by JSONs. Just add an item with a SEED tag and “seed_” in id. For example, “seed_broccoli”.
One thing that you can’t set in JSONs is the byproduct - wheat, barley and hops drop straw, sugar beets drop nothing, everything else drops withered plants.

Planting maladapted beans is fine - beans are really good, so it makes sense (from gameplay point of view) for them to require some extra time.
If adding beans, you’ll probably need to add a “beans” item and add it to all recipes (and create a recipe for drying them). There are no fresh beans in the game at the moment.[/quote]

Thanks for confirming this stuff for me, Coolthulhu.

As for the beans… yeah, I noticed that while editing and testing my last PR. There’s “canned beans” (which displays as “beans”) and “dried beans,” pretty much. In theory I could have bean plants produce the same beans you find in cans, since they apparently do have a functional spoilage timer (48 hours), but the description for it isn’t quite right. As for dehydrating them, I think I’d use a recipe similar to every other dehydrated food, and have it produce the existing “dried beans” item (I’d probably also do this for rice)–think that’s about right?

1 Like

That’s a damn shame, would be great if it used an object in the product’s entry which would state either functional seed, for crops that have it, or the pseudoitem for ones which don’t and are planted as-is, since I remember farmplots using pseudoitem tokens to track what’s planted.

"seed": { "pseudo": true, "seed_name": "seed_potato", "growth_factor": 120 }
And then just have a seed_potato as normal item with descriptions hinting that you’re not supposed to see that.

OK, I’ve got an edit here that adds oats, oat seeds, broccoli seeds, celery seeds, cucumber seeds, seed potatoes, and zucchini seeds. So far, they’re working properly. However, the thing that bugs me is that they only spawn a single unit of the crop they produce. Is this how all crops are supposed to work, or am I just harvesting them too soon?

1 Like

Depends only on your survival skill at harvest.
Bump it to some huge values when testing.

Depends only on your survival skill at harvest.
Bump it to some huge values when testing.[/quote]

Ah ha, thank you! I appreciate the tip. <3

Boiled beans in cans wont sprout. Sorry to necro that thread, researching agriculture mechanisms of C:DDA atm