Endless Mode Part 2: Variety

Hello again! Last week we talked about the basics of Bleed 2’s Endless Mode, and this week I’d like to start going a little deeper. One of the first challenges I ran into was how to make the randomly-generated levels feel varied and interesting, and I tried to solve this in a variety of ways.

First, the design of the chunks (the building blocks that make up a level.) Maybe this is obvious, but I tried to make sure the gameplay within every chunk was unique in some way, mainly through the architecture and hazard usage/placement. Some chunks are narrow and cramped while others are open with a missing a roof or wall, some use lots of ramps while others feature pass-through platforms… you get the idea.

Same thing with the kinds of enemies and how they’re used (one chunk might mainly use grenade enemies while another focuses on turrets… etc etc etc. This is really important too, but I’ll be getting into enemies a bit later.) Not all of the differences are so extreme, but every chunk provides something the others don’t, and I think the moment to moment contrast helps keep things fresh.

(By the way: in one of the examples above, you can see pits that extend way down to a floor. In the actual game, the floor is off-screen, so they look like bottomless pits. You get damaged and teleported back to safe ground before hitting the floor, so nobody will know the difference! This is to stop you from falling through to a different chunk, or coming back up through a chunk with an open ceiling.)

Next, I was under a time constraint when making Endless Mode and I didn’t think I’d be happy with the number of chunks I could create in that time. I got a little fancy and made chunks mirrorable: suddenly, every time I designed a chunk, I was getting two — the standard version and the mirrored version! The result looks like I just flipped the whole thing — and I did, but notice the green and red start and end tiles are still on the correct side, so the chunk is entered on the left and exited on the right (so they can still be put end-to-end properly with other chunks.)

I designed the chunks as asymmetrically as possible to maximize the effect of this. I also had to do some heavy editing of the “virtual reality” tileset that Endless Mode uses to make sure each tile had a mirrored equivalent. (The mirroring feature actually introduced a lot more trouble than this, but I’ll get into that later.) As a side note, I also made other random edits to the tileset, like including spikes so the levels could have damaging surfaces. Here’s a before-and-after of the relevant parts, because why not. (I did a making-of for the entire “virtual reality” environment in this post here, there’s a bunch of subtle effects to it!)

Finally, I achieved maximum fanciness with vertical chunks and u-turn chunks! Allowing the levels to change direction like that goes a LONG way towards making them feel dynamic. Unfortunately, it also introduces a lot of headaches — especially with u-turns. Chunks are designed to be traveled through left-to-right, but u-turns swap the player’s movement right-to-left (and now I have to account for chunks being both mirrored or not, and also traveled through in either direction.) Worse — and more relevant — levels were made by laying chunks down in a basically straight line before, but with u-turns added, levels have a high chance of folding into themselves and becoming all messed up.

Whatcha gonna do? Well, after all the chunks have been selected and laid out — but before converting them into the final array — I check them all first to make sure they aren’t overlapping each other. If an overlap is found I run through a series of fixes, re-checking the level layout after each fix (if it removes the overlap, great! If not, move on to the next fix.) I won’t bore you with the big list of fixes the game tries, but it’s a lot of shifting the order of chunks around, mirroring chunks, adding chunks and deleting chunks.

For example, in the level created above, all the system needs to do to solve it is mirror the first vertical chunk (marked with a purple colour.) Mirroring a vertical chunk makes it go down instead of up, creating enough room for the rest of the chunks below! You can see how the layout stays the same other than that one change.

If all else fails, it removes u-turn chunks one by one until there’s no overlaps — since u-turns are the only thing that cause overlaps, removing all of them will guarantee the problem is solved… but I use that only as a last resort because it makes boring levels.

Once there are no overlaps, I have a layout for a level! The next step is to make that level easy and fun to navigate, and a big part of that is a good camera system, which I’ll get into next week. I hope you’ll look forward to that adrenaline-pumping post!