Page 1 of 1

Per-mod and global ABM limit

PostPosted: Sun Dec 28, 2014 18:05
by neko259
As my nature mod was very heavy with many of the ABMs on leaves, I introduced a "limited" which disallows my ABMs to be run more than a number of times per time unit. I think this is a useful thing and could be added to minetest engine or at least the ABM API (add some "limit" parameter, that allows mod devs to add their own limit). I think such limit could be configured per server or per mod (if we have some mods that depend on ABMs and will work wrong without them).

I don't know if this is hard to implement, but please consider the idea.

Re: Per-mod and global ABM limit

PostPosted: Sun Dec 28, 2014 19:06
by Krock
I don't know why that would make sense. The leaves must be removed/updated anyway - somewhen.
Just use a higher "chance" variable to spread the load.

Re: Per-mod and global ABM limit

PostPosted: Sun Dec 28, 2014 19:40
by neko259
Krock wrote:I don't know why that would make sense. The leaves must be removed/updated anyway - somewhen.
Just use a higher "chance" variable to spread the load.

Chance is to limit the "in-game speed". This means if I want the trees to grow slowly, I'll lower the chance. But what if I want them to grow fast, but to limit the server load? Then I set a high chance and a limit. If there is only one player on the server and 1-2 trees, they will grow fast. But if there are 900 trees in the ABM area and 100 players, the overall load will be limited. There can be 2 types of limits: just ignore the action if the load is too high or stack the actions to a queue and pop them later, then the load lowers.