How does the random block work?

I understand there are different types of randomness when it comes to computers. Is there a specific way the random block on Flowlab works? The reason I ask is because I have a game based on a 50-50 coin flip. To me, it seems like there are a lot of “streaks.” For example, the coin will land on side 1 many times in a row, and then side 2 will do the same. This could just be me misunderstanding the probability, but shouldn’t long streaks (more than 3 or 4 in a row (EDIT: maybe more like 5 or 6)) be somewhat rare?

Also, here is a bundle with a randomness test I made. It generates a random number every frame, counts the number of tries, and keeps track of the max streaks for 1 and 0.

{"data":{"behavior":{"v":"2","nodes":[{"inputCount":0,"outputCount":0,"name":"Randomness test","behaviorType":"logic.NodeGroup","x":540,"y":832,"group":"","id":"0864ec6c88419e4a","notes":null,"n_o":null,"isMenuItem":false},{"inputCount":0,"outputCount":1,"name":"Always","behaviorType":"logic.triggers.Always","x":90,"y":800,"group":"0864ec6c88419e4a","id":"085b58fe07519b49","notes":null,"n_o":null},{"inputCount":3,"outputCount":1,"name":"Random","behaviorType":"logic.logic.Random","x":450,"y":800,"group":"0864ec6c88419e4a","id":"085b6702de198d4f","notes":null,"n_o":null,"min":0,"max":1},{"gateVal":0,"mode":"equal to","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter","x":630,"y":800,"group":"0864ec6c88419e4a","id":"085b9d6daf58bf47","notes":null,"n_o":null},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":810,"y":992,"group":"0864ec6c88419e4a","id":"085bf6e819f14342","notes":null,"n_o":null,"startVal":1,"tag":"","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":810,"y":800,"group":"0864ec6c88419e4a","id":"085bf7d2154a2f42","notes":null,"n_o":null,"startVal":1,"tag":"","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":990,"y":992,"group":"0864ec6c88419e4a","id":"085c31e3e5679849","notes":null,"n_o":null,"startVal":0,"tag":null,"roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":990,"y":800,"group":"0864ec6c88419e4a","id":"085c32775fc6134d","notes":null,"n_o":null,"startVal":0,"tag":null,"roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":810,"y":1088,"group":"0864ec6c88419e4a","id":"085c62d981c2204e","notes":null,"n_o":null,"startVal":0,"tag":null,"roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":810,"y":896,"group":"0864ec6c88419e4a","id":"085c63e487df4f45","notes":null,"n_o":null,"startVal":0,"tag":null,"roundMode":1},{"gateVal":0,"mode":"greater than","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter","x":1170,"y":992,"group":"0864ec6c88419e4a","id":"085cb130bc3bcb4f","notes":null,"n_o":null},{"gateVal":0,"mode":"greater than","inputCount":2,"outputCount":2,"name":"Filter","behaviorType":"logic.logic.Filter","x":1170,"y":800,"group":"0864ec6c88419e4a","id":"085cb39ce8b9ca4d","notes":null,"n_o":null},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":1350,"y":992,"group":"0864ec6c88419e4a","id":"085cf222b1660347","notes":null,"n_o":null,"startVal":0,"tag":"Max 1 Streak","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":1350,"y":800,"group":"0864ec6c88419e4a","id":"085cf33965c66744","notes":null,"n_o":null,"startVal":0,"tag":"Max 0 Streak","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Number","behaviorType":"logic.logic.Value","x":1350,"y":704,"group":"0864ec6c88419e4a","id":"085f40c4f7b47c49","notes":null,"n_o":null,"startVal":0,"tag":"# of tries","roundMode":1},{"inputCount":3,"outputCount":1,"name":"Switch","behaviorType":"logic.logic.Switch","x":270,"y":800,"group":"0864ec6c88419e4a","id":"0865368310aea048","notes":null,"n_o":null,"_startVal":0,"dataType":2}],"links":[{"input_id":"0865368310aea048i2","output_id":"085b58fe07519b49o0"},{"input_id":"085b9d6daf58bf47i0","output_id":"085b6702de198d4fo0"},{"input_id":"085bf7d2154a2f42i1","output_id":"085b9d6daf58bf47o0"},{"input_id":"085c63e487df4f45i1","output_id":"085b9d6daf58bf47o0"},{"input_id":"085cf222b1660347i1","output_id":"085b9d6daf58bf47o0"},{"input_id":"085cf33965c66744i1","output_id":"085b9d6daf58bf47o1"},{"input_id":"085bf6e819f14342i1","output_id":"085b9d6daf58bf47o1"},{"input_id":"085c62d981c2204ei1","output_id":"085b9d6daf58bf47o1"},{"input_id":"085c31e3e5679849i2","output_id":"085bf6e819f14342o0"},{"input_id":"085c32775fc6134di2","output_id":"085bf7d2154a2f42o0"},{"input_id":"085cb130bc3bcb4fi0","output_id":"085c31e3e5679849o0"},{"input_id":"085cb39ce8b9ca4di0","output_id":"085c32775fc6134do0"},{"input_id":"085c32775fc6134di0","output_id":"085c62d981c2204eo0"},{"input_id":"085c31e3e5679849i0","output_id":"085c63e487df4f45o0"},{"input_id":"085cf222b1660347i0","output_id":"085cb130bc3bcb4fo0"},{"input_id":"085cf33965c66744i0","output_id":"085cb39ce8b9ca4do0"},{"input_id":"085cb130bc3bcb4fi1","output_id":"085cf222b1660347o0"},{"input_id":"085cb39ce8b9ca4di1","output_id":"085cf33965c66744o0"},{"input_id":"085f40c4f7b47c49i2","output_id":"0865368310aea048o0"},{"input_id":"085b6702de198d4fi0","output_id":"0865368310aea048o0"}]}}}

I believe the “streaks” you’re experiencing are just plain coincidence. The randomness block, to my knowledge, just chooses a number from the lowest to highest number you set.

Because your game deals with 2 options, it isn’t too uncommon for it to choose on option multiple times in a row, being as there aren’t that many options to choose from.

2 Likes

I get that, and I definitely could be just imagining things. But it seems to have long streaks more often than I would expect. For example, in a couple hundred tries I get streaks of up to 12 or more. Again, I could just be imagining things. Maybe I’ll have to make a “de-randomizer” to decrease the occurrence of streaks lol

2 Likes

I mean you’re most likely imagining it (no offense XD) but I don’t think you should try to prevent the streaks. That’s just apart of the fun y’know?

None taken lol. I suppose I could leave it, but when my game is only 20 or so flips long, streaks of more than a couple can really tilt it in one player’s favor.

1 Like

That’s a good point. Maybe allow players to go longer, or even choose how long they want to go for?

1 Like

That’s what I was thinking. I didn’t want to have too many rounds for people who wanted a quick-ish game, but allowing them to choose more or less rounds could help.

1 Like

It’s what game developers call set chances. Basically there’s this insanely long number list and every time you do a chance it takes the next number off the list. So for example, the software designer could write “11221111212111” and those would be your next results. It’s not technically random, but it’s as close as you can get in a digital world.

1 Like