Author Topic: Single Screen Procedural Platformer Levels...  (Read 15812 times)

guest509

  • Guest
Single Screen Procedural Platformer Levels...
« on: July 17, 2013, 01:14:45 AM »
...seems that making a comic action RL has been using up quite a bit of my creative brain power (think bubble bobble) The mains aspects are the wacky theme, single screen levels and multiplayer co-op chaos.
 
  Now I'm trying to figure out how to make procedural levels that don't suck ass, and I think I am failing. I was thinking of retreating and going to the semi-procedural route and try for what Spelunky did.

  Spelunky took premade chunks one screen big, with some wildcard blocks here and there in each chunk, and strung them together into 4x4 levels. Players start at the top, make their way down to the door.

  I was also thinking of just making a TON of preset screen skeletons. There are hundreds and hundreds I could steal from all of the different comic action games over the years. I could easily come out with 1000 levels.

  Each level would be just a blank template of where the blocks would go, where enemy spawn points would be, where 'traps' like spikes and lava can spawn.

  After that I would pick a THEME for the level. Say, Ice Cave or Lava Dungeon or whatever. This would control the 'skin' on the blocks, what types of baddies might spawn at the spawn points, the nature of the traps (lava, acid, spikes, pit of snakes, lava shooter etc...) and what each 'wild card' chunk might consist of.

  The goal is to not just reskin the level, but add little bits to make it cohesive to theme and different each time.

A good roguelike provides replayability through variety in each run through. You get that through content of the dungeons, not necessarily shape of the dungeon. I wonder if that can be applied to jumper games?

Also, I'm not sure Spelunky answered that question...

Trystan

  • Rogueliker
  • ***
  • Posts: 164
  • Karma: +0/-0
    • View Profile
    • my blog
Re: Single Screen Procedural Platformer Levels...
« Reply #1 on: July 17, 2013, 01:26:39 AM »
One advantage of this kind of semi-procedural style of gluing prefabricated pieces together is that you can start with a few pieces and a few ways to combine them. Later you can add more pieces, more rules about how to combine them, and eventually some procedurally generated pieces. I like the 'wild card' idea - it seems like it's another way to add interesting content. Doing multiple clean up passes after the main level-gen could help make it cohesive and interesting.

I'm sure some will say that it will start to look repetitive and each level will look the same, but all rooms pretty much do look the same in real life (how many completely novel bathrooms have you seen?) and the standard room and corridor layout looks all the same to me.

Let me know if you start working on this - I'd like to follow it.

guest509

  • Guest
Re: Single Screen Procedural Platformer Levels...
« Reply #2 on: July 17, 2013, 02:31:59 AM »
Building the engine now, sorta sporadically since the 7DRL concluded. Almost made this my 7DRL actually.

When the randomized levels get included, that's when it gets interesting.

EDIT: By 'engine' I mean movement engine, jumping about and what not. It's 90% complete.

Paul Jeffries

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 257
  • Karma: +1/-0
    • View Profile
    • Vitruality.com
Re: Single Screen Procedural Platformer Levels...
« Reply #3 on: July 17, 2013, 09:32:51 PM »
Whenever thinking about how to procedurally generate something the very first step is to figure out what design rules apply in that situation.

Obviously, those rules will vary depending on exactly how your game works, but as a starting point we can probably come up with a couple of basic ones.

For platform games, the most basic rule is that all platforms need to be accessible.  That means either:
a) You can jump up onto it
b) You can fall down onto it
c) There is a ladder that connects to it (if your game has ladders - possibly substitute springboard, lift, whatever.)

That means that for each platform you can define certain 'zones' where other platforms are reachable and places where they are not.

So, to generate levels that fit that rule, as a brute-force first-pass I might try something like:

- Randomly determine a starting location and place a platform there
- For a certain maximum number of 'tries':
  - Randomly determine a new platform position
  - If that platform can be accessed from this one, place it down and recursively repeat, using the new platform as your starting location.
- Continue until you have enough platforms.

Of course it would ultimately need to be a bit more complicated than that; you need to prevent platforms overlapping or being too close together, you might want to set a chance that it will 'grow' the current platform in a particular direction rather than starting a new one, you'd need to check you weren't blocking access to other platforms by putting down a new one etc. etc. etc.   Probably there are lots of other things you'd need to factor in to make sure the level was fun to play, but doing it this way you could at least be sure that your level was fully accessible.

guest509

  • Guest
Re: Single Screen Procedural Platformer Levels...
« Reply #4 on: July 17, 2013, 11:53:29 PM »
I'm going to admit to finding a lazy work around to that Paul. The 'reachable' issue, that is.

Everywhere is reachable with...
...Jet Packs.
...A Solomon's Key wand that makes and breaks blocks.
...Fairy Wings, think Joust style tap tap tap flap flap flap.
...Wrap around levels work as well to broaden the reachable areas.
...Jump through platforms also open things up very nicely...

Heck man with just the flying mechanics you can simply add gravity to a tunnel and corridor algorithm and have playable space right away!

That said, I've not been so satisfied with pure procedural levels Paul. Not in this setting at lease. I've looked at how some are doing it and I'm not so sure it's the way to go for me, unless I think somehow I can do it some much better...

For a scifi shoot and jetpack game, like a Herocore style game with no gravity maybe, hell yeah. Perfect for procedural levels. Overcoming gravity is the key to really opening up...just a thought.

I'm more interested in making fun and varied content as opposed to being a slave to the pure procedural levels as is the standard RL convention. It might not end up being very roguelike at all, but the goal is FUN WITH FRIENDS through a quick paced, light game with lots of variety.

Not knocking procedural levels, hell no. Making the sector and star systems for KlingonRL and making the rotating planets in Sun Crusher!!! was 90% of the fun for me. I'm still working with my MAX VARIETY RIGHT AWAY theory, and feel I'll get that from 100 well made skeletons with infinite variation based on theme.

Of course this is all just talk...

requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Single Screen Procedural Platformer Levels...
« Reply #5 on: July 18, 2013, 03:56:40 AM »
A procedural little big planet (sack peoples!) would be awesome.


I think it's more about how you string together meaningful challenges and complexity while regulating flow.

In a procedural platformer you'll have active obstacles that require you to make a series of moves to progress. As long as these obstacles are reachable (within jumping range), you can ensure that the obstacle is passable. Then there are also switches and other things that manage your progress. Mario physics when you jump on enemies can also allow you to generate enemies as a part of the puzzle.

You can also use an AI to play maps with variance to determine what areas of the map are more challenging than others. I forgot what this is called but there are a number of articles on it if you... want me to look it up. It's a rather challenging concept to implement though.


You want to make a Jumper game, right?

guest509

  • Guest
Re: Single Screen Procedural Platformer Levels...
« Reply #6 on: July 18, 2013, 05:47:33 AM »
Yeah, a bubble bobble-like game with semi procedural levels. Some gameplay changing items thrown in.

Don't bother looking up that algorithm, it wouldn't help me much. There will be no puzzles or AI testing in my game even in my wildest and most expansive iterations.

SIMPLIFY.

Vanguard

  • Rogueliker
  • ***
  • Posts: 1112
  • Karma: +0/-0
    • View Profile
Re: Single Screen Procedural Platformer Levels...
« Reply #7 on: July 18, 2013, 02:50:48 PM »
What about static levels where the stage design stays the same, but different events occur to add variety?

Say that at the start of each level, the game randomly selects an event from a list.  Events could be things like magma that gradually rises from the bottom of the level, or a regular enemy being replaced with a boss enemy, or an earthquake that causes blocks on the ceiling and raised platforms to fall, killing anything beneath them, or giving all players and enemies a powerful weapon.

So even though you've played level 1 and 2 before, level 1 where everyone has mega lasers and level 2 where the wind blows you around are still novel.

Bubble Bobble has static stages and enemies, but its weird item spawning system manages to give it a lot of variety.  It'd be worth considering something like that as well.

Edit:

Friendly fire is turned on.
"Evil twin" enemies spawn with identical abilities to the players.
Players deal collision damage to enemies instead of the other way around.
A giant monster shows up and the bad guys side with the players against the greater threat.
Low gravity.
A slow but indestructible enemy is spawned.  Basically that ghost from Bubble Bobble.
Time is sped up.
The game spawns several times more than the normal amount of power ups.
Player 1 controls player 2 and vice versa.
Enemies are indestructible until the player collects a power up like in Pac-Man.
No enemies spawn, and instead players 1 and 2 compete in some way, with the winner receiving a power up.  Basically the bottle item from Bubble Bobble.
Stage terrain is especially brittle, and many things can now dig through it.
Players and enemies regain health when dealing damage.
A turret spawns, and shoots bullets that kill both players and enemies (or maybe it needs to be manually controlled, so players will want to race to get to it before the bad guys?).
Certain blocks in the stage are replaced with teleporters, and stepping on one will send you to another.
Enemies are undead, and will get back up after being killed.  Players must find a permanent disposal method, or kill them all at once or something.
The players are given a special condition (eg take no damage or clear the stage quickly) and are rewarded if they succeed.
« Last Edit: July 18, 2013, 05:10:39 PM by Vanguard »

guest509

  • Guest
Re: Single Screen Procedural Platformer Levels...
« Reply #8 on: July 18, 2013, 10:42:59 PM »
Hey thanks for the ideas Van!

I'm going to have to scale back a bit though, just get the basics done then go from there. The death sentence, for me, in all of my projects is over ambition.

 :-[

halvorg

  • Newcomer
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Single Screen Procedural Platformer Levels...
« Reply #9 on: July 18, 2013, 11:58:58 PM »
If you divide the level up in W * H vertices you can randomly generate edges between said vertices. Adding constraints on where the algorithm is allowed to place the edges.

Example constraints could be: Max nof. cyclic edges (a cyclic edge would be a solid unpassable block), max edge length, minimum horizontal/vertical edge distance, max number of corners in an acyclic edge, allow diagonal vertices?, etc...

Maybe it is a bit naive to assume that this would work well without lots of hassle, I don't know. It makes your levels more random than a puzzle of ready-made blocks though, and you could potentially make visiually nice levels if you limit max edge length as well - as there is a finite amount of shapes that can be made with a edge of length x.

You'd have to test&tweak a lot : )

Edit: This approach is not that different from assembling ready-made components now that I think of it, but you could create more diverse levels that are not as visually impressive with looser constraints and a high vertex resolution for your algorithm.
« Last Edit: July 19, 2013, 12:09:24 AM by halvorg »

guest509

  • Guest
Re: Single Screen Procedural Platformer Levels...
« Reply #10 on: July 19, 2013, 12:03:34 AM »
Yeah, and in the end does it add much to your game? Does it up the fun factor at all?

halvorg

  • Newcomer
  • Posts: 15
  • Karma: +0/-0
    • View Profile
Re: Single Screen Procedural Platformer Levels...
« Reply #11 on: July 19, 2013, 12:08:57 AM »
Yeah, and in the end does it add much to your game? Does it up the fun factor at all?

Well, that depends on how you'd do it of course.

It's just that I have played some games where the procedurally generated content is too "transparent", i.e. you can easily distinguish the puzzle pieces used to generate the levels - making them less fun in my opinion. (Dungeons of Dredmor is a big sinner in this regard in my opinion.)

It's a bit unfair of me to assume your random generation would be bad simply because there are some bad examples, I see that, sorry.
« Last Edit: July 19, 2013, 12:14:40 AM by halvorg »

guest509

  • Guest
Re: Single Screen Procedural Platformer Levels...
« Reply #12 on: July 19, 2013, 01:22:22 AM »
No I wasn't about to be offended, I was just wondering where one's efforts would be best used. I could make this magnificent fully procedural level generator and feel great about it, or just hardcode 100 decent level skeletons stolen mostly from other single screen games and then procedurally fill that space with enemies and items all according to a set of themes.

So each game is still highly variable, which is the goal, but the architecture isn't procedural. The architecture is randomly selected. The content is procedural.

I think that achieves the goal of procedural generation. Which is to add variety, replayability. Originally it might have been just a space saver due to limited system resources, but it stuck because it adds variety and it's fun to program.

guest509

  • Guest
Re: Single Screen Procedural Platformer Levels...
« Reply #13 on: July 19, 2013, 01:35:34 AM »
Here, this is what I mean.

White blocks can either be blocks or not.
Yellow is a item or treasure.
Red is a baddie, picked according to theme (Monkeys in the jungle, snowmen in the snow level, etc...)
Orange can be an item/treasure or a baddie.
Black lines can be ladders that some baddies can climb (or vines depending on theme)

The blocks on the screen can either be jump through or not (I didn't show this graphically), also there can be spots to add 'traps' like spikes, lava, acid or whatever else according to theme. The bricks will be skinned according to theme as bricks, dirt and grass, marshmellows, etc...

And this is just one example, you can surely work up dozens.


requerent

  • Rogueliker
  • ***
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Single Screen Procedural Platformer Levels...
« Reply #14 on: July 19, 2013, 01:42:21 AM »
Cute ^_^.