-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grain farming expansion and seed adjustments #65924
Conversation
I obey the bot Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Looks cool, in case you haven't noticed though you have a load of usb changes in there too |
Thanks. I must have misclicked when the merge conflict popped up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
JSON & C++ formatters
data/json/recipes/food/corn.json|137|
data/json/recipes/food/corn.json|153|
data/json/recipes/food/corn.json|157|
data/json/recipes/food/corn.json|171|
data/json/recipes/food/corn.json|175|
data/json/recipes/food/corn.json|190|
data/json/recipes/food/corn.json|205|
data/json/recipes/food/corn.json|212|
data/json/recipes/food/corn.json|227|
data/json/recipes/food/corn.json|231|
data/json/recipes/food/corn.json|245|
data/json/recipes/food/corn.json|249|
data/json/recipes/food/corn.json|264|
data/json/recipes/food/corn.json|279|
data/json/recipes/food/corn.json|286|
data/json/recipes/food/corn.json|302|
data/json/recipes/food/corn.json|306|
data/json/recipes/food/corn.json|320|
data/json/recipes/food/corn.json|324|
data/json/recipes/food/corn.json|339|
data/json/recipes/food/corn.json|354|
data/json/recipes/food/corn.json|361|
data/json/recipes/food/corn.json|376|
data/json/recipes/food/corn.json|380|
data/json/recipes/food/corn.json|394|
data/json/recipes/food/corn.json|398|
data/json/recipes/food/corn.json|413|
data/json/recipes/food/corn.json|417|
data/json/recipes/food/corn.json|432|
data/json/recipes/food/corn.json|436|
data/json/recipes/food/corn.json|451|
data/json/recipes/food/corn.json|466|
data/json/recipes/food/corn.json|473|
data/json/recipes/food/dairy_products.json|127|
data/json/recipes/food/dry.json|399|
data/json/recipes/food/dry.json|430|
data/json/recipes/food/dry.json|461|
data/json/recipes/food/dry.json|492|
data/json/recipes/recipe_food.json|9173|
src/iexamine.cpp|2638|
src/iexamine.cpp|2642|
src/iexamine.cpp|3114|
src/iexamine.cpp|3156|
src/iexamine.cpp|3168|
src/iexamine.cpp|3171 col 1|
src/iexamine.cpp|3172 col 1|
src/mapdata.h|841|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
JSON & C++ formatters
data/json/recipes/food/corn.json|438|
data/json/recipes/food/corn.json|453|
data/json/recipes/food/corn.json|460|
data/json/recipes/food/dairy_products.json|127|
data/json/recipes/food/dry.json|399|
data/json/recipes/food/dry.json|430|
data/json/recipes/food/dry.json|461|
data/json/recipes/food/dry.json|492|
data/json/recipes/recipe_food.json|9173|
src/iexamine.cpp|2638|
src/iexamine.cpp|2642|
src/iexamine.cpp|3114|
src/iexamine.cpp|3156|
src/iexamine.cpp|3168|
src/iexamine.cpp|3171 col 1|
src/iexamine.cpp|3172 col 1|
src/mapdata.h|841|
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Clang 10's latest failure doesn't seem related to this PR, which has nothing to do with vehicles. |
@bombasticSlacks Fixed. I was having some trouble with old changes on my fork trying to sneak into this PR and I thought adding the files to gitignore would prevent that from happening. This website is very confusing 😅 |
Summary
Features "Expand grain farming and adjust seeds"
Purpose of change
#64807 and the ensuing discussion outline several issues with farming, specifically that it's a fire-and-forget process with almost no character-side labor time involved. In reality, pre-industrial farming was backbreaking work that demanded enormous man-hours to keep people fed.
Previously, it was possible to plant a few wheat or barley seeds in a matter of minutes and return later in the year to a field which yielded tens of thousands of calories of unspoilable food which required no processing or even cooking. Picking a plot of crops was nearly instantaneous and had no calorie cost. This skipped many important steps in the real-life process and trivialized food acquisition, which especially late in the mid to late game should be an important survival concern.
#49327 identifies farming, base management, and food security as avenues for building out the mid game. While this PR doesn't address any of the concerns specific to growing and tending plants (that's beyond me, codewise) it does try to build a much more robust and accurate simulation of small-scale grain production, which I hope will spur further development in this area.
Lastly, the biggest justification in my mind for complexifying this process is that many players, myself included, enjoy the homesteading aspect of the game. I personally don't see farming as a button you push to receive food, it's fun part of the game in itself, food just happens to be the reward.
Describe the solution
GRAINS HAVE BEEN OVERHAULED
Someone overhauled corn a while back, but the other grains were left undone. I have largely left corn alone and approached the rest of the gains with an eye toward creating parity with corn.
There's presently no difference between these tools, if it cuts grass it'll do the job. Cutting wheat with hand tools seems tricky, but it's a pretty fast process once people get going. I don't know that there's much point in getting more granular than that.
Cut grain can be eaten by cattle mutants immediately, it also works as cattle fodder.
These plants now have the FRESH_GRAIN flag, which allows them to be dried in a stook. A stook is a traditional method for drying grain where you pile cut stalks in a self-supporting A-frame shape which keeps their heads off the ground and away from moisture and vermin. To make a stook, simply build a stooking spot, which has a 10L storage capacity - more than enough for lots of grain, but capped for sanity's sake. Place undried grain stalks on the spot, and examine it. After two weeks, it may be examined again to take it down and receive your dry grain.
It is also possible to use a smoker or any other food dehydrating method to dry your grains. Lentils IRL typically dry on the plant and are harvested without need for further drying. I am aware that in some cases it's possible to let other types of grains dry in the field (a process known as "drying down"). This comes with certain complications, such as the grain rotting, freezing, blowing away, or lodging, but there's no reason it shouldn't be possible under the right conditions. However, our plant code is pretty simplistic, and expanding it to account for things like rainfall, swathing, wind, and temperature are beyond my abilities, so it's out of scope at this time.
Corn cannot currently be stooked even though it's possible IRL. This is because corn is harvested by hand as ears, rather than cut as whole stalks. The best solution to this would probably be to allow the player to choose whether to cut or pick corn while harvesting it, but that's out of scope for this PR. It does seem like it might be useful though.
Dry grain IRL has a shelf life that often gets into the decades if stored properly, and really only risks going bad if it's exposed to moisture or other bad conditions. This isn't something we currently model, so for now you can have fun making a corn fort.
Once you have dried the grain by whatever method you like, you must thresh it. There are currently two methods to thresh grain: A peasant flail; or a cudgel, plank, stick, or wooden club. The flail is much faster as it's a purpose-built tool, the other items are slow but not intolerably so.
Adam Ragusea states that his amateur attempt to thresh what looks like two tiles of wheat without a flail took him about half a day.
Living History Farms states that a 19th century farmer with a flail could do about 420 pounds of wheat per day.
The conclusion I drew was that this is a painstaking process that scales extremely well, and that proper tools really help. Beating a small pile of wheat is not really all that different from beating a large pile of wheat, and the force of your blows is going to be distributed well through even a very large heap. Thus a fit and determined survivor wielding a peasant flail can do 700 stalks of wheat (around 450 pounds) in a 16 hour work day, accounting for weariness and meal breaks.
Threshing grain produces 2 piles of straw per unit of grain, except for lentils, rice, and buckwheat, which only produce 1 due to having either smaller portion size, being smaller plants, or both. Straw can now be crafted into cattle fodder (if you have a lot of it) or eaten by cattle mutants.
Winnowing is a much less laborious process than threshing, though doing it by hand can take longer. The traditional method is to toss it in the air on a windy day and let all the seeds fall to the ground while the chaff blows away. The seeds can also be sifted out or even picked out by hand. There are many many tools that have been used historically for this process, such as pitchforks, paper fans, special baskets, etc., but for sanity's sake I have settled on two recipes - one requires no tools and is slow, the other uses an electric device which blows air to do it much more quickly.
Introducing the BLOW_AIR quality. Currently this includes hair dryers and desk fans, though I'm sure other stuff could be added. These items now take medium batteries, break in water, and have power draws taken from some rough googling and comparison with other appliances.
Winnowing produces 1 pile of chaff per unit of grain. Chaff is a new item which can be made into cattle fodder or bird food (at 50 and 25 units respectively), or eaten by cattle mutants.
Wild rice can't be winnowed, as the hulls stick too tightly to the seed. Instead, it's milled. This was actually the case before this PR and remains unchanged.
The implementation was not at all uniform, but in many cases, dry grains were previously edible with little consequence, which is not true in real life. Humans cannot digest large amounts of dry cellulose, and if we eat more than a tiny amount of the stuff, we will get sick. Uncooked beans tend to contain toxins that can make you very sick or even kill you, and every google result for "can I eat raw rice" or "can I eat raw beans" begs you not to do it. Our ancestors didn't invent cooking and milling for nothing.
All grains must now be cooked or turned into flour before consumption, unless the player is a cattle mutant. If this gets merged, I'll add a way for birds, rats, and mice to eat raw grains and for rabbits to eat straw.
MISC OTHER CHANGES
Seed amounts were pretty arbitrary, and seem to have not been consistently implemented. Now, a "seeds" item generally represents a handful of seeds, enough to sow a roughly 2 meter square area and produce a full harvest in that tile.
Getting seeds from food crops is a little more complicated. Previously you'd just get random seeds out of nowhere when you harvested. This is still true for carrot, garlic, onion, dahlia, cotton, bamboo, spurge, datura, cattail, lettuce, chicory, mustard, burdock, salsify, mugwort, tobacco, dogbane, cabbage, bee balm, broccoli, cannabis, chamomile, wild root, dandelion, wild herb, sunflower, wild garlic, horseradish, decorative plant, groundnut, wild sasparilla, and jerusalem artichoke, but all other plants (notably grains and fruiting crops) now require you to craft seeds out of your produce.
Loose grains and legumes now act as seeds, but are categorized as food. Dried versions of these items can be crafted into seeds, but those seeds can also be crafted back into the food version. This allows a player without access to drying facilities to plant some fresh beans they found, but doesn't screw up sorting zones or NPC work. It also lets you decide that you're going to cook that seed corn instead of eating it, or vice versa.
All other fruits and vegetables will only give seeds if you craft them into seeds. This destroys berry-sized fruits, but larger fruits (cucumber, zucchini, bell pepper, tomato) give you a cut up version which has a much shorter shelf life but otherwise serves in place of the original.
Harvesting previously took 10 seconds and didn't have an activity level. While it would be possible to define harvest difficulty and time in the seed jsons, I've decided that's a lot of fiddly work for questionable benefit and is out of scope for now. Harvesting crops is now light exercise and takes 60 seconds per tile for all crops. This feels generous to the player considering that while picking zucchini would only take a couple of seconds, picking berries can take quite a while, and cutting cane can be extremely strenuous work. Harvesting can still be fobbed off on NPCs via zones, faction camps, or Tacoma.
Oats were for some reason set to only 45 days to grow. This was fixed. I went for a reasonable average for the region (65 days) per this source: https://fieldcropnews.com/2012/07/summer-seeding-oats-for-extra-forage/
Soybeans were kinda weird all over. I've given them a proper drying recipe and made raw edamame the product rather than the byproduct. Edamame can be disassembled to make soybeans, which can then be dried, planted, or cooked. Dried soybeans can be planted, cooked, turned into soy nuts, or milled into wheat-free flour.
Pumpkins no longer have charges. Pumpkin volume and weight were way off. Pumpkins now use the format established by melon and watermelon. A whole pumpkin is inedible, but it can be disassembled into 4 edible and cookable sections with a much shorter rot timer, this also yields a bunch of seeds. This means it's no longer possible to grow 1/3 of a pumpkin.
INEDIBLE flag now properly makes food inedible when it doesn't also have one of CATTLE, BIRD, LUPINE, FELINE.
Describe alternatives you've considered
I would have preferred splitting the seed changes out into a separate PR, but they're tied up with the grain changes, so it's all done at once here.
I have included both craft (into seed) and uncraft recipes for fruits. I can get rid of the uncraft recipes if they're too superfluous, but uncrafting is already how melons and watermelons were handled, as well as nuts and edamame. I'd love to hear feedback on which method would be preferred, or whether both are fine.
Pushed out to future PRs: Threshing and winnowing jobs at the faction camp, making seeds edible for birds, making straw edible for rabbits, product-dependent tool requirements for faction camp farming jobs.
Testing
Testing checklist:
Additional context
https://www.youtube.com/watch?v=_pDTiFkXgEE
closes #65967