Page 1 of 1

Growing wheat underground

PostPosted: Fri Mar 20, 2015 01:33
by LordHawk
I have a question on growing wheat underground. I use the super glow blocks with a light value of 15, and I have water 1 or 2 blocks away from each wheat plant. Before, wheat grew like crazy with these blocks in .4.10. Now they don't really grow at all.

This is what I have noticed. If the block is directly above the wheat (i.e. y+1) the the wheat grows, but if the y value is anything higher, it gets stuck at size 1. I have 1 super glow block per seed. Did something change between version .4.10, .4.11, .4.12 to change this? What else might effect the wheat growth? Is there a setting that changed or one I could have disabled by mistake?

Also, is there a difference between running in server mode and single player modes? If so, is there a setting I can change.

Thank you for any help.

Re: Growing wheat underground

PostPosted: Fri Mar 20, 2015 07:29
by TenPlus1
Growing on singleplayer and standalone is same unless server is running a different farming mod but remember that wheat needs light 14 and over to grow so light need to be placed right beside otherwise it wont be bright enough...

Re: Growing wheat underground

PostPosted: Fri Mar 20, 2015 13:27
by 12Me21
One time I had a farm with a roof made from the transparent ice from moontest. All the plants grew, except one that was directly under a torch.
This led me to believe that plants will not grow if there is anything besides air one block above. Is this true?
Also, it would be nice to be able to tell what the light level was, like either in the F5 menu or as a separate tool.

Re: Growing wheat underground

PostPosted: Fri Mar 20, 2015 14:33
by LordHawk
TenPlus1 wrote:Growing on singleplayer and standalone is same unless server is running a different farming mod but remember that wheat needs light 14 and over to grow so light need to be placed right beside otherwise it wont be bright enough...



Then it has changed because http://wiki.minetest.net/Farming says it requires 13 or above. I also have another area that has cotton and wheat that has not grown. These get sunlight through glass, or obsidian glass, blocks, and they haven't grown since I updated first to .4.11 and then .4.12. Why was it changed? Can it be changed back?

{edit}
I just checked the code for the farming mod for 0.4.10, 0.4.11, 0.4.12. The wiki is right, and they all require minimum light of 13. Something else has changed, and to me it looks like a bug. In one of my examples (the one with sunlight & glass blocks), the only change was version. I copied the worlds over to each one. The wheat and cotton stopped growing at stage 1.

Re: Growing wheat underground

PostPosted: Fri Mar 20, 2015 15:07
by LordHawk
Let me approach this from a different angle. I know something changed in either 0.4.11 or 0.4.12 because what was growing before the version change no longer grows. How is the light level for a node calculated? Everything in the code seems to say that light level 13 is the minimum level.

This is from the farming mod file api.lua:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
if not ll or ll < def.minlight or ll > def.maxlight then
   return
end


and the values of minlight and maxlight are defined in init.lua as:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
farming.register_plant("farming:wheat", {
   ...
   minlight = 13,
   maxlight = default.LIGHT_MAX,
   ...
})


This says that the minimum light level should be 13, and the light level of the super glow glass is 15. It grew/worked before upgrading versions, and now it doesn't grow/work after updating to 0.4.11 and 0.4.12. I also want to add that it doesn't grow it the glow glass is 1 space over but still one node up.

Here is a screenshot of my test area:

Image

I can't figure how to attach the screenshot directly, so here it is as a download:
screenshot_159075711.png
screenshot_159075711.png (408.32 KiB) Viewed 2494 times

Re: Growing wheat underground

PostPosted: Fri Mar 20, 2015 15:36
by 12Me21
if the glass is 2 spaces above:
The inside of the glass is light level 15
The node below it has a light level of 14
The wheat is light level 13.

So apparently the wheat actually needs a light level of 14, so the glass needs to be right next to it.

Re: Growing wheat underground

PostPosted: Fri Mar 20, 2015 16:06
by LordHawk
12Me21 wrote:if the glass is 2 spaces above:
The inside of the glass is light level 15
The node below it has a light level of 14
The wheat is light level 13.

So apparently the wheat actually needs a light level of 14, so the glass needs to be right next to it.


That doesn't make sense compare to what the actual code, or the wiki, says. Also, it used to work.

Re: Growing wheat underground

PostPosted: Fri Mar 20, 2015 17:12
by 12Me21
LordHawk wrote:
12Me21 wrote:if the glass is 2 spaces above:
The inside of the glass is light level 15
The node below it has a light level of 14
The wheat is light level 13.

So apparently the wheat actually needs a light level of 14, so the glass needs to be right next to it.


That doesn't make sense compare to what the actual code, or the wiki, says. Also, it used to work.


hmm... are you sure super glow glass outputs a light level of 15?

Re: Growing wheat underground

PostPosted: Fri Mar 20, 2015 17:38
by LordHawk
hmm... are you sure super glow glass outputs a light level of 15?


Yup. Here is the code from the nodes.lua file from the mode:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
   ["super_glow_glass"] = {
      description = S("Super Glow Glass"),
      drawtype = "glasslike_framed",
      paramtype = "light",
      sunlight_propagates = true,
      light_source = 15,
      groups = {snappy = 2, cracky = 3, oddly_breakable_by_hand = 3},
      sounds = sound_glass,
   },


The "light_source = 15" says that the light source is 15. I still say there is a bug somewhere in this.

Re: Growing wheat underground

PostPosted: Fri Mar 20, 2015 17:41
by 12Me21
where is it detecting the light? maybe the coordinates are offset one block down from the plant.

Re: Growing wheat underground

PostPosted: Fri Mar 20, 2015 17:47
by LordHawk
The cotton/wheat only grows past stage 1 when the super glow glass block is directly about it. If it is above and +1 to cotton/wheat, it stops growing at stage 1. It go from seed to stage 1 and that is it. It didn't originally require the super glow glass block to be the node immediately above the seeds. It appears that the mods have not changed, so it must be something else. It is also weird that the same thing happens with obsidian glass blocks where sunlight can shine. you can not walk if there is not at least 2 block clearance.

Re: Growing wheat underground

PostPosted: Fri Mar 20, 2015 18:06
by 12Me21
This is really weird, I'll have do some lighting tests later

Re: Growing wheat underground

PostPosted: Sat Mar 21, 2015 12:03
by yyt16384
The engine says brightness 15 is reserved for sunlight, so it really should not work.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
inline u8 diminish_light(u8 light)
{
    if(light == 0)
        return 0;
    if(light >= LIGHT_MAX)
        return LIGHT_MAX - 1;

    return light - 1;
}

LIGHT_MAX is 14, so if light=15 you will get 13...

Re: Growing wheat underground

PostPosted: Sat Mar 21, 2015 13:35
by Calinou
You can do this:

Image

Be sure to hide water 1 to 3 blocks below (below the middle glass row is a good place for this).

Re: Growing wheat underground

PostPosted: Thu Apr 02, 2015 12:53
by Hybrid Dog
lf a node uses "light" as paramtype, you maybe are able to find out if a light is sunlight by comparing node.param1 (which can be something between 0 and 256 l think) and the minetest.get_node_light(pos) light.