[WIP] Some map generation stuff

edited in Projects
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.

imageimageimage

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

image

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.

image

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
Thanked by 2Tuism edg3

Comments

  • Hellooo, good to see this finally go up :) Now put the build up! :)

    All you gotta do is make a button that does something (resets the random, and/or adjust seed parameters, etc)

    Have fun! :)
  • In terms of spawning on a 1x1 pixel island (or any separated body) all you need is a method within your games that allows you to leave those places. You could just take every body of land and add a "port" that you can get to and use (so on a 1x1 body of land you would get to it very easily, but on an island it would be further away. You can make a list of the land masses by the following:

    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 :)
  • Thanks edg3! for pixel islands that are on the list I guess you would instead loop backwards through the list? Also, is there a method for flooding that is widely utilised? I attempted a flood style script once but it ended up lagging too much. should I loop the flooding per pixel?
Sign In or Register to comment.