03-28-2011, 07:10 PM
I had two different ideas on how level generation could work.
1) First, you create a piece of the level that's entirely filled with blocks. Then, you create an open space on the left and another on the right. From there you can create an empty path through the leftover blocks to connect the two open spaces; the type of path (e.g. snaking, straight, straight with a gap, etc.) would be chosen randomly before making the path, and a pathfinding thing would be used to actually make the path. For the next chunk, we'll just be using the previous chunk's rightside open space for the new leftside open space and continue along like this.
The best thing about this idea is that it can make interesting tunnels. The worst thing about this is that... it can only make tunnels; it wouldn't really be able to handle anything else.
Needed variables:
Opening space (leftside)
Ending space (rightside)
Tunnel Height
Tunnel Type
2) This system is a bit more like the the Splunky system. That is, you have a predefined set of different obstacles, and then you simply choose between them for each chunk (to increase the different possible chunks, you can make the different portions smaller than a whole chunk, then piece them together to make the chunk).
The best thing about this idea is that it is much more adaptable than the tunnel system above (it also makes it really easy to add in special rooms, like the boss rooms); the worst thing is that it relies on premade portions to create the chunks, meaning that levels can get old and boring pretty quickly.
@Guy, to fix the problem with those little gaps, we just gotta add a way to keep track of the chunk's position and then spawning the next chunk, rather than just spawning the next chunk according to the scrollspeed.
Also, I don't have GM8, so I can't check out your code, but that really didn't make very good, playable levels at all (of course, I suppose it wasn't really supposed to, anyway).
1) First, you create a piece of the level that's entirely filled with blocks. Then, you create an open space on the left and another on the right. From there you can create an empty path through the leftover blocks to connect the two open spaces; the type of path (e.g. snaking, straight, straight with a gap, etc.) would be chosen randomly before making the path, and a pathfinding thing would be used to actually make the path. For the next chunk, we'll just be using the previous chunk's rightside open space for the new leftside open space and continue along like this.
The best thing about this idea is that it can make interesting tunnels. The worst thing about this is that... it can only make tunnels; it wouldn't really be able to handle anything else.
Needed variables:
Opening space (leftside)
Ending space (rightside)
Tunnel Height
Tunnel Type
2) This system is a bit more like the the Splunky system. That is, you have a predefined set of different obstacles, and then you simply choose between them for each chunk (to increase the different possible chunks, you can make the different portions smaller than a whole chunk, then piece them together to make the chunk).
The best thing about this idea is that it is much more adaptable than the tunnel system above (it also makes it really easy to add in special rooms, like the boss rooms); the worst thing is that it relies on premade portions to create the chunks, meaning that levels can get old and boring pretty quickly.
@Guy, to fix the problem with those little gaps, we just gotta add a way to keep track of the chunk's position and then spawning the next chunk, rather than just spawning the next chunk according to the scrollspeed.
Also, I don't have GM8, so I can't check out your code, but that really didn't make very good, playable levels at all (of course, I suppose it wasn't really supposed to, anyway).