As a fair amount of you know - I've been working on a small platformer project called Sky High in Game Maker. I do have more I want to add to the game and improve on but for now I've decided to put it on the side to focus on something new! This is for a number of reasons - it was getting to the point where if I wanted to try something new or learn I would probably need to re-write a good bit of code or it just wouldn't fit. One of the things I got inspired into trying out is a random level generator!
Jumping onto this next project - I had ideas and inspiration; but perhaps the most interesting part for me is this project will consist of my work from the very get-go. Whilst I did code ICON and Sky High - I often followed a couple of tutorials for the very beginning to get a foundation and then built my own aspects and modified the foundation to make them what I wanted to. This new project from the off-set - consists of a foundation I am creating myself. I was particularly inspired to test out some random level generation after reading the first couple of chapters of Spelunky by Derek Yu. Spelunky, as there as those of you who know, relies on a random generator for it's levels. Not completely random - but enough to give a wide range of variety. If your interested in that - I do recommend Derek Yu's book! On that note - let me show you what the level generator I have coded yesterday has been able to do.
The generator is fairly simplistic currently. It simply moves tile to tile and depending on how many 'path' tiles touch the tile - it decides whether to put a wall or a path. For a couple of hours work - I found this to be quite promising! The levels look quite similar - this is because currently I set the chance to be quite limited in range - so it's very likely that certain parts may seem similar.
One of the improvements I will be adding is to remove any path tiles surrounded completely by walls. These will be replaced by a wall tile. I am also thinking of a way to make the generator 'walk' through the level and see whether the scale is big enough. Check for example whether the player is able to explore at least 50 tiles - rather than being stuck in a corner with only 2 tiles. This will give me better control in ensuring that levels aren't generated in a way that gives the player a badly generated level.
Needless to say - the graphics are temporary as I work on the code - but once the generator works well - I can work on adding elements such as items, enemies and the like to the generation!
Until next time,