Random Generation

Random Generation is not hard to do in flowlab. However, there are a dozen ways to do it, depending on your desired method.

Random Spawning

Random Spawning is done by getting two ranomizer blocks and setting them to the limits in pixels. How do you know the pixel range? For the first randomizer, find the farthest left space you will use and multiply it's coordinates by 32. Next, find the right side and do the same. Put the left side in the minimum number for the first randomizer and the right side's num ber into the maximum. For the second randomizer, put the bottom and top blocks in after multiplying by 32. Put the randomizers into the X and Y of the spawn blocks, where the left to right goes in X and up and down goes to Y. In the spawn block, choose what you want to spawn. When you want to spawn something, make an input go into the "new" for both randomizers and into the "spawn" for the spawn block.

Midpoint Vectoral Spawning

Midpoint Vectors are a little trickier to work with, so here I will explain what they are, then leave a link to a video that explains how to do it. If you need more help than that, go to the posts section of this wiki or the flowlab forum and ask. I will add it here!

Midpoint displacement, also known as Midpoint Vectoral Spawning, is a way to create seemingly natural terrain generation. This is what Terraria as well as Minecraft uses for it's world generator. What it does is it starts at the middle of the map. That spot has a 50% chance of spawning a block 10 blocks above it and a 50% chance of spawning 10 blocks below. Next, it puts a spawner in the middle between either edge of the map. These do the same thing, only this time 9 blocks. This continues on and on until the entire map is generated.

This video is not for flowlab.io, but can be translated into it.

https://www.youtube.com/watch?v=xSX1pN_dQQA&t=682s

Synchronized Map Spawning

Synchronized Map Spawning is where the world generates specialized areas that in turn spawn details for itself. In essence, it spawns random rooms. For example, Dungeon Randomizers use this to spawn random rooms which, in turn, spawn random rooms that are connected to the original room. This is an extremely complex version of the Random Spawning randomizers. Every block that is spawned tests around it for more blocks. If one is missing, the block will spawn one there. The coding would take paragraphs to write in verbal format, so here is a link to a game with this.