[Mod] crops [crops] - (Farming|Food|Cooking)

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [WIP][MOD] Crops

by sofar » Post

TenPlus1 wrote:Sofar: would it be ok if I use your beanpole crop in my Farming Redo mod ?
Yes, as long as you comply with the appropriate licenses, but they're fairly convenient and each crop is a separate file you can literally copy on it's own and keep intact.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [WIP][MOD] Crops

by sofar » Post

Sokomine wrote: Yes, that's a problem. My medieval villages will eventually get traders which will sell these fruits - although that's historically wrong. Guess we have to focus less on historical correctness there and just add those plants which have good textures.

The mod looks very nice. Please also add "farming" to its title so that it may be found when searching for mods of that kind! Please tell me once it's finished so that I might add it to the villages and their build chest. Hope your nodes do follow some naming convention (some mods are very...creative...in that regard :-/).
I added the extra keywords - good suggestion.

I like the idea of villagers/traders offering seeds, that's a great way to introduce new crops to your worlds.

As for naming, I try to be sensible, but please elaborate, until now I've just called my nodes "crops:corn" and the likes. I will also be adding groups where appropriate which hopefully makes integration with other mods a lot easier (group:eatable, group:food_bowl etc.).
Last edited by sofar on Fri Apr 17, 2015 21:42, edited 1 time in total.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [WIP][MOD] Crops (Farming|Food|Cooking)

by sofar » Post

Sokomine asked me "when is this done" in somewhat different words. Here's what I'm expecting right now:

- I'll add cabbage (or some type of greens) a bit later. With 5 crops now I've reached the point that I think I need to focus on edibles, and so

- I'll be adding a few cooking recipes first

- And then next I will be looking at game balance/game play a bit:

* the light level needed to grow plants will be variable

* the ABM interval/chance will become variable

* there will be some way to configure these for the server, maybe through a "difficulty" setting (e.g. "easy", "medium", "hard"

* Pilcrow suggested experimenting with watering / hydration. Some plants will need extra watering, some plants will need less watering. In easy mode the effects will not be noticable, as most plants will grow normally and yield enough food. In medium mode there would be low yield if you don't take care of plants, and in hard mode you'd starve without working your fields. Crops can not just dry out, but also get overwatered (which causes rot).

It'll be somewhat difficult to actually show plant stress in the game. I'm thinking of using particles to display dryness (weaving/smoke type shapes) and/or water dripping (puddles) for overwatering plants.

That's what is on the list right now. Feel free to suggest additions, such as recipe's or gameplay mechanics.

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [WIP][MOD] Crops (Farming|Food|Cooking)

by Sokomine » Post

sofar wrote: I like the idea of villagers/traders offering seeds, that's a great way to introduce new crops to your worlds.
Yes, that's one of the reasons the traders in the original random_buildings mod existed. The new ones will also happily sell seeds and fruits. Getting seeds was a big problem with the original farming_plus, as hitting dirt with a hoe was not the most convincing way of getting them. Now plants spawn in the world - which looks quite well.
sofar wrote: As for naming, I try to be sensible, but please elaborate, until now I've just called my nodes "crops:corn" and the likes. I will also be adding
groups where appropriate which hopefully makes integration with other mods a lot easier (group:eatable, group:food_bowl etc.).
Farms for mg_villages are in general equipped with cotton plants. Those are part of the default game. When farming_plus is installed (or another farming mod), the cotton plats get replaced by other nodes. Depending on the name schem used, that may be more or less tricky. Some tree types (which also get replaced) do not seem to follow any naming convention at all (sometimes they have a _ between treename and leaves/trunk, sometimes an extra wood gets inserted into the name etc.). Just wanted to make sure that this mod will be easy to handle in that regard :-)
A list of my mods can be found here.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [WIP][MOD] Crops (Farming|Food|Cooking)

by sofar » Post

@Sokomine - You'll want to add these nodes for now:
  • crops:corn (made from crops:corn_cob)
    crops:melon_seed (made from crops:melon_slice)
    crops:green_bean_seed (made from crops:green_bean)
    crops:potato_eyes (made from crops:potato)
    crops:tomato_seed (made from crops:tomato)

User avatar
afflatus
Member
Posts: 362
Joined: Tue Apr 01, 2014 19:47
GitHub: 0-afflatus
IRC: afflatus
In-game: afflatus
Location: Avalonia
Contact:

Re: [WIP][MOD] Crops

by afflatus » Post

sofar wrote:So the default game is 16x16, therefore mods should be 16x16 textures by default as well, obviously. Having mods use 32x32 textures makes absolutely no sense (and looks terribly out of place).

It should be easy to make 32x32 textures and include them in your texture pack, though.
Sure I was thinking that way round. When I have time I will backport my mediaeval European veg.
Grailtest is stirring ...

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [WIP][MOD] Crops (Farming|Food|Cooking)

by sofar » Post

I've been out for a few days to a conference, and my main development system's power supply gave the ghost, so no updates in a few days.

Once I get it back up and running I will push some cooking recipes and work on the difficulty scaling.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [WIP][MOD] Crops (Farming|Food|Cooking)

by sofar » Post

sofar wrote:I've been out for a few days to a conference, and my main development system's power supply gave the ghost, so no updates in a few days.

Once I get it back up and running I will push some cooking recipes and work on the difficulty scaling.
Cooking recipe for "vegetable stew" is in, you'll have to craft a clay bowl first (and bake it in a furnace). Then you can create an uncooked stew with the raw vegetables, which then has to cook as well. Restores lots of hearts. The bowl is returned after eating, of course.

I didn't make it hard for the user by returning a "dirty bowl" that has to be washed... ;)

Image

There's also a default config file now that you can use to tune the growth rate, basically.

Enjoy.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by sofar » Post

I've started working on code to support plant health:

- plants will have a "humidity" level, influenced by watering (a watering can), surrounding (nearby water) , and light level (dehumidifies)
- plants can get "soaked" (too wet) or "withered" (too dry), which progressively causes damage. Initially it stifles plant growth and if enough damage is done to the plant, it will bear less or no harvest.
- each plant will have different factors - potatoes can handle wet and dry soil better, tomatoes will need lots of water and are unlikely to get soaked. Beans don't like to get soaked but can't handle droughts well either. You get the idea.
- There will be visual clues when a plant is under duress: Particles will be visible to show that the plant is too dry or too wet.
- A watering can tool allows you to pick up water and add water to a plant. It may be necessary to add water several times to a plant, some plants will only need one application of water. The watering can will hold 10 or so watering units.
- I'm thinking of adding a hydrometer tool that can be used to determine the watering level of a plant. Using the hydrometer on a plant would display the watering level in the charge bar indicator of the tool.
- Also possible in this scheme are: bug infestations, diseases. I guess I also need to make bug spray.

All of this will scale easy-normal-difficult, where "easy" means it doesn't really affect game play, normal means it requires attention, occasionally causing large crop losses, and "difficult" means you will suffer total crop loss unless you really take care of the plants.

Thoughts? I intend to share some code/images later this weekend, but due to the impact on the code I may need a week or so to properly make this scale code-wise.

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by Hybrid Dog » Post

Could you make plants get destroyed if the player walks on them?

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by sofar » Post

Hybrid Dog wrote:Could you make plants get destroyed if the player walks on them?
That would be something I'd enable in the difficult mode. Are you sure you want this for "walking on" and not "jumped on" ?

I do not know whether the proper methods/event exist to make this work consistently, it may not be that easy to implement.

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by Hybrid Dog » Post

sofar wrote:Are you sure you want this for "walking on" and not "jumped on" ?
l thought about both.
sofar wrote:I do not know whether the proper methods/event exist to make this work consistently, it may not be that easy to implement.
you could use globalstep or abm and retrace the path of the player (maybe http://dev.minetest.net/minetest.find_path) if the round position is not the previous round position

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by Sokomine » Post

Hybrid Dog wrote: Could you make plants get destroyed if the player walks on them?
The Mineguild.de server had a mod that caused wheat to be trampled down. I believe it was called paths. I didn't like the mod at all. The paths created didn't look good, so we ended up digging them up and placing dirt again. Trampled down wheat was also very annoying as it offers new ways of griefing on a multiplayer server (in this case, mostly unintentional).
sofar wrote: - I'm thinking of adding a hydrometer tool that can be used to determine the watering level of a plant. Using the hydrometer on a plant would display the watering level in the charge bar indicator of the tool.
Please do so. Else it might get too complicated. There are already plants in farming_plus where the growth stages are very difficult to distinguish due to the textures looking so similar (and no, strawberries don't turn red before they're ripe!).
sofar wrote: - Also possible in this scheme are: bug infestations, diseases. I guess I also need to make bug spray.
A few bugs running around amongst the plants (there's a bugs mod out there) or as an animated texture could indeed be entertaining. Please offer biological alternatives to bug spray as well! Players could build an insect hotel to attract enemies of the plant eaters.
A list of my mods can be found here.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by sofar » Post

Sokomine wrote:
sofar wrote: - I'm thinking of adding a hydrometer tool that can be used to determine the watering level of a plant. Using the hydrometer on a plant would display the watering level in the charge bar indicator of the tool.
Please do so. Else it might get too complicated. There are already plants in farming_plus where the growth stages are very difficult to distinguish due to the textures looking so similar (and no, strawberries don't turn red before they're ripe!).
Mostly done already. Here's a screenshot of how it looks after you use it on a plant that's at 50% humidity level (healthy):
Image
Sokomine wrote:
sofar wrote: - Also possible in this scheme are: bug infestations, diseases. I guess I also need to make bug spray.
A few bugs running around amongst the plants (there's a bugs mod out there) or as an animated texture could indeed be entertaining. Please offer biological alternatives to bug spray as well! Players could build an insect hotel to attract enemies of the plant eaters.
I'd do bugs as particles - flying around the plants, or crawling around on the plant. The benefit of particles is that I do not need to modify the plant textures. This is how I'm doing soaked/withering right now and it looks OK already with little effort and code.

A soaked plant:

Image

A plant that's withering:

Image

I'm gonna take a pass on the plant trampling idea. Not only do I think it'll be more than awkward to implement, the chance for grieving is large, and it's way too much damage to a plant all at once.

The humidity code works really, really slow instead. If you don't water your plants for an hour, most likely you just get a tomato less in the end, and the plant took longer to grow. Even if someone soaks your plant with a watering can, he likely helped it's growth more than hurt.

I'll write some detailed text on the mechanics of watering once I have all the code figured out. It's somewhat impactful and I'm still finalizing the integration into all the crops. Only tomatoes are affected right now, and beans / corn will be more complex as well due to their 2-block high nature.

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by Hybrid Dog » Post

you can support protection for trampling because you know the player

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by sofar » Post

Hybrid Dog wrote:you can support protection for trampling because you know the player
It's literally dead last on the list of things that I would like to see enabled in this mod.

If you'd write a patch or a better "paths" mod, I'm all in for taking your contribution, but it's open source ... I'd rather work on stuff for my sedimentology mod, or even my warps mod first.

Besides, I'm nowhere near done enabling the humidity code for all the plants yet. Plus all the plant stuff needs balancing and tuning (e.g. potatoes are growing way too fast and easy).

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by Hybrid Dog » Post

By default farming only works if a player is waiting there until the plants are grown, else they're just grown a bit every time someone visits the chunk and the plant didn't grow one moment before. l guess you can also earn more cacti if you place 4 next to each other than making the grow interval 4 times faster.

‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

prestidigitator
Member
Posts: 647
Joined: Thu Feb 21, 2013 23:54

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by prestidigitator » Post

Hybrid Dog wrote:By default farming only works if a player is waiting there until the plants are grown, else they're just grown a bit every time someone visits the chunk and the plant didn't grow one moment before. l guess you can also earn more cacti if you place 4 next to each other than making the grow interval 4 times faster.
Yeah. I find this rather annoying, myself. It would be nice if mods like this (and the default farming mod) stored the last ABM execution time (either wall time using os.time() or world time using minetest.get_gametime()) in the node metadata, and did a bulk (statistical or deterministic; don't care) calculation based on the number of intervals since that time.

User avatar
Hybrid Dog
Member
Posts: 2828
Joined: Thu Nov 01, 2012 12:46
GitHub: HybridDog

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by Hybrid Dog » Post


‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪‮
‮‪

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by sofar » Post

prestidigitator wrote:
Hybrid Dog wrote:By default farming only works if a player is waiting there until the plants are grown, else they're just grown a bit every time someone visits the chunk and the plant didn't grow one moment before. l guess you can also earn more cacti if you place 4 next to each other than making the grow interval 4 times faster.
Yeah. I find this rather annoying, myself. It would be nice if mods like this (and the default farming mod) stored the last ABM execution time (either wall time using os.time() or world time using minetest.get_gametime()) in the node metadata, and did a bulk (statistical or deterministic; don't care) calculation based on the number of intervals since that time.
This needs to be solved on a global level, Doing this on a per-mod scale makes little sense. I personally do not think that this is really needed, and it has negative effects too, especially performance wise.

prestidigitator
Member
Posts: 647
Joined: Thu Feb 21, 2013 23:54

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by prestidigitator » Post

sofar wrote:This needs to be solved on a global level, Doing this on a per-mod scale makes little sense. I personally do not think that this is really needed, and it has negative effects too, especially performance wise.
Eh? Why? Load a single metadata value and check the time in each ABM call. That's not much, and actually it would make sense to decrease the rate of ABM execution if a more accurate time model were used. So it could easily be done with the same or possibly even less execution cost.

On the other hand, I CAN buy the argument that it should be done in the main farming mod if this one relies heavily on the API of that mod or something.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by sofar » Post

prestidigitator wrote:
sofar wrote:This needs to be solved on a global level, Doing this on a per-mod scale makes little sense. I personally do not think that this is really needed, and it has negative effects too, especially performance wise.
Eh? Why? Load a single metadata value and check the time in each ABM call. That's not much, and actually it would make sense to decrease the rate of ABM execution if a more accurate time model were used. So it could easily be done with the same or possibly even less execution cost.

On the other hand, I CAN buy the argument that it should be done in the main farming mod if this one relies heavily on the API of that mod or something.
You can't easily recreate the effect of what happens when you miss ABM's, since none of it is logically following strictly the idea that crops grow linearly. I mean, a furnace does exactly cook one piece of something per time unit. But plants grow randomly, they're affected by light, they're affected by nearby water, a player watering, and all these other factors.

None of that can be recreated afterwards. If you would come back 3 weeks after you planted to your farm, then all the crops from this mod would instantly wither and die, or at least end up in their least productive state (e.g. only 1-2 potatoes from a potato crop, normally 3-5) on normal difficulty settings.

Also, my argument was that this shouldn't be solved in the farming mod, it should be done at the global ABM level, otherwise you're just asking for the next farming mod to also solve this problem.

Of course, my sedimentology mod would be really, really interesting if this would be implemented - you most likely won't even recognize your landscape anymore, and millions of blocks would be moved or changed. Neat, but massively degrading the game play I think.

I still don't think that the solution is useful. For a furnace? Sure, it's lineair, it's entirely predictable. For a living thing, that has inherent randomness?

A good way to think of it is to ask yourself if you want chickens in the wild to lay eggs while you were not there. Are you sure you want to see thousands of eggs in the forest?

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by sofar » Post

Three of the crops now require watering: Melons, tomatoes, potatoes.

In the default settings, the plants won't die, but the yield of the plant is reduced and you may end up getting almost no value for the plant (if you neglect it). The watering can is a pretty tough starting recipe, needing iron. The hydrometer isn't really needed, but with the hydrometer watering becomes an easy task, since you can see quite well if a plant is way too dry or too wet.

At night time the plants recover a bit of water. At day time they mostly lose water. Growing costs water! Each growing step costs 10 water. Growing a melon costs 25. The watering can adds 25 water per use to a plant. There's 20 charges in the watering can, so you don't need to refill that often. Of course, plants adjacent to water need less water.

Once I get beans and corn using the hydration system I'll cut a formal release I think.

prestidigitator
Member
Posts: 647
Joined: Thu Feb 21, 2013 23:54

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by prestidigitator » Post

sofar wrote:
prestidigitator wrote:You can't easily recreate the effect of what happens when you miss ABM's, since none of it is logically following strictly the idea that crops grow linearly. I mean, a furnace does exactly cook one piece of something per time unit. But plants grow randomly, they're affected by light, they're affected by nearby water, a player watering, and all these other factors.
Not if there are other environmental factors, perhaps, but if everything is a function of the independent variable of time (which would make sense while a block isn't loaded), it's quite possible. For example, start with a simple Poisson distribution, and then factor in the day/night cycles if you like. Or simply run a number of loops equal to the number of ABM periods that would take place, modified by psuedo-random variables to account for the probability of the ABMs running.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Mod] Crops [Crops] - (Farming|Food|Cooking)

by sofar » Post

prestidigitator wrote:Not if there are other environmental factors, perhaps, but if everything is a function of the independent variable of time (which would make sense while a block isn't loaded), it's quite possible. For example, start with a simple Poisson distribution, and then factor in the day/night cycles if you like. Or simply run a number of loops equal to the number of ABM periods that would take place, modified by psuedo-random variables to account for the probability of the ABMs running.
I'm sorry, you lost me entirely. Do you mind if I focus on the list of items to work on that I posted earlier?

Don't get me wrong, feature requests are good, but dragging on the discussion without contributing code only demotivates.

Post Reply

Who is online

Users browsing this forum: No registered users and 21 guests