Continuous Generating a 2D Level (Platform)

Started by
1 comment, last by EduardoMoura 11 years, 3 months ago

Well, I have been mocking up ideas about a 2D sidescroller that would continuously generate a level. Well I have a idea on how to do this, but I am not sure its the best one. So my question is mostly,how would you go about this?

The "requirements" are quite simple, it should be able to generate random landscapes from a basic set of pieces, slopes, platforms multiple paths are all to be accounted.

I am thinking in have some sort of map that keeps each piece connection points the beggining and the end, and it would set the pieces accordingly one after the other. Ofcouse this would need alot of conditions, but I can't think of another way that lets me have control, but still generate a infinite level.

Check out my new blog: Morphexe

Advertisement

I think exactly how your game is designed would affect how exactly you would go about it. Like what the pieces were like, whether the layout was tile-based, etc. I can think of an idea where the game is tiled and everything takes up one "square," then you could just have the game spawn a new set of squares for a column once the player has reached a certain relative column. If you want the game to auto-scroll so the player doesn't control the horizontal movement of the game field, you could just have it constantly "pushing" the grid to the side and spawning new columns as it goes. It would have to check to make sure there was enough "free space" to let the player get through, and if you wanted to make sure multiple paths were available, this would take more checking.

You could also make it a little more pseudo-random landscapes by creating pre-made "screens" where you create entire screen-sized maps yourself with pre-placed platforms, then give each a property of which ones it can connect to on each side, then have the game "link" those screens together as the player moves. If you've ever seen Mega Man 9 or 10 Endless Attack mode, it is something like that... the maps are already laid out, but the order you encounter them is random. While MM9/MM10 use entire stretches of premade maps, you could make them just small screens and have them link together in a random order.

"Run until you die" games often have what I think you're looking for, and they usually use the second example (because they often get very fast, and the player can "learn" what to expect, so it's not 100% random placement of the objects). Play games like Doodle Jump, Gravity Guy, and Jetpack Joyride and you will get kind of an idea of how this kind of concept is put into play. Then adapt that to the kind of game you're wanting to make.

I would also go ahead and plan all of the types of "pieces" you would like to use, and create a couple non-random stages for a player to play (playable or even just in concept). Then you will have an idea of how exactly all your pieces fit together, and what requirements they have for joining each other. Once you know all the kinds of pieces you want exactly, you will have a better idea of how you should go about randomly fitting them together.

In the end, there are many ways you could do this (once I made a game like this in an old game creation software, where off the screen there was an object flying around and it would "fire" out platforms at random intervals like a gun lol... this is probably not the best idea though) and the way you end up doing it will depend a lot on how you design your pieces, how fast-paced you want the game to be, what kind of control the player will have over the direction of the screen, etc. Create the entire game in planning, and the path to how you should create this one element of it should open up.

Exactly, I was thinking in maybe have certain areas already made an just stitch them together to create a new random area, I also though about the tiled approach, and I think I need something like that so that I can create really random scenarios. So I think my idea was actually to create a hybrid of the two examples you gave.

But I wanted to hear other to check if they have better ideas on how to lay the system, there is no such thing as too much info. One problem that just came to my mind is there is no moving back in the map, since storing a infinitely large level would take a huge chunk of memory if the game was running long enough but in this case I doesn't bother me , since I wont need it.

Thanks for you feedback nesseggman.

Check out my new blog: Morphexe

This topic is closed to new replies.

Advertisement