-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Improve crop farming. #24291
Improve crop farming. #24291
Conversation
Seems like you're being a bit too generous with the impact of frost: "Corn is killed when temperatures are near 32 F for a few hours, and when temperatures are near 28 F for a few minutes (Carter and Hesterman, 1990). A damaging frost can occur when temperatures are slightly above 32 F and conditions are optimum for rapid heat loss from the leaves to the atmosphere, i.e. clear skies, low humidity, no wind. At temperatures between 32 to 40 F, damage may be quite variable and strongly influenced by small variations in slope or terrain that affect air drainage and thermal radiation, creating small frost pockets." |
It significantly depends on vegetative stages and plant species. Being exposed to cold is deadly for chilli peppers but acceptable for root vegetables. All farming stuff is poorly implemented right now and require complex reworking, this PR is only a part of it. |
Allowing planting at 0°C will result in certain death for most planted plants in early spring without a clear indicator for the player what he did wrong. this seems quite frustrating. |
Any idea how to make this indication? |
Add a separate function, similar to warm_enough_to_plant, that gives the player the option to not plant if the temperature is too cold for safe planting. Alternately, don't drop the safe temperature all the way to 0C but leave it around 5-7 C so the plants can only be planted at temperatures when they're unlikely to die. |
Add a warning to the "select seed" menu if the temperature is below 50F (10C). |
src/iexamine.cpp
Outdated
@@ -1722,7 +1722,7 @@ void iexamine::dirtmound(player &p, const tripoint &examp) | |||
smenu.return_invalid = true; | |||
std::string planing_text = "Use which seed?"; | |||
if( !warm_enough_to_safe_plant() ) { | |||
planing_text = "Use which seed?. Plants can be damaged by cold weather."; | |||
planing_text = "Use which seed?. Plants can be damaged by cold weather."; |
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.
Excessive period after question mark.
Desided to bloat this PR into more complex "Stardew days ahead". |
How will the water value be affected by rain? One could imagine a crop with low water requirement needing no human watering during some seasons. Is consumption of fertilizer, water, and weed growth to be variable (JSON defined) for different crops? |
Rains will provide water, but not enought. Plants must be manually watered to provide best results. |
Maybe this list helps: |
Hmm... I've got crash while gathering harvest, but I cannot reproduce it now when using debugger, so I don't know yet if it is related to your changes. |
I've got this crash too, it was from iexamine::get_harvest_items. But after last changes this crash somehow disappeared. I suppose it was from adding new items with zero count to the std::list item |
It was new world. I hope it would be possible to reproduce it eventually. |
Can reproduce crash by harvesting corns on this save
And minor bugfix - harvesting will provide fruits and seeds only if the plant supposed to do so. |
src/weather.cpp
Outdated
@@ -736,7 +908,9 @@ int get_local_windpower(double windpower, const oter_id &omter, bool sheltered) | |||
} | |||
|
|||
bool warm_enough_to_plant() { | |||
return g->get_temperature( g-> u.pos() ) >= 50; // semi-appropriate temperature for most plants | |||
// It is possible but not recommended to plant at the temperature of the ice melting | |||
return g->get_temperature( g-> u.pos() ) >= 32; |
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.
There is FREEZING_TEMPERATURE
constant in game_constants.h
.
// 30% - (Widely) scattered/chance | ||
// 40% or 50% - Scattered/chance | ||
// 60% or 70% - Numerous/likely | ||
// 80%, 90% or 100% - No additional modifiers (i.e. "showers and thunderstorms") |
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.
Could that be reverse of switching these minuses for different minuses or what?
I mean, there was a recent commit that changed these around, is thi changing them backwards?
Just some github screwup. |
} else { | ||
std::list<item> harvest_items = get_harvest_items( seed ); | ||
proceed_plant_after_harvest( examp ); | ||
for( auto &i : harvest_items ) { |
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.
After some debugging I found what the crash can occur at this block, where new items are added to the map. It occurs only if new perishable items are added (cannot reproduce only with withered plants). Not sure if it is related to new changes, because reloading the game and doing literally the same actions will produce the same list of items (even with the same bday time) and it works fine almost every time.
UPD: I mean the code after line 1844, not before it. Generating the list and removing old plants was fine.
Awesome upgrade, love this idea. Sadly my tiny late-season wheat farm was erased. Along with anything else I had planted. Oh well, at least now where is hope for my dream of an atomic powered hydroponic underground lair. |
This is one of "works as intended" migration bugs. It does not worth effort as long as we have more important problems. Just roleplay locust swarm or create more wheat via debug.
Shrooms will grow undeground even without these gismos. |
RP works for me, my new follower screwed up the fertilization. What do you mean that barrel was full of acid rain? Who keeps a barrel of acid rain? And shrooms were the first thing I planted in my basement. But I gotta have my vitamins. Thanks for the overhaul! |
This reverts commit 6b3eda6.
Reverted this and the follow ups. Incomplete list of problems that need to be fixed to re-merge: |
This, I believe, will be sorted with automatic zones. If that's enough. It means about one keypress, but presence on the field every day, or lower yields, if I understand correctly. |
Ok, I will refactor it in reopen when everything will be ready. Some comments: Weeds - Plant grow is recalculated on every examine action in addition to loading plants into the bubble. But due to a bug every recalculation increased plants age by 1 hour (even if the last check was in the last turn). Such fast grow is barely visible for plants, but is very visible for weed. This behaviour was not intended and was rather simple to fix. Water - Climate generator is brocken and rains are too often (last time I checked it was 2700 mm of rain water during 91 days of summer instead of 300 mm https://en.wikipedia.org/wiki/Climate_of_New_England ) and rain efficiency was reduced 10 times for farming. Default plant consume 0.2L of water per hour, 33.6L per week, 400L per season. Actual water requirements can be found here http://agropedia.iitk.ac.in/content/water-requirement-different-crops. Crop yield - Default crop yield is 10 fruits (can be specified in json for every plant). Most fruits and vegetables weight 0.2 kg, so default harvest (for plant with water and without weeds) is 2 kg. Using fertilizer will increase this yeld to 20 fruits or 4 kg. These numbers are to compare with real world (91 day per season). Lack of water or too much weeds will decrease yield. The result will scale with season length (less for shorter seasons, more for longer). |
You completely disregard the influence of underground water and soil humidity in your calculations. https://nwis.waterdata.usgs.gov/nh/nwis/gwlevels It seems to me that on average you would need to be procupied with water drainage and not with irrigation. Certainly you wouldnt need 15 liters of water per plant weekly. |
Watering from sources within crafting range please. Consider underground cultivation of plants - I plant to grow cole crops by atomic light. With adequate heat and light we should be able to grow pretty much anything there. |
We need more unit tests and testcases. Let the Bot do the hard work. |
These changes will add depth to the farming and add more open air activities.
Each plant will have stats:
Health - determine number of fruits at harvesting.
Water and fertilizer - how much water and fertilizer is available for this plant. They will be consumed every hour and change plant health.
Weeds - will grow and reduce plants stats.
It is recommended to water plants and remove weeds every week.
Common plants (besides root vegetaibles) will not produce seeds, only fruits. Default fruit yields are specified in json. Plants with best health will yield twice more fruits, near dead plants will yield none.
Amount of harvested fruits will scale with season length, because plants will require more care at longer seasons.
New UI (depends on survival skill):
Add new farm mechanics:
comfortable_temperature
json parameter. Air temperature below this point will decrease plants health. Temperature below 23F(-5C) will kill the plant.Seeding UIs (depends on survival skill):
Separate plants into groups with different vegetative stages:
Potatoes will provide seeds in aditions to tubers. Carrots, sugar beets and onions are biennale plants and planting their seeds will provide root vegetables (first year of growth). Planting root vegetables will provide seeds (second year of growth).
All berries will grow into shrubs and provide berries after that. Shrubs will survive winter without damage.
Mushrooms will grow mushroom bed and and provide mushrooms after that. Mushroom bed will survive winter without damage. It will be possible to farm mushrooms undeground.
List of all seed parameters modified by json: