Interval/chance update.

- Globally use the same across all veggies
- use a shorter ABM, with lower chance

I don't like the fact that if you have 100 plants, then half of them
will ALL change phase every 90 seconds. It's just very unnatural. By
changing the rate/chance proportionally, plants still grow about as
fast (~1200secs for 90% growth rate to 5 phases), but there will be
less abrupt changes and no massive block updates, just small amounts
at a time. Yes, more ABM's will fire, but that's unlikely a load that
it won't be able to handle.
This commit is contained in:
Auke Kok 2015-04-13 21:01:45 -07:00
parent 5f9a5d7835
commit 318f3815d3
4 changed files with 9 additions and 6 deletions

View File

@ -10,8 +10,8 @@ of the license, or (at your option) any later version.
--]]
local interval = 90
local chance = 2
local interval = crops_interval
local chance = crops_chance
minetest.register_node("crops:corn", {
description = "corn",

View File

@ -10,6 +10,9 @@ of the license, or (at your option) any later version.
--]]
local crops_interval = 30
local crops_chance = 8
dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/melon.lua")
dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/corn.lua")
dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/tomato.lua")

View File

@ -17,8 +17,8 @@ local faces = {
[4] = { x = 0, z = 1, r = 0, o = 2, m = 11 }
}
local interval = 90
local chance = 2
local interval = crops_interval
local chance = crops_chance
minetest.register_node("crops:melon_seed", {
description = "melon seed",

View File

@ -10,8 +10,8 @@ of the license, or (at your option) any later version.
--]]
local interval = 90
local chance = 2
local interval = crops_interval
local chance = crops_chance
minetest.register_node("crops:tomato_seed", {
description = "tomato seed",