I've been thinking about putting together a platformer with the following setup:
-Game must use only a single room for everything. (Like a hub. Try playing games like Approaching Dawn or Core of Innocence for an example of what I mean)
-There will be at least 10 levels each with randomly generated areas within.
Please let me know if this is possible within MMF2's capabilities. This is something I would really like to try out with the program.
Yes that is possible. But the more random you make the level layouts the less control you have over whether the levels will be any fun to play through or if they would even possible to progress through.
Originally Posted by AndyUK Yes that is possible. But the more random you make the level layouts the less control you have over whether the levels will be any fun to play through or if they would even possible to progress through.
Very true. So how would I go about randomizing level layouts? I've never attempted that before with the program.
I think going completely random is a bad idea, you'll get almost no control over anything and there's a very high chance the design of the rooms will be rubbish. So instead of every single 16x16 square being one of a dozen different objects I think it's best to sort of create certain templates and then choose from them semi randomly.
So design your rooms, however many you want and then let the game generate a map, selecting the rooms as it goes.
This also means you can control whether rooms have exits that let you return to somewhere you've just come from. If you've just walked right out of a room you'll want an exit to the left in your new room, right?
It sounds pretty advanced but I don't think it's too difficult.
Originally Posted by AndyUK I think going completely random is a bad idea, you'll get almost no control over anything and there's a very high chance the design of the rooms will be rubbish. So instead of every single 16x16 square being one of a dozen different objects I think it's best to sort of create certain templates and then choose from them semi randomly.
So design your rooms, however many you want and then let the game generate a map, selecting the rooms as it goes.
This also means you can control whether rooms have exits that let you return to somewhere you've just come from. If you've just walked right out of a room you'll want an exit to the left in your new room, right?
It sounds pretty advanced but I don't think it's too difficult.
Good point.
Hmm...I've never had my games generate a map before, how does that work?
It would be up to you really.
Perhaps actual active objects that are like a mini map? Then a 'you are here' object sitting on top that shows where the player is but actually is used by the game to know what room to display on screen.
I hope you know what i'm getting at here,
so say your entire game map can be as big at 10 rooms by 10 rooms your game would start by creating tiny active objects in a grid. say, 8x8 sized squares, with each one representing a different room and maybe one to mean an empty room.
and if you have different room types
Active 1 = Room type 1
Active 2 = Room type 2
Active 3 = Room type 3
When your player exits a room the 'you are here' object moves over one room too.
Originally Posted by AndyUK It would be up to you really.
Perhaps actual active objects that are like a mini map? Then a 'you are here' object sitting on top that shows where the player is but actually is used by the game to know what room to display on screen.
I hope you know what i'm getting at here,
so say your entire game map can be as big at 10 rooms by 10 rooms your game would start by creating tiny active objects in a grid. say, 8x8 sized squares, with each one representing a different room and maybe one to mean an empty room.
and if you have different room types
Active 1 = Room type 1
Active 2 = Room type 2
Active 3 = Room type 3
When your player exits a room the 'you are here' object moves over one room too.
That could work.
Hmm...I think I understand, but the best way for me to learn this method is to have a quick example file that goes over the basics.
A game on the atari was randomly generated.
The player would walk off the edge of the screen and a pre-made room would be randomly selected.
You could try doing that but save the room number into an array if the array location reads zero.
Then you have a procedurally generated world with continuity.
Originally Posted by Airflow A game on the atari was randomly generated.
The player would walk off the edge of the screen and a pre-made room would be randomly selected.
You could try doing that but save the room number into an array if the array location reads zero.
Then you have a procedurally generated world with continuity.
Hmm...that could work best. I've never used arrays before in my games, so I don't know where to start with that one.
Perhaps if it is possible, could you show me the basics of this in an example file?
Simply replace the button with 'player moves off screen or enters door' and use 'roomnum' to load a level.
If you get good at using it, there's an improved version which lets you control the rarity of rooms.
If you give 4 door rooms 50% chance spawn, you can make a playable world.
But the mazyness is low, and you get occasional dead rooms.
The chance of spawning in one is 1%. the chance of spawning in dead room twins is 0.000001%
Maybe something in-between?
If you can come up with a means to test what rooms are inaccessible, then you can do the 3-exit room thing, check for inaccessibility, then change inaccessible rooms to 4-exits.
The problems that might come up, though, are:
1: making something that checks for inaccessible rooms might be tricky to make and slow to run, and
2: in the rare event that most of the map is inaccessible, you'd have to convert a lot of rooms to 4-exit.
But there would still be ways to refine it. Procedural generation is a fun thing to play with.
Though I wonder if it could also be done as simply as:
-Player character overlaps with invisible trigger at the end of the room
= Set Random room teleport Counter to Random (10)
And depending on the number the pool chooses; the number will teleport him to a randomized room (the player will change position relative to an invisible active object)