[WIP] Some map generation stuff
Hi guys, it's been a little while since I've posted here, but I thought I'd show you all what I've been working on!
I've got a metroidvania concept I've been working on in my spare time which I'd like to finish at some point. I thought it would be neat to try and generate an island style map which can be explored from a 2d perspective. the real gameplay is virtually non-existent at this point, but here is how the map generation looks.
When the game starts, a random map is generated from several levels of perlin data. in order to keep it from spilling off the side of the map, a kind of radial "mask" is applied to all the values to keep it sort of circular.



Each little pixel represents a level. for testing sake, you can choose one by clicking on it at the moment

once you've entered an area, a 9x9 array of smaller sub-levels is generated (think of it like the gulag maps you used to get in oddworld)
from this screenshot it looks like you go up and down, but it's better to think of each row as being behind the row below it. the up and down arrows show where the door below it takes you. each of these 'level plans' are also generated for each pixel, and will have exits and entrances into the adjacent blocks on the island map. In this example you can only go up and down though, because there is terrain you can't travel through on either side, like sea or something to that effect.

There are problems with this at the moment of course, like that you would be sort of screwed if you spawned on a 1x1 pixel island away from the mainland, but I'm going to work it out as I go. I'd like to be able to split the island into clickable 'countries' as well, but that's another whole story. first I want to get something playable
I've got a metroidvania concept I've been working on in my spare time which I'd like to finish at some point. I thought it would be neat to try and generate an island style map which can be explored from a 2d perspective. the real gameplay is virtually non-existent at this point, but here is how the map generation looks.
When the game starts, a random map is generated from several levels of perlin data. in order to keep it from spilling off the side of the map, a kind of radial "mask" is applied to all the values to keep it sort of circular.



Each little pixel represents a level. for testing sake, you can choose one by clicking on it at the moment

once you've entered an area, a 9x9 array of smaller sub-levels is generated (think of it like the gulag maps you used to get in oddworld)
from this screenshot it looks like you go up and down, but it's better to think of each row as being behind the row below it. the up and down arrows show where the door below it takes you. each of these 'level plans' are also generated for each pixel, and will have exits and entrances into the adjacent blocks on the island map. In this example you can only go up and down though, because there is terrain you can't travel through on either side, like sea or something to that effect.

There are problems with this at the moment of course, like that you would be sort of screwed if you spawned on a 1x1 pixel island away from the mainland, but I'm going to work it out as I go. I'd like to be able to split the island into clickable 'countries' as well, but that's another whole story. first I want to get something playable
Comments
All you gotta do is make a button that does something (resets the random, and/or adjust seed parameters, etc)
Have fun! :)
1. Make a list of all co-ords that are land
2. Take the first co-ord and flood fill to find the mass, each thing in this land mass you remove from that initial list
3. Add the list generated from the flood fill to the "found body masses" list, pick a random water square next to a land square and make it a port (you could generate multiple ports even)
4. repeat from 2 until your initial list of all land co-ords are empty.
Keep sharing and keep us up to date :)