[Mod] crops [crops] - (Farming|Food|Cooking)
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
All 5 plants now support the hydration model
I made some per-plant tweaks to the scaling:
- corn likes dry soil, soaking damage chances are high
- beans are finicky, doesn't like wet or dry soil
- melons soak up a LOT of water when they grow a melon.
- tomatoes soak up plenty of water when they are in the harvesting phase
- potatoes are probably the easiest crop, don't soak too fast, don't wither fast.
Further notes:
- At all growing steps the plants consume more water
- growing slows down if a plant is soaked or dry
- if a plant becomes damaged, the crop yield shrinks... don't let your crops sit unattended!
- plants near water have it easier
- at night plants don't evaporate and therefore can replenish water themselves a little bit. So watch out that those crops standing near the water edge don't soak, which could happen even without watering.
I made some per-plant tweaks to the scaling:
- corn likes dry soil, soaking damage chances are high
- beans are finicky, doesn't like wet or dry soil
- melons soak up a LOT of water when they grow a melon.
- tomatoes soak up plenty of water when they are in the harvesting phase
- potatoes are probably the easiest crop, don't soak too fast, don't wither fast.
Further notes:
- At all growing steps the plants consume more water
- growing slows down if a plant is soaked or dry
- if a plant becomes damaged, the crop yield shrinks... don't let your crops sit unattended!
- plants near water have it easier
- at night plants don't evaporate and therefore can replenish water themselves a little bit. So watch out that those crops standing near the water edge don't soak, which could happen even without watering.
-
- Member
- Posts: 1482
- Joined: Fri Apr 19, 2013 16:19
- GitHub: twoelk
- IRC: twoelk
- In-game: twoelk
- Location: northern Germany
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
argh
this mod is way to beautiful.
it's consuming my spare time......wait got to water those melons.....
I am allready such a slow builder .... why are those stupid tomatoes not happy? .....
now I have to decide either farmer or builder ... aren't my beans a beauty? ....
hmm, got to dive into technic and pipeworks for some advancedwateringmachinetrickery.
wonder wether I can combine this with Hydroponics or even Aeroponics
... are my potatoes too close to water? ...
this mod is way to beautiful.
it's consuming my spare time......wait got to water those melons.....
I am allready such a slow builder .... why are those stupid tomatoes not happy? .....
now I have to decide either farmer or builder ... aren't my beans a beauty? ....
hmm, got to dive into technic and pipeworks for some advancedwateringmachinetrickery.
wonder wether I can combine this with Hydroponics or even Aeroponics
... are my potatoes too close to water? ...
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
hahahaha, excellent post! :^)twoelk wrote:argh
this mod is way to beautiful.
it's consuming my spare time......wait got to water those melons.....
I am allready such a slow builder .... why are those stupid tomatoes not happy? .....
now I have to decide either farmer or builder ... aren't my beans a beauty? ....
hmm, got to dive into technic and pipeworks for some advancedwateringmachinetrickery.
wonder wether I can combine this with Hydroponics or even Aeroponics
... are my potatoes too close to water? ...
It should be compatible without issues with Hydroponics, but there will not be any interaction with plants and mechanics from Aeroponics(farming_plus), the code doesn't handle unknown plants.
-
- Member
- Posts: 1482
- Joined: Fri Apr 19, 2013 16:19
- GitHub: twoelk
- IRC: twoelk
- In-game: twoelk
- Location: northern Germany
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
oops forgot that mauvebic/peacock lost his code.
I was fiddeling with HybridDog's version as the old original version I had ran into problems and wasn't the last anyways.
I was fiddeling with HybridDog's version as the old original version I had ran into problems and wasn't the last anyways.
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
The growlight will likely work on the plants in "crops", but the hydration system won't work for HybridDog's version. However, the code is mostly setup so that HybridDog could integrate support for the hydration system with a few changes:twoelk wrote:oops forgot that mauvebic/peacock lost his code.
I was fiddeling with HybridDog's version as the old original version I had ran into problems and wasn't the last anyways.
- create a plant.properties table
- register the plants with crops (a table insert)
- calling crops.plant() instead of minetest.set_node()
- calling minetest.swap_node instead of set_node to retain meta values used by the hydration system
- handling crop damage at drops calculation time
some of this could be an easier API, but it's not a lot of code. Obviously the API can be improved with little effort, which I'll likely do myself.
-
- Member
- Posts: 647
- Joined: Thu Feb 21, 2013 23:54
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
No problem. So, a Poisson distribution is useful for modeling how many times a random event with a regular frequency occurs in a given period. For example, if an ABM had a period of 10 seconds and a chance if one in 3, then in 5 minutes it would occur an average of 10 times. A random variable with a Poisson distribution having a parameter (lambda) of 10 would could give you how many times it actually occurred. In fact, we could use the same info above to simply calculate that the average growth period (in the right conditions) is 30 seconds. Whenever you update a plant, you can simply calculate the (possibly fractional) number of periods since the last update, and use that for lambda. Then the growth is basically independent of when the ABM actually runs.sofar wrote:I'm sorry, you lost me entirely...discussion without contributing code only demotivates.
Now of course you probably want to factor in things like light and water. So if you can estimate those things over time, you can use it to determine the amount of "good" growth time that has occurred. For example, you could use minetest.get_node_light() to help determine this, based on the current time of day, the length of the day/night cycle, and the amount of game time that's elapsed since the last update. Then obviously you don't care about more actual growth periods than the maximum number of growth stages of the plant, so this serves as an upper bound (max) on the output of the Poisson distribution.
Code: Select all
local function poisson(lambda, max)
lambda, max = tonumber(lambda), tonumber(max);
if not lambda or not max or lambda <= 0 or max < 1 then return 0; end;
max = floor(max);
local pdf = math.exp(-lambda);
local cdf = pdf;
local u = math.random();
if u < cdf then return 0; end;
for i = 1, max - 1 do
pdf = pdf * lambda / i;
cdf = cdf + pdf;
if u < cdf then return i; end;
end;
return max;
end;
local function potentialGrowth(time, avgPeriod, stagesLeft)
local lambda = time / avgPeriod;
local actualStages = poisson(lambda, stagesLeft);
if actualStages > 0 then realGrowth(actualStages); end;
end;
Last edited by prestidigitator on Wed May 06, 2015 23:13, edited 1 time in total.
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
I'm well aware of what a Poisson distribution is, and where you were going with it. This is also not the code contribution I had in mind.prestidigitator wrote:No problem. So, a Poisson distribution .................sofar wrote:I'm sorry, you lost me entirely...discussion without contributing code only demotivates.
Sorry, I consider the discussion on this topic closed. If you desire, open a github issue request and continue the conversation on this topic there (which I'll gladly do here). We can also talk actual code there, and I'd be happy to open a development branch.
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
Here are some screenshots of the particles when plants are soaking or withering:
Plants soaking:
Plants withering:
Plants soaking:
Plants withering:
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
I'm doing some functionality testing on the current git tree. There were lots of little bugs and missed corner cases. Once this is done I'll do an official tagged release.
Testers welcome and appreciated.
Testers welcome and appreciated.
- Hybrid Dog
- Member
- Posts: 2834
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
usually you can't see water as blue circles and withering doesn't make smoke
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
Sorry, what is your point? Are you suggesting a change? If so, what change do you suggest?Hybrid Dog wrote:usually you can't see water as blue circles and withering doesn't make smoke
-
- Member
- Posts: 1482
- Joined: Fri Apr 19, 2013 16:19
- GitHub: twoelk
- IRC: twoelk
- In-game: twoelk
- Location: northern Germany
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
why not just accept it as signal of what's happening like some manga or comic codeHybrid Dog wrote:usually you can't see water as blue circles and withering doesn't make smoke
- Hybrid Dog
- Member
- Posts: 2834
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
l would like that the soil node which is too wet becomes a node with a mud texture. Particles sadly can't use transparency as far as l know.sofar wrote:Sorry, what is your point? Are you suggesting a change? If so, what change do you suggest?Hybrid Dog wrote:usually you can't see water as blue circles and withering doesn't make smoke
And l think that a withered plant needs to be a different node that it's easier to see the difference to fresh plants. The particles may be insects which are flying around the withered plant.
ln my opinion interpreting these signals may not always be easy because the withering plant still looks fresh.twoelk wrote:why not just accept it as signal of what's happening like some manga or comic codeHybrid Dog wrote:usually you can't see water as blue circles and withering doesn't make smoke
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
Bug infestations are not the same as withering or over-hydration. As a matter of fact, I'm planning to add bug infestations as another source of plant damage.Hybrid Dog wrote:l would like that the soil node which is too wet becomes a node with a mud texture. Particles sadly can't use transparency as far as l know.
And l think that a withered plant needs to be a different node that it's easier to see the difference to fresh plants. The particles may be insects which are flying around the withered plant.
Another damage source would be frostbite/freezing damage.
Particles are a simple way to show a plant is under stress. Having different textures for a plant under stress would cause lots of node updates, and actually introduces a lot of other problems.
e.g night time comes, plants recover a bit from drought, now I have to update all the plants back to normal textures -> lots of node changes, which are complex.
Also, just because a plant is low on water and showing signs of dehydration, it doesn't mean the plant is actually withering (taking damage). The visual clue that a plant is determining a bit of stress through particles is easy to understand. It's also clear that the plant itself isn't dead yet (on the contrary).
There is a dead plant texture for each plant, and that's what the plant turns into if you don't water your plants at all (and have the crops difficulty setting set to "difficult"). That texture means "the plant is dead" and you get nothing back from the plants (no seeds, no potatoes, etc.)
So, for various reasons, I understand that you don't like how this mechanic works because it's not realistic enough, but I'm not convinced that changing it will improve gameplay (not realism) and improve code.
You make a valid point. But, as I said above, if you see the withering particles, it doesn't mean the plant is actually taking damage. It's often just an indicator that damage may happen if the player doesn't act.Hybrid Dog wrote:ln my opinion interpreting these signals may not always be easy because the withering plant still looks fresh.twoelk wrote:why not just accept it as signal of what's happening like some manga or comic code
-
- Member
- Posts: 647
- Joined: Thu Feb 21, 2013 23:54
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
Reviewing the mod code, it appears a bit too hard-coded to benefit much from changes like this anyway. I've submitted a pull request to the "Farming Redo" mod instead. Have a look at that for an example of how this can be done if you like, but otherwise I'm good with your, "discussion is closed."sofar wrote:I'm well aware of what a Poisson distribution is, and where you were going with it. This is also not the code contribution I had in mind.
Sorry, I consider the discussion on this topic closed. If you desire, open a github issue request and continue the conversation on this topic there (which I'll gladly do here). We can also talk actual code there, and I'd be happy to open a development branch.
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
Mostly due to the fact that each plant behaves different - either they're 2-block high plants, the melon's grow sideways, beans require to be planted on beanpoles... yes. The main damage ABM is a single routine, I think it could still be done, but it won't be easy. The farming redo mod patch also makes that clear... it's not trivial code.prestidigitator wrote:Reviewing the mod code, it appears a bit too hard-coded to benefit much from changes like this anyway. I've submitted a pull request to the "Farming Redo" mod instead. Have a look at that for an example of how this can be done if you like, but otherwise I'm good with your, "discussion is closed."
- Hybrid Dog
- Member
- Posts: 2834
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
l just saw that particles use texture alpha. So maybe dark brown semi transparent particles can be used to make the soil node look wet.Hybrid Dog wrote:l would like that the soil node which is too wet becomes a node with a mud texture. Particles sadly can't use transparency as far as l know.sofar wrote:Sorry, what is your point? Are you suggesting a change? If so, what change do you suggest?Hybrid Dog wrote:usually you can't see water as blue circles and withering doesn't make smoke
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
HybridDog just added watercan filling sounds, some code cleanups and the ability to fill the watering can in river water. Thanks HybridDog!
- Hybrid Dog
- Member
- Posts: 2834
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: [WIP][MOD] Crops
How about adding the sort of the watermelon to the description, e.g. "Melitopolski watermelon" and "Tom Watson watermelon"?sofar wrote:Not inclined to do so.Hybrid Dog wrote:May you call the melon "red_watermelon" instead of just "melon" because a lot sorts of melons exist.
If I was designing extra-extra-custom-flavor-plus-plus (you get the idea) crops then I would do so. But I'm designing a very basic set of farm crops.
There's no problem with other crop/farming modules, since you can have several melon mods with identical node names concurrently on the same server.
There's another brighter watermelon viewtopic.php?f=5&t=9019
-
- Member
- Posts: 37
- Joined: Sun Jun 28, 2015 19:20
- In-game: Danny
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
Thanks cool Mod, makes farming more fun and the gardens look much better. ^_^
- swordpaint12
- Member
- Posts: 191
- Joined: Sat Aug 22, 2015 00:50
- In-game: [swordpaint12][Belching_Balladeer]
- Location: Foobass, isle of Atlantis, castle of Bardvendelle
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
I need to try this out.
I have three farming mods so far- farming plus, docfarming and jkfarming.
I wish all three supported your watering model.
It's really interesting!
I'll have to see what I can learn from the code.
:)
I have three farming mods so far- farming plus, docfarming and jkfarming.
I wish all three supported your watering model.
It's really interesting!
I'll have to see what I can learn from the code.
:)
God's not dead; remember that!
Yay for MT! No MC here!
I am a human. I'm younger than 100 years old.
I've been playing Minetest since December 2014.
I'm amazed that I haven't been on here in so long! My latest minetest accomplishment was mining by hand (well, as close as you can get in a computer game) a circle 30 blocks in diameter. It took forever but it's pretty cool.
Yay for MT! No MC here!
I am a human. I'm younger than 100 years old.
I've been playing Minetest since December 2014.
I'm amazed that I haven't been on here in so long! My latest minetest accomplishment was mining by hand (well, as close as you can get in a computer game) a circle 30 blocks in diameter. It took forever but it's pretty cool.
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
Pumpkins!
Since it's almost thanksgiving, here's some pumpkins, and as usual, with a twist. In itself the pumpkins behave like you expect - digging them yields a block, not slices. You can get seeds from a block, or cook a block into roast pumpkin, which is edible.
The catch is that there's only one piece of food from a pumpkin so it's a lot of work. And if you want to expand your pumpkin farm, you'll have to water as otherwise the plants die and will not spawn more than 1 pumpkin if you're unlucky, so it's going to be difficult and labor intensive to grow a large pumpkin farm.
So yeah, maybe just grow pumpkins once a year for some holiday cheer, like some countries do, and then back to taters, cuz they easy.
Since it's almost thanksgiving, here's some pumpkins, and as usual, with a twist. In itself the pumpkins behave like you expect - digging them yields a block, not slices. You can get seeds from a block, or cook a block into roast pumpkin, which is edible.
The catch is that there's only one piece of food from a pumpkin so it's a lot of work. And if you want to expand your pumpkin farm, you'll have to water as otherwise the plants die and will not spawn more than 1 pumpkin if you're unlucky, so it's going to be difficult and labor intensive to grow a large pumpkin farm.
So yeah, maybe just grow pumpkins once a year for some holiday cheer, like some countries do, and then back to taters, cuz they easy.
- Hybrid Dog
- Member
- Posts: 2834
- Joined: Thu Nov 01, 2012 12:46
- GitHub: HybridDog
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
May you add a specific sort of the pumpkin's name?
l'm using the farming_plus mod which also adds a pumpkin and l would like to be able to get a difference between them. Your ones have those dark stripes…
l'm using the farming_plus mod which also adds a pumpkin and l would like to be able to get a difference between them. Your ones have those dark stripes…
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
Added "flies" around dead plants, and fly sounds.
If plants die, they will have little flies buzzing around them, and you can hear a buzzing sound. I'm sure that will make some players itch!
If plants die, they will have little flies buzzing around them, and you can hear a buzzing sound. I'm sure that will make some players itch!
- swordpaint12
- Member
- Posts: 191
- Joined: Sat Aug 22, 2015 00:50
- In-game: [swordpaint12][Belching_Balladeer]
- Location: Foobass, isle of Atlantis, castle of Bardvendelle
Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)
Noooo! I don't know where to get a bugspray mod! How will I cope with those flies?
God's not dead; remember that!
Yay for MT! No MC here!
I am a human. I'm younger than 100 years old.
I've been playing Minetest since December 2014.
I'm amazed that I haven't been on here in so long! My latest minetest accomplishment was mining by hand (well, as close as you can get in a computer game) a circle 30 blocks in diameter. It took forever but it's pretty cool.
Yay for MT! No MC here!
I am a human. I'm younger than 100 years old.
I've been playing Minetest since December 2014.
I'm amazed that I haven't been on here in so long! My latest minetest accomplishment was mining by hand (well, as close as you can get in a computer game) a circle 30 blocks in diameter. It took forever but it's pretty cool.
Who is online
Users browsing this forum: No registered users and 17 guests