[Mod] Farming Redo [1.49] [farming]

soeren06
Member
Posts: 707
Joined: Fri Jan 03, 2020 15:17
In-game: soeren

Re: [Mod] Farming Redo [1.49] [farming]

by soeren06 » Post

The rhubarb is growing too slowly for me... Can you somehow change the growth time of the rhubarb itself?

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Farming Redo [1.49] [farming]

by TenPlus1 » Post

@ soeren06 - Rhubarb doesn't like bright conditions in real life so it grows between light levels 10 and 12.

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Update:

by TenPlus1 » Post

- Hoe Bomb's remove dry shrub along with flora.

Slightly
Member
Posts: 130
Joined: Sun May 15, 2022 22:29
In-game: Slightly

Re: [Mod] Farming Redo [1.49] [farming]

by Slightly » Post

TenPlus1 wrote:
Fri Dec 27, 2024 14:15
@ soeren06 - Rhubarb doesn't like bright conditions in real life so it grows between light levels 10 and 12.
Maybe different species, but where I grow it, it grows in full sun with huge leaves to shade the stalks.

Bastrabun
Member
Posts: 243
Joined: Mon Nov 04, 2019 19:48

Re: [Mod] Farming Redo [1.49] [farming]

by Bastrabun » Post

I asked my mum. She said in dry ground you want the rhubarb in a slightly shady place and in sufficiently wet ground you want it in bright sunlight.
Whatever I say is CC0

Slightly
Member
Posts: 130
Joined: Sun May 15, 2022 22:29
In-game: Slightly

Re: [Mod] Farming Redo [1.49] [farming]

by Slightly » Post

Bastrabun wrote:
Wed Feb 05, 2025 16:11
I asked my mum. She said in dry ground you want the rhubarb in a slightly shady place and in sufficiently wet ground you want it in bright sunlight.
That makes sense. It's not a desert plant.

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Update:

by TenPlus1 » Post

- Add weeds that can appear on tilled soil when not in use.
- Add weed bale that can be crafted from 9x weed.
- Add 'farming_disable_weeds' setting.

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Update:

by TenPlus1 » Post

- Fix bug where api registered crops would grow from seed straight to stage 2.

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Update:

by TenPlus1 » Post

- Tweaked crop drops to something more sensible.
- Replace crop timer Abm with Lbm.

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Update:

by TenPlus1 » Post

- Hoe-bomb removes grass on top of soil.

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Update:

by TenPlus1 » Post

- Increase scarecrow weed protection area to 8 blocks.

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Update:

by TenPlus1 » Post

- Updated Hungarian translation (thx kmarton815)
- Add missing food groups.
- Update Chinese translation (thx maxchen32)

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Update:

by TenPlus1 » Post

- Hoe Bomb uses moveresult.
- Tidy code.

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Update:

by TenPlus1 » Post

- Add water floorbs, craft using 8x buckets of water and 1x gelatin in middle.

Note: It's easier to cook water floorbs in a furnace to produce salt than buckets of water which bug out and you end up loosing the bucket in a furnace.

User avatar
Nininik
Member
Posts: 945
Joined: Thu Apr 06, 2023 01:55
GitHub: nininik0
IRC: nininik
In-game: nininik
Location: CA, Team thunderstrike headquarters
Contact:

Re: [Mod] Farming Redo [1.49] [farming]

by Nininik » Post

I occasionally get a OOM error from farming, what could possibly be the cause and how could it be fixed?
↯Glory to Team Thunderstrike!↯
↯T.T.S.↯

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Farming Redo [1.49] [farming]

by TenPlus1 » Post

@Nininik - Could you list your system specs, Os and version, and which Minetest/Luanti client you are using ?

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Update:

by TenPlus1 » Post

- Added Danish translation (thx jeppebundsgaard)
- Fixed readme links.

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Update:

by TenPlus1 » Post

- Added Polish translation (thx BuszmoPL)

BuszmoPL
New member
Posts: 7
Joined: Fri Aug 29, 2025 09:21
In-game: BuszmoPL

Re: [Mod] Farming Redo [1.49] [farming]

by BuszmoPL » Post

Ty for adding my translation
POLSKA GUROM!

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Update:

by TenPlus1 » Post

- Tweak weed timing and position.
- Increase weed/straw bale burntime.
- Use min/max light globals when nil found.
Last edited by TenPlus1 on Fri Nov 14, 2025 14:33, edited 1 time in total.

Slightly
Member
Posts: 130
Joined: Sun May 15, 2022 22:29
In-game: Slightly

Re: [Mod] Farming Redo [1.49] [farming]

by Slightly » Post

I've been creating some "undergarden" crops for my personal game and, in working on these crops that have to grow in low light, I noticed that the min and max light settings in the crop registrations didn't seem to be used. Except for rhubarb, which also has a setting in the node registrations, all the crops with custom min and max lights in the crop registrations were falling back to the default which, for example, meant that crops that were intended to grow in min_light 7 didn't grow until min_light 12, the default. I documented what I found and my personal fix here:

Code: Select all

--In the init.lua, we see the default farming.min_light level etc set here:

farming = {
	mod = "redo",
	version = "20250717",
	path = core.get_modpath("farming"),
	select = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}},
	select_final = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -2.5/16, 0.5}},
	registered_plants = {},
	min_light = 12, max_light = 15,
	...
}
--In crops like spinach, we see a light level set in the plant registration like this:

farming.registered_plants["farming:spinach"] = {
	crop = "farming:spinach",
	seed = "farming:spinach",
	minlight = 7,
	maxlight = farming.max_light,
	steps = 4
}

--Rhubarb works because it has a light level set in the node registration:

-- crop definition

local def = {
	description = S("Rhubarb") .. S(" Crop"),
	drawtype = "plantlike",
	tiles = {"farming_rhubarb_1.png"},
	paramtype = "light",
	sunlight_propagates = true,
...
	is_ground_content = false,
	sounds = farming.node_sound_leaves_defaults(),
	minlight = 10,
	maxlight = 12
}


--[[
In the init.lua, every time a plant is set to grow, there is a light check in the function farming.plant_growth_timer(pos, elapsed, node_name). That function checks the light at the position of a node by name. If it can't find a light level in the node meta, it falls back to the default:
--]]

	if lambda < 0.1 then return true end

	local MIN_LIGHT = core.registered_nodes[node_name].minlight or farming.min_light
	local MAX_LIGHT = core.registered_nodes[node_name].maxlight or farming.max_light

	if max_growth == 1 or lambda < 2.0 then

--[[
The bug is, at that moment, the node is named something like farming:spinach_1 but that node does not have the setting in its definition (in rhubarb, the setting was also added to the node definitions). The light levels are set in the plant registration, so this function needs to check for the light levels there (or all the crops need to set light levels in the nodes). I fixed mine like this:
--]]

--sc fix for finding plant def name from node
local base_name = node_name:match("^(.-)_%d+$") or node_name
local plant_def = farming.registered_plants[base_name]

--fix for picking up light levels from plant def
local MIN_LIGHT = (plant_def and plant_def.minlight) or core.registered_nodes[node_name].minlight or farming.min_light

local MAX_LIGHT = (plant_def and plant_def.maxlight) or core.registered_nodes[node_name].maxlight or farming.max_light

--[[
The fix strips away the extra extension on the node name, such as _1, _2, etc, then checks the plant def (the code above for spinach) for the light levels. This works in my game. 

I think the same type of bug affects selection box choices but I didn't test and document that one.
--]]

In practical use, most of the time this wouldn't be noticed by players, but it accounts for crops that should grow in low light needing more light than expected.

Undergarden crops: potatos, beets, carrots, onions for underground mobs.
undergarden.png
undergarden.png (380.04 KiB) Viewed 133 times

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Farming Redo [1.49] [farming]

by TenPlus1 » Post

@Slightly - Can you explain what you mean by light settings in crop definition not being used ?

I just tested the minlight and maxlight settings on manually defined crops and farming.register_plant crops and the light settings work fine on both during growth. The crop nodes themselves contain the light settings once defined (which are used for growing) as does the farming.registered_plants entry.

Slightly
Member
Posts: 130
Joined: Sun May 15, 2022 22:29
In-game: Slightly

Re: [Mod] Farming Redo [1.49] [farming]

by Slightly » Post

TenPlus1 wrote:
Fri Nov 14, 2025 14:25
@Slightly - Can you explain what you mean by light settings in crop definition not being used ?

I just tested the minlight and maxlight settings on manually defined crops and farming.register_plant crops and the light settings work fine on both during growth. The crop nodes themselves contain the light settings once defined (which are used for growing) as does the farming.registered_plants entry.
It's been a while since I documented this, so my notes above are more accurate than my memory. When I was making my low light nodes and they weren't growing, my debugging found that the growth function was only reading the default settings, so they'd only grow at those default levels (except rhubarb). So, where I had a crop that had a min_light of 7 in the crop registration, watching the debug msgs and detecting the current light level, I could see that the node that I was watching would not grow at level 11, but would at 12, and that the light setting for the node was reading 12 (default) rather than 7.

The fix I used that made sure it read my settings from my crop registration fixed the issue. I looked at the code and did some quick tests with your most recent release at the time and it seemed to be doing the same thing, but since most of my testing was on my own fork, I may have missed something. If spinach grows for you in light level 8, maybe yours is fine. If players see theirs doesn't, they have this info to try.

User avatar
TenPlus1
Member
Posts: 4222
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Farming Redo [1.49] [farming]

by TenPlus1 » Post

@Slightly - Can you show me your code please so I can see what may be happening.

Slightly
Member
Posts: 130
Joined: Sun May 15, 2022 22:29
In-game: Slightly

Re: [Mod] Farming Redo [1.49] [farming]

by Slightly » Post

Hopefully, this will make clearer what I mean. It's the alleged bug replicated with the latest release [EDIT: Oops, this is using the code I downloaded 10/19_if it's changed since then, let me know and I'll test again.] from contentdb. This is the growth timer with debugging (error type for visibility) to show node (spinach which has a min_level of 7 in the crop def), light settings the code is getting from the node(here it's falling back to default), and the light level that is at that pos.

I just downloaded this from contentdb for this test. [EDIT: Mistake, code's a month old.] Other than this, the code I used to fix it is in the snippet in my first post, so not sure what else I can show. If I planted this in low light, it wouldn't grow because it "thinks" it needs level 12 as you can see here. Hope that helps. Like I said, I might have missed something. I'm a hobbyist at best.
spinachreadasdefaultlightsetting.png
spinachreadasdefaultlightsetting.png (926.91 KiB) Viewed 89 times

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest