Understanding ABM chance

Post Reply
User avatar
neko259
Member
Posts: 805
Joined: Sun Jun 19, 2011 06:51

Understanding ABM chance

by neko259 » Post

I don't remember if I asked this already. I try to get ABM working but it' very weird. No matter what chance I set (even 200-300), it always works on every node when I start the game.
s3tuPDfUv2IyvXHzPmE31MQvnWULv1zj

sfan5
Moderator
Posts: 4095
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

Thats a Bug
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
neko259
Member
Posts: 805
Joined: Sun Jun 19, 2011 06:51

by neko259 » Post

Does celeron know that?
s3tuPDfUv2IyvXHzPmE31MQvnWULv1zj

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

that's a bug? It seems right to me.To have an interval you have to have a starting point.

Temperest
Member
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Post

bgsmithjr wrote:that's a bug? It seems right to me.To have an interval you have to have a starting point.
Actually the issue is that ABMs are being run far too often when the server starts.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.

User avatar
neko259
Member
Posts: 805
Joined: Sun Jun 19, 2011 06:51

by neko259 » Post

bgsmithjr wrote:that's a bug? It seems right to me.To have an interval you have to have a starting point.
I complain about chances, not intervals. They are just ignored and I have to add manual randomness to the functions, which is not nice.
s3tuPDfUv2IyvXHzPmE31MQvnWULv1zj

kahrl
Member
Posts: 236
Joined: Fri Sep 02, 2011 07:51
Location: Rös̓̇chenhof

by kahrl » Post

Temperest wrote:
bgsmithjr wrote:that's a bug? It seems right to me.To have an interval you have to have a starting point.
Actually the issue is that ABMs are being run far too often when the server starts.
The reason is that minetest simulates the "lost" time when loading an existing world. Maybe it should be possible to switch this behaviour off with a flag in the ABM definition.

User avatar
celeron55
Administrator
Posts: 533
Joined: Tue Apr 19, 2011 10:10
GitHub: celeron55
IRC: celeron55

by celeron55 » Post

It is intended behaviour that when a MapBlock becomes part of the active area, the time of it not being active while the server has been running is calculated and an estimate is made to roughly trigger as many of the ABMs as would have been triggered during the time. This is preferred behaviour for things like grass growth.

It could be a bug if all of the ABMs are triggered immediately when you shut down the server and start it again. However, this isn't clear based on what you said.

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

You are not taking into consideration how many blocks there are in the game and it cycles through every one.
if there are 600,000 blocks and you put the chance to be 5
1/5 = .2 * 100 = 20 % chance
Roughly 120,000 blocks will have the action happen
Then you just so happen to be surrounded by more than you thought so it looks like more not too mention whether or not it generates them evenly or in clusters.
20% of the blocks will have the action happen. No bug.

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

bgsmithjr wrote:You are not taking into consideration how many blocks there are in the game and it cycles through every one.
if there are 600,000 blocks and you put the chance to be 5
1/5 = .2 * 100 = 20 % chance
Roughly 120,000 blocks will have the action happen
Then you just so happen to be surrounded by more than you thought so it looks like more not too mention whether or not it generates them evenly or in clusters.
20% of the blocks will have the action happen. No bug.
You just blew my mind.

User avatar
neko259
Member
Posts: 805
Joined: Sun Jun 19, 2011 06:51

by neko259 » Post

bgsmithjr wrote:You are not taking into consideration how many blocks there are in the game and it cycles through every one.
if there are 600,000 blocks and you put the chance to be 5
1/5 = .2 * 100 = 20 % chance
Roughly 120,000 blocks will have the action happen
Then you just so happen to be surrounded by more than you thought so it looks like more not too mention whether or not it generates them evenly or in clusters.
20% of the blocks will have the action happen. No bug.
I have 2-3 trees with leaves. Chance is 300. At the server start all of the trees grow infinitely up (to the ABM range), and 100% of leaves turn into blossom. What am I doing wrong?
Last edited by neko259 on Mon Apr 02, 2012 17:54, edited 1 time in total.
s3tuPDfUv2IyvXHzPmE31MQvnWULv1zj

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

lol

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

neko259 wrote:
bgsmithjr wrote:You are not taking into consideration how many blocks there are in the game and it cycles through every one.
if there are 600,000 blocks and you put the chance to be 5
1/5 = .2 * 100 = 20 % chance
Roughly 120,000 blocks will have the action happen
Then you just so happen to be surrounded by more than you thought so it looks like more not too mention whether or not it generates them evenly or in clusters.
20% of the blocks will have the action happen. No bug.
I have 2-3 trees with leaves. Chance is 300. At the server start all of the trees grow infinitely up (to the ABM range), and 100% of leaves turn into blossom. What am I doing wrong?
Sorry for showing off, poster, but what I was supposed to say was that..
Maybe you forgot that hidden blocks also have the code applied.
like for ever dirt you add a grass block, then you would have more blocks than you intended because you only wanted the ones on top.

User avatar
neko259
Member
Posts: 805
Joined: Sun Jun 19, 2011 06:51

by neko259 » Post

Hidden trees? Where?
s3tuPDfUv2IyvXHzPmE31MQvnWULv1zj

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

That's such a point. Explains why mesecons can "error".

User avatar
bgsmithjr
Member
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Post

What?
Is your problem solved, with the post about the game catching up when shut off?

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

Should be that.

I have a easy example:

Say I have this 16 by 16 chunk.

Then say a flower grows.

Then I leave the chunk for TWO MINETEST HOURS.

I load that very chunk again, from what it seems, the chunk now has more flowers.

Minetest does this to ensure abms work (just like a pseudo random nuber generator,) like time has flown there when it has not.

User avatar
neko259
Member
Posts: 805
Joined: Sun Jun 19, 2011 06:51

by neko259 » Post

I still wait for the final answer: when will I be able to get rid of manual chance checks? Now if I remove them, on the server start I get huge lags and ABM working for EVERY block and ruining all it's work.
s3tuPDfUv2IyvXHzPmE31MQvnWULv1zj

Gatharoth
Member
Posts: 196
Joined: Thu Dec 22, 2011 02:54

by Gatharoth » Post

neko259 wrote:I still wait for the final answer: when will I be able to get rid of manual chance checks? Now if I remove them, on the server start I get huge lags and ABM working for EVERY block and ruining all it's work.
You should post a snippet of your code so people can actually look at it and tell you. Because with the information you provide, all anyone can tell you is how they work.

Which everyone keeps repeating over again to you.

User avatar
neko259
Member
Posts: 805
Joined: Sun Jun 19, 2011 06:51

by neko259 » Post

Gatharoth wrote:
neko259 wrote:I still wait for the final answer: when will I be able to get rid of manual chance checks? Now if I remove them, on the server start I get huge lags and ABM working for EVERY block and ruining all it's work.
You should post a snippet of your code so people can actually look at it and tell you. Because with the information you provide, all anyone can tell you is how they work.

Which everyone keeps repeating over again to you.
https://bitbucket.org/neko259/nature

Look into any of the code with growing.
s3tuPDfUv2IyvXHzPmE31MQvnWULv1zj

mauvebic
Member
Posts: 1550
Joined: Fri Jan 27, 2012 11:32

by mauvebic » Post

growing_trees is pretty similar to nature but they dont act the same, maybe that might help?

User avatar
neko259
Member
Posts: 805
Joined: Sun Jun 19, 2011 06:51

by neko259 » Post

Fixed in the latest git version.
s3tuPDfUv2IyvXHzPmE31MQvnWULv1zj

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 29 guests