# Automap theory

Very long and very complicated explanation below. Don’t bother reading unless you fully understand advanced flowlab mechanics.

I was about to fall asleep when I had one of those can’t fall asleep thinking ideas.

So let’s make a square, it can only move on the grid. Make a filter to check if it moves left and right 3, minus in reverse, same with up and down.

Now we have a grid moving block that counts its position in chunks of 3, making a chunk map.

Have a black box on game layer follow the player with adjusted coordinates to stay at the top corner of the screen. This is the map box.

Have a mini square spawn in the center of the map box on player spawn. When you move 3 spaces, the spawned mini square moves the opposite direction in pixels compared to the size of the mini square while still gridlocked based on the player position using an equation.

If there is no block spawned in the center of the map square, a new mini square spawns. As you move around aimlessly as the player, every 3 grid chunks you move, the mini squares on the map space move the opposite direction in pixels, and a new mini square spawns in the center of the map space if there isnt one there.

You are now drawing map lines.

Set the mini squares to have raycasting, and play an animation based on raycast to other blocks, for example,

if there is one mini square, it plays []
If there are 2 mini squares then [
]
If one above then
?]

L
_]

Well I’m sure you get the idea, instead of
[]
[
][_]

Animations play based on removed edges that raycast detects in 4 directions. It gives the map a nicer open feel instead of squares.

So essentially the idea is that map chunks spawn in the map area when the player moves 3 grid spaces (or 5 or however many you want) and move the opposite direction by pixels equation relative to the pixels the player is at, and how do you make the map mini squares not cover the game level? Well, proximity to the map square = 100% opacity, otherwise nor 0% opacity if the mini squares float off of the map square. You can draw any shape map you want without a level built, but if you have a level in your game, the mini squares can only spawn where the player can go, so if there are walls, you’ll see it in the mini map. You can set the mini map on the highest layer, and have a pause menu opacity 100 a black screen behind the mini squares and have them 100 opacity when paused, so you can see the whole map when paused if you make a super complicated scroll and reset on unpause feature to view the map on the menu.

If you have any clue what I’m talking about, test it. If not, don’t worry, I’ll test it out myself when I have time. If it works, I’ll have a metroid room camera and metroid map drawing system concept both in just 2 days of testing.

Crazy ideas come when you take long breaks.
Sometimes the craziest ideas are just before you sleep or in the shower. Brainstorming isn’t always as effective as relaxed daydreaming.

Interesting

I have a feeling that this concept can work. I would like to try but I don’t have any much time left, already had things scheduled.

## Another idea that I had for automap with chunks was: Creating various rooms and hallways. Then in the level starts it puts the chunks randomly and creates kinda a dungeon/maze thing. I just gave up because of the time I would take to build everything for a thing I would use once. I could also do a system that creates various rooms but they would have to be very small.

“Sometimes the craziest ideas are just before you sleep or in the shower. Brainstorming isn’t always as effective as relaxed daydreaming.”

Really true.

@PixelPizza

I have an idea for a level generator as well. Basically you place down a single block and it spawns either air blocks or walls in 4 directions. If a wall block raycasts a wall block next to it, it won’t spawn one on that grid spot again, but can random a chance to erase the block next to it instead by spawning a delete block that deletes itself after 1 second and the wall block deletes on proximity to the delete block spawned on top. This makes random tunnels. If the generator spawns a platform block, it will random a 1, 3, or 5 length platform block that spawns 1, 3, or 5 delete blocks above, below, and to the side. This would create an infinitely generating cave map and can have enemies spawn as well. The wall blocks will play an animation based on raycast if it is an edge block or not. I have no idea how big of a level flowlab can handle, but surely it will eventually crash, so there should be a GUI block that after a few minutes sends out repeating commands to spawn blocks to stop generating and then only generate once more when in proximity to the player.

I had this idea while laying down at the gym taking a break.

I just remembered that raycast does not detect blocks that aren’t solid and can’t see through other blocks, and obviously you wouldn’t want your map blocks or air blocks to be solid, so I can’t do these either.

oh interesting.

about raycast: We could simply make the air block go invisible and not enable once the room is finished building.